go_router_riverpod
go_router_riverpod copied to clipboard
Complete firebase example
The firebase
folder should receive some more love. Codegen, new APIs, stuff like that.
lass AppWithFirebase extends ConsumerWidget {
const AppWithFirebase({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final router = ref.watch(routerProvider);
return MaterialApp.router(
routeInformationParser: router.routeInformationParser,
routerDelegate: router.routerDelegate,
routeInformationProvider: router.routeInformationProvider,
title: 'flutter_riverpod + go_router Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
);
}
}
final router = ref.watch(routerProvider); This will rebuild whole material app every route change or rebuild the router, does it legit?
As of now, yes, the firebase_example
folder contains legacy code. As you've pointed out the current code is less than ideal. Please refrain from reading that example. You can easily apply firebase-wise considerations with the main example