I want to use flutter_riverpods and go_router in my app to manage the state of the bottomNavigationBar and enable signing out of the whole app from the settings page which is in the bottomNavigationBar. How can I integrate ProviderScope in the app? The main function looks like this:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
await UserDataPreferences.init();
runApp(
MultiProvider(
providers: [
ChangeNotifierProvider(create: (_) => ThemeProvider()),
ChangeNotifierProvider(create: (_) => UserDataProvider()),
ChangeNotifierProvider(create: (_) => SelectedBusSeats()),
ChangeNotifierProvider(create: (_) => ApplicationState()),
Provider(create: (_) => BusServices()),
],
child: const MyApp(),
),
);
}
I wrapped MultiProver with the ProviderScope and it didn't work. I also wrapped MyApp with ProviderScope, while both are inside MultiProvider, and this didn't work either.