Blame view

lib/pages/user/bloc/user_bloc.dart 452 Bytes
c61b3c1a   Key   feat: toast_util....
1
  import 'package:flutter_bloc/flutter_bloc.dart';
c95453ce   Key   feat: User界面完善
2
  import 'package:wow_english/common/request/dao/user_dao.dart';
22b7d4da   Key   feat: user, api path
3
4
5
6
7
8
  
  part 'user_event.dart';
  part 'user_state.dart';
  
  class UserBloc extends Bloc<UserEvent, UserState> {
    UserBloc() : super(UserInitial()) {
c61b3c1a   Key   feat: toast_util....
9
      on<UserLogout>(_logout);
22b7d4da   Key   feat: user, api path
10
    }
c95453ce   Key   feat: User界面完善
11
  
c61b3c1a   Key   feat: toast_util....
12
    void _logout(UserLogout event, Emitter<UserState> emitter) async {
c95453ce   Key   feat: User界面完善
13
14
15
      print('UserBloc._test, event: $event, emitter: $emitter');
      await UserDao.logout();
    }
22b7d4da   Key   feat: user, api path
16
  }