go_router_riverpod icon indicating copy to clipboard operation
go_router_riverpod copied to clipboard

Complete firebase example

Open lucavenir opened this issue 1 year ago • 2 comments

The firebase folder should receive some more love. Codegen, new APIs, stuff like that.

lucavenir avatar May 27 '23 00:05 lucavenir

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?

yeasir-bjit avatar Jan 31 '24 03:01 yeasir-bjit

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

lucavenir avatar Jan 31 '24 09:01 lucavenir