Commit f74aeedc3ac6e239e43084ea93315e045b324fed
1 parent
f6c73562
feat:首页类名调整
Showing
2 changed files
with
5 additions
and
5 deletions
lib/pages/home/bloc.dart
@@ -9,8 +9,8 @@ import '../../utils/log_util.dart'; | @@ -9,8 +9,8 @@ import '../../utils/log_util.dart'; | ||
9 | import 'event.dart'; | 9 | import 'event.dart'; |
10 | import 'state.dart'; | 10 | import 'state.dart'; |
11 | 11 | ||
12 | -class ModuleSelectBloc extends Bloc<HomeEvent, HomeState> { | ||
13 | - ModuleSelectBloc() : super(HomeState().init()) { | 12 | +class HomeBloc extends Bloc<HomeEvent, HomeState> { |
13 | + HomeBloc() : super(HomeState().init()) { | ||
14 | on<InitEvent>(_init); | 14 | on<InitEvent>(_init); |
15 | } | 15 | } |
16 | 16 |
lib/pages/home/view.dart
@@ -28,7 +28,7 @@ class HomePage extends StatelessWidget { | @@ -28,7 +28,7 @@ class HomePage extends StatelessWidget { | ||
28 | Widget build(BuildContext context) { | 28 | Widget build(BuildContext context) { |
29 | return BlocProvider( | 29 | return BlocProvider( |
30 | create: (BuildContext context) => | 30 | create: (BuildContext context) => |
31 | - ModuleSelectBloc() | 31 | + HomeBloc() |
32 | ..add(InitEvent()), | 32 | ..add(InitEvent()), |
33 | child: Builder(builder: (context) => _HomePageView()), | 33 | child: Builder(builder: (context) => _HomePageView()), |
34 | ); | 34 | ); |
@@ -42,7 +42,7 @@ class _HomePageView extends StatelessWidget { | @@ -42,7 +42,7 @@ class _HomePageView extends StatelessWidget { | ||
42 | BlocListener<UserBloc, UserState>(listener: (context, state) { | 42 | BlocListener<UserBloc, UserState>(listener: (context, state) { |
43 | debugPrint('WQF ModuleSelectPage BlocListener state: $state'); | 43 | debugPrint('WQF ModuleSelectPage BlocListener state: $state'); |
44 | }), | 44 | }), |
45 | - BlocListener<ModuleSelectBloc, HomeState>( | 45 | + BlocListener<HomeBloc, HomeState>( |
46 | listener: (context, state) { | 46 | listener: (context, state) { |
47 | Log.d("WQF HomePage listener state: $state"); | 47 | Log.d("WQF HomePage listener state: $state"); |
48 | if (state is UpdateDialogState) { | 48 | if (state is UpdateDialogState) { |
@@ -54,7 +54,7 @@ class _HomePageView extends StatelessWidget { | @@ -54,7 +54,7 @@ class _HomePageView extends StatelessWidget { | ||
54 | } | 54 | } |
55 | 55 | ||
56 | Widget _homeView() => | 56 | Widget _homeView() => |
57 | - BlocBuilder<ModuleSelectBloc, HomeState>( | 57 | + BlocBuilder<HomeBloc, HomeState>( |
58 | builder: (context, state) { | 58 | builder: (context, state) { |
59 | return Scaffold( | 59 | return Scaffold( |
60 | body: Container( | 60 | body: Container( |