mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-07-18 02:24:07 +00:00
pop until the users was verified
This commit is contained in:
parent
dfa6ac2cfe
commit
48be46cf47
2 changed files with 13 additions and 0 deletions
|
|
@ -54,6 +54,7 @@ class ScannedNewProfile {
|
|||
|
||||
class MainCameraController {
|
||||
void Function()? setState;
|
||||
void Function(Contact contact)? onVerificationSuccessDismissed;
|
||||
CameraController? cameraController;
|
||||
ScreenshotController screenshotController = ScreenshotController();
|
||||
SelectedCameraDetails selectedCameraDetails = SelectedCameraDetails();
|
||||
|
|
@ -556,6 +557,7 @@ class MainCameraController {
|
|||
final context = cameraPreviewKey.currentContext;
|
||||
if (verificationOk && context != null && context.mounted) {
|
||||
await VerificationSuccessDialog.show(context, contact);
|
||||
onVerificationSuccessDismissed?.call(contact);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,17 @@ class QrCodeScannerViewState extends State<QrCodeScannerView> {
|
|||
_mainCameraController.setState = () {
|
||||
if (mounted) setState(() {});
|
||||
};
|
||||
if (widget.openToVerify && widget.contact != null) {
|
||||
_mainCameraController.onVerificationSuccessDismissed = (contact) {
|
||||
if (mounted) {
|
||||
Navigator.popUntil(context, (route) {
|
||||
final name = route.settings.name;
|
||||
if (name == null) return true;
|
||||
return !name.contains('qr_scanner') && !name.contains('verifybadge');
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
Permission.camera.isGranted.then((hasPermission) {
|
||||
if (hasPermission && mounted) {
|
||||
unawaited(_mainCameraController.selectCamera(0, true));
|
||||
|
|
|
|||
Loading…
Reference in a new issue