-
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
7cc5be1
commit 1c0d1b4
Showing
8 changed files
with
82 additions
and
37 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 was deleted.
Oops, something went wrong.
15 changes: 7 additions & 8 deletions
15
example/lib/get/home/module.dart → example/lib/get/modules/home_module.dart
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,25 @@ | ||
import 'package:example/shared/modules/trivia/new/page.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
import '../extensions/get_module.dart'; | ||
|
||
class TriviaModule extends GetModule { | ||
@override | ||
List<GetRoute> get routes => [ | ||
NewTriviaRoute(), | ||
]; | ||
} | ||
|
||
class NewTriviaRoute extends GetRoute { | ||
NewTriviaRoute(); | ||
|
||
@override | ||
GetPage get asGetPage => GetPage( | ||
name: NewTriviaPage.routeName, | ||
page: () => NewTriviaPage( | ||
onDoneTap: () { | ||
throw UnimplementedError('Must go to TriviaGamePage'); | ||
}, | ||
), | ||
); | ||
} |
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,7 +1,9 @@ | ||
import 'package:example/shared/modules/home/page.dart'; | ||
import 'modules/home/page.dart'; | ||
import 'modules/trivia/new/page.dart'; | ||
|
||
class AppRoutes { | ||
static const root = HomePage.routeName; | ||
static const profileRoot = '/profile'; | ||
static const notFound = '/not-found'; | ||
static const newTrivia = NewTriviaPage.routeName; | ||
} |
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,41 @@ | ||
import 'package:buzz/buzz.dart'; | ||
import 'package:core/core.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
//TODO: Should this be NewTriviaNavigateToCommand? | ||
class NavigateToNewTrivia extends NavigateToCommand { | ||
NavigateToNewTrivia() | ||
: super( | ||
directions: NavigationDirections( | ||
routeBuilder: () => NewTriviaPage.routeName, | ||
), | ||
); | ||
} | ||
|
||
class NewTriviaPage extends StatelessWidget { | ||
static const String routeName = '/new-trivia'; | ||
static const String pageName = 'NewTriviaPage'; | ||
|
||
const NewTriviaPage({ | ||
Key? key, | ||
required this.onDoneTap, | ||
}) : super(key: key); | ||
|
||
final Function() onDoneTap; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return BasePage( | ||
name: 'New Trivia', | ||
actions: [ | ||
MainAction( | ||
label: 'Done', | ||
onPressed: () { | ||
debugPrint('$runtimeType onDoneTap'); | ||
onDoneTap(); | ||
}, | ||
), | ||
], | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.