-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f427f1
commit 7cc5be1
Showing
9 changed files
with
80 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,41 @@ | ||
import 'package:buzz/buzz.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
import '../../shared/modules/home/page.dart'; | ||
import '../extensions/get_module.dart'; | ||
import 'page.dart'; | ||
|
||
class HomeModule extends GetModule { | ||
final String profileRoute; | ||
|
||
HomeModule({ | ||
required this.profileRoute, | ||
}); | ||
|
||
@override | ||
List<GetRoute> get routes => [ | ||
HomeRoute(), | ||
HomeRoute(profileRoute), | ||
]; | ||
} | ||
|
||
class HomeRoute extends GetRoute { | ||
HomeRoute(this.profileRoute); | ||
|
||
final String profileRoute; | ||
|
||
@override | ||
GetPage get asGetPage => GetPage( | ||
name: HomePage.routeName, | ||
page: () => HomePage( | ||
onNewTriviaGameTap: () { | ||
Buzz.fire( | ||
NavigateToCommand.named(profileRoute), | ||
); | ||
}, | ||
onGoToBuzzTap: () { | ||
Buzz.fire( | ||
GoToBuzzEventsDashboard(), | ||
); | ||
}, | ||
), | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import 'package:example/shared/modules/home/page.dart'; | ||
|
||
class AppRoutes { | ||
static const root = '/'; | ||
static const root = HomePage.routeName; | ||
static const profileRoot = '/profile'; | ||
static const notFound = '/not-found'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class HomePage { | ||
static const String routeName = '/'; | ||
static const String pageName = 'HomePage'; | ||
|
||
Widget viewBuilder() => const HomeView(); | ||
} | ||
|
||
class HomeView extends StatelessWidget { | ||
const HomeView({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: Center( | ||
child: ElevatedButton( | ||
child: const Text('New trivia game'), | ||
onPressed: () {}, | ||
), | ||
), | ||
); | ||
} | ||
} |