File tree Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -16,17 +16,7 @@ class AppRouter extends StatelessWidget {
16
16
@override
17
17
Widget build (BuildContext context) {
18
18
return MultiBlocProvider (
19
- providers: [
20
- BlocProvider <UssdCodeBloc >(
21
- create: (context) => getIt (),
22
- ),
23
- BlocProvider <AccountsBloc >(
24
- create: (context) => getIt (),
25
- ),
26
- BlocProvider <ThemeBloc >(
27
- create: (context) => getIt (),
28
- ),
29
- ],
19
+ providers: blocProviders,
30
20
child: BlocBuilder <ThemeBloc , ThemeState >(
31
21
builder: (context, themeState) {
32
22
return MaterialApp .router (
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import 'package:shared_preferences/shared_preferences.dart';
5
5
import 'package:sqflite/sqflite.dart' ;
6
6
import 'package:todo/app/dependencies/dependencies.config.dart' ;
7
7
8
+ export 'providers.dart' ;
9
+
8
10
final getIt = GetIt .instance;
9
11
10
12
@module
Original file line number Diff line number Diff line change
1
+ import 'package:flutter_bloc/flutter_bloc.dart' ;
2
+ import 'package:todo/app/app.dart' ;
3
+ import 'package:todo/nauta/nauta.dart' ;
4
+ import 'package:todo/ussd_codes/ussd_codes.dart' ;
5
+
6
+ final blocProviders = < BlocProvider > [
7
+ BlocProvider <UssdCodeBloc >(
8
+ create: (context) => getIt (),
9
+ ),
10
+ BlocProvider <AccountsBloc >(
11
+ create: (context) => getIt (),
12
+ ),
13
+ BlocProvider <ThemeBloc >(
14
+ create: (context) => getIt (),
15
+ ),
16
+ ];
You can’t perform that action at this time.
0 commit comments