Added qr bloc
This commit is contained in:
parent
bb4cbcabe7
commit
89fdcce613
6 changed files with 56 additions and 0 deletions
14
lib/blocs/qr/functions/bloc_getqr.dart
Normal file
14
lib/blocs/qr/functions/bloc_getqr.dart
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:ocbo_esign_mobile/blocs/qr/qr_bloc.dart';
|
||||
import 'package:ocbo_esign_mobile/blocs/qr/qr_event.dart';
|
||||
|
||||
Future<String> blocGetQr(BuildContext context) async {
|
||||
try {
|
||||
final qrBloc = context.read<QrBloc>();
|
||||
qrBloc.add(QrGetValue());
|
||||
return qrBloc.state.value;
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue