Browse Source

safety

master
fmk 3 years ago
parent
commit
2deb30bbee
  1. 21
      lib/qr/qr_code_scan.dart

21
lib/qr/qr_code_scan.dart

@ -122,27 +122,28 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
} }
} }
startCameraResult(String data, List<Offset> offset) async { void _startCameraResult(String data, List<Offset> offset) {
showData(data); showData(data);
this.viewController.stopCamera(); this.viewController.stopCamera();
} }
Future onScan(QrReaderViewController viewController) async { Future onScan(QrReaderViewController viewController) async {
this.viewController = viewController; this.viewController = viewController;
await this.viewController.startCamera(startCameraResult); await this.viewController.startCamera(_startCameraResult);
} }
showData(String data) { showData(String data) {
SmartDialog.show( SmartDialog.show(
widget: Tips( widget: Tips(
() {}, () {},
text: "$data", text: "$data",
), ),
onDismiss: () { onDismiss: () {
Future.delayed(Duration(seconds: 1), () { Future.delayed(Duration(seconds: 1), () {
this.viewController.startCamera(startCameraResult); this.viewController.startCamera(_startCameraResult);
});
}); });
},
);
} }
@override @override

Loading…
Cancel
Save