Skip to content

Commit

Permalink
remove expanded that crashes verification scanner screen (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
f1sh1918 authored Jan 27, 2023
1 parent 5957c53 commit 5628453
Showing 1 changed file with 33 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,44 +27,42 @@ class VerificationQrScannerPage extends StatelessWidget {
Widget build(BuildContext context) {
final config = Configuration.of(context);
final settings = Provider.of<SettingsModel>(context);
return Expanded(
child: Column(
children: [
CustomAppBar(
title: buildConfig.localization.identification.verificationCodeScanner.title,
actions: [
IconButton(
icon: const Icon(Icons.help),
color: Theme.of(context).appBarTheme.foregroundColor,
onPressed: () async {
await settings.setHideVerificationInfo(enabled: false);
await VerificationInfoDialog.show(context);
},
)
],
),
Expanded(
child: QrCodeScannerPage(
onCodeScanned: (code) => _handleQrCode(context, code),
),
),
if (config.showDevSettings)
TextButton(
return Column(
children: [
CustomAppBar(
title: buildConfig.localization.identification.verificationCodeScanner.title,
actions: [
IconButton(
icon: const Icon(Icons.help),
color: Theme.of(context).appBarTheme.foregroundColor,
onPressed: () async {
final provider = Provider.of<ActivationCodeModel>(context, listen: false);
final activationCode = provider.activationCode!;
final otp = OTPGenerator(activationCode.totpSecret).generateOTP().code;
final verifyQrCode = QrCode(
dynamicVerifyCode:
DynamicVerifyCode(info: activationCode.info, pepper: activationCode.pepper, otp: otp),
);
final verifyCodeBase64 = const Base64Encoder().convert(verifyQrCode.writeToBuffer());
_handleQrCode(context, verifyCodeBase64);
await settings.setHideVerificationInfo(enabled: false);
await VerificationInfoDialog.show(context);
},
child: const Text("Verify activated Card"),
)
],
),
],
),
Expanded(
child: QrCodeScannerPage(
onCodeScanned: (code) => _handleQrCode(context, code),
),
),
if (config.showDevSettings)
TextButton(
onPressed: () async {
final provider = Provider.of<ActivationCodeModel>(context, listen: false);
final activationCode = provider.activationCode!;
final otp = OTPGenerator(activationCode.totpSecret).generateOTP().code;
final verifyQrCode = QrCode(
dynamicVerifyCode:
DynamicVerifyCode(info: activationCode.info, pepper: activationCode.pepper, otp: otp),
);
final verifyCodeBase64 = const Base64Encoder().convert(verifyQrCode.writeToBuffer());
_handleQrCode(context, verifyCodeBase64);
},
child: const Text("Verify activated Card"),
)
],
);
}

Expand Down

0 comments on commit 5628453

Please sign in to comment.