Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class App extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- final userRepository = Provider.of<UserRepository>(context);
- return Provider<UserRepository>(
- child: MaterialApp(
- localizationsDelegates: [
- GlobalMaterialLocalizations.delegate,
- GlobalWidgetsLocalizations.delegate,
- ],
- supportedLocales: [
- const Locale('en', 'US'),
- const Locale('id', 'ID'),
- ],
- debugShowCheckedModeBanner: true,
- // debugShowMaterialGrid: true,
- title: AppConfig().appName,
- theme: AppConfig().themeData,
- initialRoute: '/',
- routes: <String, WidgetBuilder>{
- '/': (context) => const Home(),
- '/login_page': (context) {
- return LoginPage(
- initBloc: () {
- return LoginBloc(Provider.of<UserRepository>(context));
- },
- );
- },
- },
- ),
- value: userRepository,
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement