Skip to content

Commit

Permalink
extract the app method (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
bejavu authored Mar 8, 2020
1 parent e4596f1 commit 121ee1c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ void main() async {
DeviceOrientation.portraitUp
]).then((_) async {
runZoned<Future<void>>(
() async => runApp(CustomTheme(
initialThemeKey: MyThemeKeys.DEFAULT,
child: new MyApp(
store: await AppFactory().getStore(),
),
)),
() async => runApp(await CustomThemeApp()),
onError: (Object error, StackTrace stackTrace) async {
try {
await AppFactory().reportError(error, stackTrace);
Expand All @@ -53,6 +48,15 @@ void main() async {
};
}

Future<CustomTheme> CustomThemeApp() async {
return CustomTheme(
initialThemeKey: MyThemeKeys.DEFAULT,
child: new MyApp(
store: await AppFactory().getStore(),
),
);
}

class MyApp extends StatefulWidget {
final Store<AppState> store;

Expand Down

0 comments on commit 121ee1c

Please sign in to comment.