|
|
|
@ -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); |
|
|
|
|
this.viewController.stopCamera(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Future onScan(QrReaderViewController viewController) async { |
|
|
|
|
this.viewController = viewController; |
|
|
|
|
await this.viewController.startCamera(startCameraResult); |
|
|
|
|
await this.viewController.startCamera(_startCameraResult); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
showData(String data) { |
|
|
|
|
SmartDialog.show( |
|
|
|
|
widget: Tips( |
|
|
|
|
() {}, |
|
|
|
|
text: "$data", |
|
|
|
|
), |
|
|
|
|
onDismiss: () { |
|
|
|
|
Future.delayed(Duration(seconds: 1), () { |
|
|
|
|
this.viewController.startCamera(startCameraResult); |
|
|
|
|
}); |
|
|
|
|
widget: Tips( |
|
|
|
|
() {}, |
|
|
|
|
text: "$data", |
|
|
|
|
), |
|
|
|
|
onDismiss: () { |
|
|
|
|
Future.delayed(Duration(seconds: 1), () { |
|
|
|
|
this.viewController.startCamera(_startCameraResult); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|