Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.01 KB | None | 0 0
  1. class App extends StatelessWidget {
  2.   @override
  3.   Widget build(BuildContext context) {
  4.     final userRepository = Provider.of<UserRepository>(context);
  5.     return Provider<UserRepository>(
  6.       child: MaterialApp(
  7.         localizationsDelegates: [
  8.           GlobalMaterialLocalizations.delegate,
  9.           GlobalWidgetsLocalizations.delegate,
  10.         ],
  11.         supportedLocales: [
  12.           const Locale('en', 'US'),
  13.           const Locale('id', 'ID'),
  14.         ],
  15.         debugShowCheckedModeBanner: true,
  16.         // debugShowMaterialGrid: true,
  17.         title: AppConfig().appName,
  18.         theme: AppConfig().themeData,
  19.         initialRoute: '/',
  20.         routes: <String, WidgetBuilder>{
  21.           '/': (context) => const Home(),
  22.           '/login_page': (context) {
  23.             return LoginPage(
  24.               initBloc: () {
  25.                 return LoginBloc(Provider.of<UserRepository>(context));
  26.               },
  27.             );
  28.           },
  29.         },
  30.       ),
  31.       value: userRepository,
  32.     );
  33.   }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement