diff --git a/lib/android/qr_scanner/qr_scanner_provider.dart b/lib/android/qr_scanner/qr_scanner_provider.dart index e4232097..50e2397e 100644 --- a/lib/android/qr_scanner/qr_scanner_provider.dart +++ b/lib/android/qr_scanner/qr_scanner_provider.dart @@ -93,7 +93,7 @@ class AndroidQrScanner implements QrScanner { allowMultiple: false, lockParentWindow: true, withData: true, - dialogTitle: 'Select file with QR code'); + dialogTitle: l10n.l_qr_select_file); if (result == null || !result.isSinglePick) { // no result diff --git a/lib/android/qr_scanner/qr_scanner_ui_view.dart b/lib/android/qr_scanner/qr_scanner_ui_view.dart index 8e74b5b1..6fc9d948 100644 --- a/lib/android/qr_scanner/qr_scanner_ui_view.dart +++ b/lib/android/qr_scanner/qr_scanner_ui_view.dart @@ -16,13 +16,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:yubico_authenticator/android/qr_scanner/qr_scanner_provider.dart'; import '../keys.dart' as keys; import 'qr_scanner_scan_status.dart'; -class QRScannerUI extends ConsumerWidget { +class QRScannerUI extends StatelessWidget { final ScanStatus status; final Size screenSize; final GlobalKey overlayWidgetKey; @@ -34,7 +33,7 @@ class QRScannerUI extends ConsumerWidget { required this.overlayWidgetKey}); @override - Widget build(BuildContext context, WidgetRef ref) { + Widget build(BuildContext context) { final l10n = AppLocalizations.of(context)!; return Stack( @@ -75,32 +74,29 @@ class QRScannerUI extends ConsumerWidget { textScaleFactor: 0.7, style: const TextStyle(color: Colors.white), ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - OutlinedButton( - onPressed: () { - Navigator.of(context).pop( - AndroidQrScanner.kQrScannerRequestManualEntry); - }, - key: keys.manualEntryButton, - child: Text( - l10n.s_enter_manually, - style: const TextStyle(color: Colors.white), - )), - const SizedBox(width: 16), - OutlinedButton( - onPressed: () { - Navigator.of(context).pop( - AndroidQrScanner.kQrScannerRequestReadFromFile); - }, - key: keys.readFromImage, - child: Text( - l10n.s_read_from_file, - style: const TextStyle(color: Colors.white), - )) - ], - ), + Row(mainAxisAlignment: MainAxisAlignment.center, children: [ + OutlinedButton( + onPressed: () { + Navigator.of(context).pop( + AndroidQrScanner.kQrScannerRequestManualEntry); + }, + key: keys.manualEntryButton, + child: Text( + l10n.s_enter_manually, + style: const TextStyle(color: Colors.white), + )), + const SizedBox(width: 16), + OutlinedButton( + onPressed: () { + Navigator.of(context).pop( + AndroidQrScanner.kQrScannerRequestReadFromFile); + }, + key: keys.readFromImage, + child: Text( + l10n.s_read_from_file, + style: const TextStyle(color: Colors.white), + )) + ]) ], ), const SizedBox(height: 16) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index d5a77092..2e2698a2 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -506,6 +506,7 @@ "l_qr_scanned": "Scanned QR code", "l_invalid_qr": "Invalid QR code", "l_qr_not_found": "No QR code found", + "l_qr_select_file": "Select file with QR code", "l_qr_not_read": "Failed reading QR code: {message}", "@l_qr_not_read" : { "placeholders": { diff --git a/lib/oath/views/add_account_page.dart b/lib/oath/views/add_account_page.dart index a6887c09..0bbf8385 100755 --- a/lib/oath/views/add_account_page.dart +++ b/lib/oath/views/add_account_page.dart @@ -30,10 +30,10 @@ import '../../app/message.dart'; import '../../app/models.dart'; import '../../app/state.dart'; import '../../app/views/user_interaction.dart'; -import '../../core/state.dart'; -import '../../desktop/models.dart'; import '../../exception/apdu_exception.dart'; import '../../exception/cancellation_exception.dart'; +import '../../core/state.dart'; +import '../../desktop/models.dart'; import '../../management/models.dart'; import '../../widgets/choice_filter_chip.dart'; import '../../widgets/file_drop_target.dart'; @@ -56,7 +56,6 @@ class OathAddAccountPage extends ConsumerStatefulWidget { final OathState? state; final List? credentials; final CredentialData? credentialData; - const OathAddAccountPage( this.devicePath, this.state, {