Skip to content

Commit

Permalink
Start updating the app startup logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bizz84 committed Nov 26, 2024
1 parent 2fdc5e7 commit 17df9ee
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 62 deletions.
6 changes: 6 additions & 0 deletions lib/src/app.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:starter_architecture_flutter_firebase/src/routing/app_router.dart';
import 'package:starter_architecture_flutter_firebase/src/routing/app_startup.dart';

class MyApp extends ConsumerWidget {
const MyApp({super.key});
Expand All @@ -12,6 +13,11 @@ class MyApp extends ConsumerWidget {
final goRouter = ref.watch(goRouterProvider);
return MaterialApp.router(
routerConfig: goRouter,
builder: (_, child) {
return AppStartupWidget(
onLoaded: (_) => child!,
);
},
theme: ThemeData(
colorSchemeSeed: primaryColor,
unselectedWidgetColor: Colors.grey,
Expand Down
10 changes: 10 additions & 0 deletions lib/src/routing/app_startup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,13 @@ class AppStartupErrorWidget extends StatelessWidget {
);
}
}

class AppStartupDataWidget extends StatelessWidget {
const AppStartupDataWidget({super.key, required this.child});
final Widget child;

@override
Widget build(BuildContext context) {
return child;
}
}
Loading

0 comments on commit 17df9ee

Please sign in to comment.