MultiProvider In Flutter

MultiProvider In Flutter :

MultiProvider In Flutter
void main() {
  SystemChrome.setSystemUIOverlayStyle(
    SystemUiOverlayStyle.dark.copyWith(
        statusBarColor: Colors.transparent,
        statusBarIconBrightness: Brightness.light),
  );
  Injector.configure(Flavor.Network);
  runApp(MultiProvider(
    providers: [
      Provider<UserBloc>(
        builder: (_) => UserBloc(),
      ),
      Provider<LoginBloc>(
        builder: (_) => LoginBloc(),
      )
    ],
    child: AppStateContainer(child: StartApp()),
  ));
}


class StartApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Book',
      theme: ThemeData(
          brightness: Brightness.light,
          accentColor: Colors.green,
          primaryColor: Colors.green,
          primarySwatch: Colors.green),
      initialRoute: '/',
        routes: <String, WidgetBuilder>{
          '/': (context) => HomePage(),
          '/login': (context) => LoginPage(),
        }
    );
  }
}

The flutter tutorial  is a website that bring you the latest and amazing resources of code. All the languages codes are included in this website. The languages like flutter, android, java,kotlin etc.with the help of this languages any user can develop the beautiful application

For more information about Flutter. visit www.fluttertutorial.in