Fix qr scanner links
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
- Fixed Android service mode
|
- Fixed Android service mode
|
||||||
|
- Fixed QR code scanner not scanning deep links
|
||||||
|
|
||||||
## [0.13.4.dev] - 2023-1-4
|
## [0.13.4.dev] - 2023-1-4
|
||||||
|
|
||||||
|
|||||||
@@ -77,11 +77,17 @@ class QRCodeScannerScreen extends HookConsumerWidget with PresLogger {
|
|||||||
MobileScanner(
|
MobileScanner(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
onDetect: (capture) {
|
onDetect: (capture) {
|
||||||
final data = capture.barcodes.first;
|
final rawData = capture.barcodes.first.rawValue;
|
||||||
if (context.mounted && data.type == BarcodeType.url) {
|
loggy.debug('captured raw: [$rawData]');
|
||||||
loggy.debug('captured raw: [${data.rawValue}]');
|
if (rawData != null) {
|
||||||
loggy.debug('captured url: [${data.url?.url}]');
|
final uri = Uri.tryParse(rawData);
|
||||||
Navigator.of(context, rootNavigator: true).pop(data.url?.url);
|
if (context.mounted && uri != null) {
|
||||||
|
loggy.debug('captured url: [$uri]');
|
||||||
|
Navigator.of(context, rootNavigator: true)
|
||||||
|
.pop(uri.toString());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
loggy.warning("unable to capture");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
errorBuilder: (_, error, __) {
|
errorBuilder: (_, error, __) {
|
||||||
|
|||||||
Reference in New Issue
Block a user