mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-23 19:16:09 +00:00
allow scanning from images
This commit is contained in:
parent
11b52efc25
commit
f5a1273d43
1 changed files with 12 additions and 10 deletions
|
@ -21,14 +21,14 @@ class ScanScreenState extends State<ScanScreen> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> scanImage() async {
|
Future<void> scanImage() async {
|
||||||
// final ImagePicker imagePicker = ImagePicker();
|
final ImagePicker imagePicker = ImagePicker();
|
||||||
// final XFile? file = await imagePicker.pickImage(source: ImageSource.gallery);
|
final XFile? file = await imagePicker.pickImage(source: ImageSource.gallery);
|
||||||
// if (file?.path != null) {
|
if (file?.path != null) {
|
||||||
// final bool qrCodeFound = await cameraController.analyzeImage(file!.path);
|
final bool qrCodeFound = await cameraController.analyzeImage(file!.path);
|
||||||
// if (!qrCodeFound && mounted && !popped) {
|
if (!qrCodeFound && mounted && !popped) {
|
||||||
// UIUtil.showSnackbar(Z.of(context).qrUnknownError, context);
|
throw Exception("No QR code found");
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -123,9 +123,11 @@ class ScanScreenState extends State<ScanScreen> {
|
||||||
builder: (BuildContext context, TorchState state, Widget? child) {
|
builder: (BuildContext context, TorchState state, Widget? child) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case TorchState.off:
|
case TorchState.off:
|
||||||
return const Icon(Icons.flashlight_off_rounded, color: Colors.white);
|
return const Icon(Icons.flashlight_off_rounded,
|
||||||
|
color: Colors.white);
|
||||||
case TorchState.on:
|
case TorchState.on:
|
||||||
return const Icon(Icons.flashlight_on_rounded, color: Colors.yellow);
|
return const Icon(Icons.flashlight_on_rounded,
|
||||||
|
color: Colors.yellow);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue