Skip to content

Commit

Permalink
Fix flutter qr code (#792)
Browse files Browse the repository at this point in the history
* Fix flutter qr code
  • Loading branch information
maxammann authored Feb 8, 2023
1 parent 120d722 commit c12ae79
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class _VerificationCodeViewState extends State<VerificationCodeView> {
final padding = min(constraints.maxWidth, constraints.maxHeight) < 400 ? 12.0 : 24.0;
return Consumer<ActivationCodeModel>(
builder: (context, cardDetailsModel, child) {
final qrCode = qr.QrCode.fromUint8List(
data: const QrCodeUtils().createDynamicVerificationQrCodeData(activationCode, otpCode.code),
errorCorrectLevel: qr.QrErrorCorrectLevel.L,
);
qrCode.make();

return ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 600, maxHeight: 600),
child: Material(
Expand All @@ -62,10 +68,7 @@ class _VerificationCodeViewState extends State<VerificationCodeView> {
Padding(
padding: EdgeInsets.all(padding),
child: qr.QrImage.withQr(
qr: qr.QrCode.fromUint8List(
data: const QrCodeUtils().createDynamicVerificationQrCodeData(activationCode, otpCode.code),
errorCorrectLevel: qr.QrErrorCorrectLevel.L,
),
qr: qrCode,
version: qr.QrVersions.auto,
foregroundColor: Theme.of(context).textTheme.bodyText2?.color,
gapless: false,
Expand Down

0 comments on commit c12ae79

Please sign in to comment.