Added bloc
This commit is contained in:
parent
4a522a38d9
commit
e0618ea3c4
7 changed files with 88 additions and 65 deletions
14
lib/blocs/user/functions/bloc_getuser.dart
Normal file
14
lib/blocs/user/functions/bloc_getuser.dart
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:ocbo_esign_validator/blocs/user/user_bloc.dart';
|
||||
import 'package:ocbo_esign_validator/blocs/user/user_event.dart';
|
||||
|
||||
Future<String> blocGetUser(BuildContext context) async {
|
||||
try {
|
||||
final userBloc = context.read<UserBloc>();
|
||||
userBloc.add(UserGetValue());
|
||||
return userBloc.state.value;
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue