diff --git a/lib/l10n/app_cs.arb b/lib/l10n/app_cs.arb index 7e4d695dd..8eb4225b8 100644 --- a/lib/l10n/app_cs.arb +++ b/lib/l10n/app_cs.arb @@ -3,6 +3,9 @@ "patchNotesNewFeatures": "Nové funkce", "patchNotesImprovements": "Improvements", "patchNotesBugFixes": "Opravy chyb", + "patchNotesV4_4_2NewFeatures1": "Žetony lze nyní vkládat pomocí kopírování a vkládání.", + "patchNotesV4_4_2NewFeatures2": "Přidána podpora galerie pro skenování QR kódů.", + "patchNotesV4_4_2Improvement1": "Přidána podpora svítilny pro skenování QR kódů.", "patchNotesV4_4_0NewFeatures1": "Nyní je možné exportovat tokeny, u kterých lze zajistit, že se nejedná o tokeny privacyIDEA. V současné době nelze vyloučit, že tokeny přidané prostřednictvím čtečky QR kódů pocházejí z aplikace privacyIDEA. Rozlišování bude v budoucích verzích vylepšeno.", "patchNotesV4_4_0NewFeatures2": "Přidána podpora pro \"require presence\" aplikace privacyIDEA.", "patchNotesV4_4_0Improvement1": "Byly přidány další dovozní zdroje.", diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index 3689151a1..b4900df9b 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -3,6 +3,9 @@ "patchNotesNewFeatures": "Neue Funktionen", "patchNotesImprovements": "Verbesserungen", "patchNotesBugFixes": "Fehlerbehebungen", + "patchNotesV4_4_2NewFeatures1": "Token können jetzt per Copy & Paste eingefügt werden.", + "patchNotesV4_4_2NewFeatures2": "Galerie-Unterstützung für das Scannen von QR-Codes hinzugefügt.", + "patchNotesV4_4_2Improvement1": "Taschenlampenunterstützung für das Scannen von QR-Codes wurde zugefügt.", "patchNotesV4_4_0NewFeatures1": "Es ist nun möglich, Token zu exportieren, bei denen sichergestellt werden kann, dass es sich nicht um privacyIDEA Token handelt. Derzeit kann nicht ausgeschlossen werden, dass über den QR-Code-Scanner hinzugefügte Token von privacyIDEA stammen. Die Differenzierung wird in zukünftigen Versionen verbessert.", "patchNotesV4_4_0NewFeatures2": "Unterstützung für privacyIDEA's \"require presence\" hinzugefügt.", "patchNotesV4_4_0Improvement1": "Es wurden weitere Importquellen hinzugefügt.", diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 6633a51b0..1f53dc737 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -3,6 +3,9 @@ "patchNotesNewFeatures": "New features", "patchNotesImprovements": "Improvements", "patchNotesBugFixes": "Bug fixes", + "patchNotesV4_4_2NewFeatures1": "Tokens can now be inserted using copy & paste.", + "patchNotesV4_4_2NewFeatures2": "Added gallery support for QR code scanning.", + "patchNotesV4_4_2Improvement1": "Added flashlight support for QR code scanning.", "patchNotesV4_4_0NewFeatures1": "It is now possible to export tokens where it can be ensured that they are not privacyIDEA tokens. Currently, it cannot be ruled out that tokens added via the QR code scanner originate from privacyIDEA. The differentiation will be improved in future versions.", "patchNotesV4_4_0NewFeatures2": "Added support for privacyIDEA's \"require presence\"", "patchNotesV4_4_0Improvement1": "Further import sources have been added.", diff --git a/lib/l10n/app_es.arb b/lib/l10n/app_es.arb index a5cf4b5f8..349376702 100644 --- a/lib/l10n/app_es.arb +++ b/lib/l10n/app_es.arb @@ -3,6 +3,9 @@ "patchNotesNewFeatures": "Nuevas características", "patchNotesImprovements": "Mejoras", "patchNotesBugFixes": "Corrección de errores", + "patchNotesV4_4_2NewFeatures1": "Ahora es posible insertar tokens copiando y pegando.", + "patchNotesV4_4_2NewFeatures2": "Añadido soporte de galería para el escaneo de códigos QR.", + "patchNotesV4_4_2Improvement1": "Añadido soporte linterna para el escaneo de códigos QR.", "patchNotesV4_4_0NewFeatures1": "Ahora es posible exportar tokens cuando se puede garantizar que no son tokens de privacyIDEA. Actualmente, no se puede descartar que los tokens añadidos a través del escáner de código QR procedan de privacyIDEA. La diferenciación se mejorará en futuras versiones.", "patchNotesV4_4_0NewFeatures2": "Añadido soporte para privacyIDEA's \"require presence\".", "patchNotesV4_4_0Improvement1": "Se han añadido más fuentes de importación.", diff --git a/lib/l10n/app_fr.arb b/lib/l10n/app_fr.arb index 35ebf6136..1aab4f8ce 100644 --- a/lib/l10n/app_fr.arb +++ b/lib/l10n/app_fr.arb @@ -3,6 +3,9 @@ "patchNotesNewFeatures": "Nouvelles caractéristiques", "patchNotesImprovements": "Améliorations", "patchNotesBugFixes": "Bug fixes", + "patchNotesV4_4_2NewFeatures1": "Les jetons peuvent désormais être insérés par copier-coller.", + "patchNotesV4_4_2NewFeatures2": "Ajout de la prise en charge de la galerie pour la lecture des codes QR.", + "patchNotesV4_4_2Improvement1": "Ajout de la prise en charge de la lampe de poche pour la lecture des codes QR.", "patchNotesV4_4_0NewFeatures1": "Il est désormais possible d'exporter des jetons dont on peut s'assurer qu'il ne s'agit pas de jetons privacyIDEA. Actuellement, il n'est pas possible d'exclure que des jetons ajoutés via le lecteur de code QR proviennent de privacyIDEA. La différenciation sera améliorée dans les versions futures.", "patchNotesV4_4_0NewFeatures2": "Ajout du support pour privacyIDEA's \"require presence\".", "patchNotesV4_4_0Improvement1": "D'autres sources d'importation ont été ajoutées.", diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 927fd7834..11a10c16d 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -123,6 +123,24 @@ abstract class AppLocalizations { /// **'Bug fixes'** String get patchNotesBugFixes; + /// No description provided for @patchNotesV4_4_2NewFeatures1. + /// + /// In en, this message translates to: + /// **'Tokens can now be inserted using copy & paste.'** + String get patchNotesV4_4_2NewFeatures1; + + /// No description provided for @patchNotesV4_4_2NewFeatures2. + /// + /// In en, this message translates to: + /// **'Added gallery support for QR code scanning.'** + String get patchNotesV4_4_2NewFeatures2; + + /// No description provided for @patchNotesV4_4_2Improvement1. + /// + /// In en, this message translates to: + /// **'Added flashlight support for QR code scanning.'** + String get patchNotesV4_4_2Improvement1; + /// No description provided for @patchNotesV4_4_0NewFeatures1. /// /// In en, this message translates to: diff --git a/lib/l10n/app_localizations_cs.dart b/lib/l10n/app_localizations_cs.dart index 53afaf04d..ce2bb44b5 100644 --- a/lib/l10n/app_localizations_cs.dart +++ b/lib/l10n/app_localizations_cs.dart @@ -17,6 +17,15 @@ class AppLocalizationsCs extends AppLocalizations { @override String get patchNotesBugFixes => 'Opravy chyb'; + @override + String get patchNotesV4_4_2NewFeatures1 => 'Žetony lze nyní vkládat pomocí kopírování a vkládání.'; + + @override + String get patchNotesV4_4_2NewFeatures2 => 'Přidána podpora galerie pro skenování QR kódů.'; + + @override + String get patchNotesV4_4_2Improvement1 => 'Přidána podpora svítilny pro skenování QR kódů.'; + @override String get patchNotesV4_4_0NewFeatures1 => 'Nyní je možné exportovat tokeny, u kterých lze zajistit, že se nejedná o tokeny privacyIDEA. V současné době nelze vyloučit, že tokeny přidané prostřednictvím čtečky QR kódů pocházejí z aplikace privacyIDEA. Rozlišování bude v budoucích verzích vylepšeno.'; diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index 13985f6b5..6b7881261 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -17,6 +17,15 @@ class AppLocalizationsDe extends AppLocalizations { @override String get patchNotesBugFixes => 'Fehlerbehebungen'; + @override + String get patchNotesV4_4_2NewFeatures1 => 'Token können jetzt per Copy & Paste eingefügt werden.'; + + @override + String get patchNotesV4_4_2NewFeatures2 => 'Galerie-Unterstützung für das Scannen von QR-Codes hinzugefügt.'; + + @override + String get patchNotesV4_4_2Improvement1 => 'Taschenlampenunterstützung für das Scannen von QR-Codes wurde zugefügt.'; + @override String get patchNotesV4_4_0NewFeatures1 => 'Es ist nun möglich, Token zu exportieren, bei denen sichergestellt werden kann, dass es sich nicht um privacyIDEA Token handelt. Derzeit kann nicht ausgeschlossen werden, dass über den QR-Code-Scanner hinzugefügte Token von privacyIDEA stammen. Die Differenzierung wird in zukünftigen Versionen verbessert.'; diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 865dd25da..438cbb9bf 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -17,6 +17,15 @@ class AppLocalizationsEn extends AppLocalizations { @override String get patchNotesBugFixes => 'Bug fixes'; + @override + String get patchNotesV4_4_2NewFeatures1 => 'Tokens can now be inserted using copy & paste.'; + + @override + String get patchNotesV4_4_2NewFeatures2 => 'Added gallery support for QR code scanning.'; + + @override + String get patchNotesV4_4_2Improvement1 => 'Added flashlight support for QR code scanning.'; + @override String get patchNotesV4_4_0NewFeatures1 => 'It is now possible to export tokens where it can be ensured that they are not privacyIDEA tokens. Currently, it cannot be ruled out that tokens added via the QR code scanner originate from privacyIDEA. The differentiation will be improved in future versions.'; diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart index 404f2efa9..4f8e9d2cb 100644 --- a/lib/l10n/app_localizations_es.dart +++ b/lib/l10n/app_localizations_es.dart @@ -17,6 +17,15 @@ class AppLocalizationsEs extends AppLocalizations { @override String get patchNotesBugFixes => 'Corrección de errores'; + @override + String get patchNotesV4_4_2NewFeatures1 => 'Ahora es posible insertar tokens copiando y pegando.'; + + @override + String get patchNotesV4_4_2NewFeatures2 => 'Añadido soporte de galería para el escaneo de códigos QR.'; + + @override + String get patchNotesV4_4_2Improvement1 => 'Añadido soporte linterna para el escaneo de códigos QR.'; + @override String get patchNotesV4_4_0NewFeatures1 => 'Ahora es posible exportar tokens cuando se puede garantizar que no son tokens de privacyIDEA. Actualmente, no se puede descartar que los tokens añadidos a través del escáner de código QR procedan de privacyIDEA. La diferenciación se mejorará en futuras versiones.'; diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart index 5446d27ba..2f994c641 100644 --- a/lib/l10n/app_localizations_fr.dart +++ b/lib/l10n/app_localizations_fr.dart @@ -17,6 +17,15 @@ class AppLocalizationsFr extends AppLocalizations { @override String get patchNotesBugFixes => 'Bug fixes'; + @override + String get patchNotesV4_4_2NewFeatures1 => 'Les jetons peuvent désormais être insérés par copier-coller.'; + + @override + String get patchNotesV4_4_2NewFeatures2 => 'Ajout de la prise en charge de la galerie pour la lecture des codes QR.'; + + @override + String get patchNotesV4_4_2Improvement1 => 'Ajout de la prise en charge de la lampe de poche pour la lecture des codes QR.'; + @override String get patchNotesV4_4_0NewFeatures1 => 'Il est désormais possible d\'exporter des jetons dont on peut s\'assurer qu\'il ne s\'agit pas de jetons privacyIDEA. Actuellement, il n\'est pas possible d\'exclure que des jetons ajoutés via le lecteur de code QR proviennent de privacyIDEA. La différenciation sera améliorée dans les versions futures.'; diff --git a/lib/l10n/app_localizations_nl.dart b/lib/l10n/app_localizations_nl.dart index 89df34181..96f24e279 100644 --- a/lib/l10n/app_localizations_nl.dart +++ b/lib/l10n/app_localizations_nl.dart @@ -17,6 +17,15 @@ class AppLocalizationsNl extends AppLocalizations { @override String get patchNotesBugFixes => 'Bugfixes'; + @override + String get patchNotesV4_4_2NewFeatures1 => 'Tokens kunnen nu worden ingevoegd met kopiëren en plakken.'; + + @override + String get patchNotesV4_4_2NewFeatures2 => 'Galerijondersteuning toegevoegd voor QR-code scannen.'; + + @override + String get patchNotesV4_4_2Improvement1 => 'Zaklampondersteuning toegevoegd voor QR-code scannen.'; + @override String get patchNotesV4_4_0NewFeatures1 => 'Het is nu mogelijk om tokens te exporteren waarvan kan worden gegarandeerd dat het geen privacyIDEA tokens zijn. Op dit moment kan niet worden uitgesloten dat tokens die zijn toegevoegd via de QR-code scanner afkomstig zijn van privacyIDEA. De differentiatie zal in toekomstige versies worden verbeterd.'; diff --git a/lib/l10n/app_localizations_pl.dart b/lib/l10n/app_localizations_pl.dart index 7c202a11f..3d8916645 100644 --- a/lib/l10n/app_localizations_pl.dart +++ b/lib/l10n/app_localizations_pl.dart @@ -17,6 +17,15 @@ class AppLocalizationsPl extends AppLocalizations { @override String get patchNotesBugFixes => 'Poprawki błędów'; + @override + String get patchNotesV4_4_2NewFeatures1 => 'Tokeny można teraz wstawiać za pomocą funkcji kopiuj i wklej.'; + + @override + String get patchNotesV4_4_2NewFeatures2 => 'Dodano obsługę galerii dla skanowania kodów QR.'; + + @override + String get patchNotesV4_4_2Improvement1 => 'Dodano obsługę latarki dla skanowania kodów QR.'; + @override String get patchNotesV4_4_0NewFeatures1 => 'Możliwe jest teraz eksportowanie tokenów, w przypadku których można upewnić się, że nie są to tokeny privacyIDEA. Obecnie nie można wykluczyć, że tokeny dodane za pomocą skanera kodów QR pochodzą z privacyIDEA. Rozróżnienie to zostanie poprawione w przyszłych wersjach'; diff --git a/lib/l10n/app_nl.arb b/lib/l10n/app_nl.arb index fc20a050d..8a9be80ad 100644 --- a/lib/l10n/app_nl.arb +++ b/lib/l10n/app_nl.arb @@ -3,6 +3,9 @@ "patchNotesNewFeatures": "Nieuwe functies", "patchNotesImprovements": "Verbeteringen", "patchNotesBugFixes": "Bugfixes", + "patchNotesV4_4_2NewFeatures1": "Tokens kunnen nu worden ingevoegd met kopiëren en plakken.", + "patchNotesV4_4_2NewFeatures2": "Galerijondersteuning toegevoegd voor QR-code scannen.", + "patchNotesV4_4_2Improvement1": "Zaklampondersteuning toegevoegd voor QR-code scannen.", "patchNotesV4_4_0NewFeatures1": "Het is nu mogelijk om tokens te exporteren waarvan kan worden gegarandeerd dat het geen privacyIDEA tokens zijn. Op dit moment kan niet worden uitgesloten dat tokens die zijn toegevoegd via de QR-code scanner afkomstig zijn van privacyIDEA. De differentiatie zal in toekomstige versies worden verbeterd.", "patchNotesV4_4_0NewFeatures2": "Ondersteuning toegevoegd voor privacyIDEA's \"require presence\".", "patchNotesV4_4_0Improvement1": "Er zijn meer invoerbronnen toegevoegd.", diff --git a/lib/l10n/app_pl.arb b/lib/l10n/app_pl.arb index 6df99f680..386829c3a 100644 --- a/lib/l10n/app_pl.arb +++ b/lib/l10n/app_pl.arb @@ -3,6 +3,9 @@ "patchNotesNewFeatures": "Nowe funkcje", "patchNotesImprovements": "Ulepszenia", "patchNotesBugFixes": "Poprawki błędów", + "patchNotesV4_4_2NewFeatures1": "Tokeny można teraz wstawiać za pomocą funkcji kopiuj i wklej.", + "patchNotesV4_4_2NewFeatures2": "Dodano obsługę galerii dla skanowania kodów QR.", + "patchNotesV4_4_2Improvement1": "Dodano obsługę latarki dla skanowania kodów QR.", "patchNotesV4_4_0NewFeatures1": "Możliwe jest teraz eksportowanie tokenów, w przypadku których można upewnić się, że nie są to tokeny privacyIDEA. Obecnie nie można wykluczyć, że tokeny dodane za pomocą skanera kodów QR pochodzą z privacyIDEA. Rozróżnienie to zostanie poprawione w przyszłych wersjach", "patchNotesV4_4_0NewFeatures2": "Dodano obsługę funkcji privacyIDEA \"require presence\".", "patchNotesV4_4_0Improvement1": "Dodano kolejne źródła importu.", diff --git a/lib/utils/globals.dart b/lib/utils/globals.dart index 451144099..394eead8f 100644 --- a/lib/utils/globals.dart +++ b/lib/utils/globals.dart @@ -27,22 +27,13 @@ import '../model/enums/patch_note_type.dart'; import '../model/version.dart'; Map>> getLocalizedPatchNotes(AppLocalizations localizations) => { - const Version(4, 3, 0): { + const Version(4, 4, 2): { PatchNoteType.newFeature: [ - localizations.patchNotesV4_3_0NewFeatures1, - localizations.patchNotesV4_3_0NewFeatures2, - localizations.patchNotesV4_3_0NewFeatures3, - localizations.patchNotesV4_3_0NewFeatures4, - localizations.patchNotesV4_3_0NewFeatures5, - localizations.patchNotesV4_3_0NewFeatures6, - ], - }, - const Version(4, 3, 1): { - PatchNoteType.bugFix: [ - localizations.patchNotesV4_3_1BugFix1, + localizations.patchNotesV4_4_2NewFeatures1, + localizations.patchNotesV4_4_2NewFeatures2, ], PatchNoteType.improvement: [ - localizations.patchNotesV4_3_1Improvement1, + localizations.patchNotesV4_4_2Improvement1, ] }, const Version(4, 4, 0): { @@ -55,6 +46,24 @@ Map>> getLocalizedPatchNotes(AppLocaliz localizations.patchNotesV4_4_0Improvement2, ] }, + const Version(4, 3, 1): { + PatchNoteType.bugFix: [ + localizations.patchNotesV4_3_1BugFix1, + ], + PatchNoteType.improvement: [ + localizations.patchNotesV4_3_1Improvement1, + ] + }, + const Version(4, 3, 0): { + PatchNoteType.newFeature: [ + localizations.patchNotesV4_3_0NewFeatures1, + localizations.patchNotesV4_3_0NewFeatures2, + localizations.patchNotesV4_3_0NewFeatures3, + localizations.patchNotesV4_3_0NewFeatures4, + localizations.patchNotesV4_3_0NewFeatures5, + localizations.patchNotesV4_3_0NewFeatures6, + ], + }, }; final globalSnackbarKey = GlobalKey(); diff --git a/lib/views/qr_scanner_view/qr_scanner_view.dart b/lib/views/qr_scanner_view/qr_scanner_view.dart index 3f63c4261..6dc232abb 100644 --- a/lib/views/qr_scanner_view/qr_scanner_view.dart +++ b/lib/views/qr_scanner_view/qr_scanner_view.dart @@ -3,7 +3,7 @@ Authors: Timo Sturm Frank Merkel - Copyright (c) 2017-2023 NetKnights GmbH + Copyright (c) 2017-2024 NetKnights GmbH Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. @@ -58,58 +58,49 @@ class _QRScannerViewState extends State { PermissionStatus? _cameraPermission; @override - Widget build(BuildContext context) { - return FutureBuilder( - future: Future(() async => _cameraPermission ?? await _requestCameraPermission()), - builder: (context, isGranted) { - if (isGranted.connectionState != ConnectionState.done) return const Center(child: CircularProgressIndicator()); - if (isGranted.data == PermissionStatus.permanentlyDenied) { - return DefaultDialog( - title: Text(AppLocalizations.of(context)!.grantCameraPermissionDialogTitle), - content: Text(AppLocalizations.of(context)!.grantCameraPermissionDialogPermanentlyDenied), - ); - } - if (isGranted.data != PermissionStatus.granted) { - return DefaultDialog( - title: Text(AppLocalizations.of(context)!.grantCameraPermissionDialogTitle), - content: Text(AppLocalizations.of(context)!.grantCameraPermissionDialogContent), - actions: [ - DefaultDialogButton( - child: Text(AppLocalizations.of(context)!.grantCameraPermissionDialogButton), - onPressed: () async { - //Trigger the permission to request it - final cameraPermission = await _requestCameraPermission(); - setState(() => _cameraPermission = cameraPermission); - }, + Widget build(BuildContext context) => FutureBuilder( + future: Future(() async => _cameraPermission ?? await _requestCameraPermission()), + builder: (context, isGranted) { + if (isGranted.connectionState != ConnectionState.done) return const Center(child: CircularProgressIndicator()); + return switch (isGranted.data) { + PermissionStatus.permanentlyDenied => DefaultDialog( + title: Text(AppLocalizations.of(context)!.grantCameraPermissionDialogTitle), + content: Text(AppLocalizations.of(context)!.grantCameraPermissionDialogPermanentlyDenied), ), - DefaultDialogButton( - child: Text(AppLocalizations.of(context)!.cancel), - onPressed: () { - Navigator.pop(context, null); - }, - ), - ], - ); - } - return SafeArea( - child: Stack( - children: [ - const QRScannerWidget(), - Scaffold( - resizeToAvoidBottomInset: false, - backgroundColor: Colors.transparent, - appBar: AppBar( + PermissionStatus.granted => SafeArea( + child: Scaffold( + resizeToAvoidBottomInset: false, backgroundColor: Colors.transparent, - foregroundColor: Colors.white, - elevation: 0, + appBar: AppBar( + backgroundColor: Colors.transparent, + foregroundColor: Colors.white, + elevation: 0, + ), + extendBodyBehindAppBar: true, + body: const QRScannerWidget(), ), - extendBodyBehindAppBar: true, - body: const SizedBox(), ), - ], - ), - ); - }, - ); - } + _ => DefaultDialog( + title: Text(AppLocalizations.of(context)!.grantCameraPermissionDialogTitle), + content: Text(AppLocalizations.of(context)!.grantCameraPermissionDialogContent), + actions: [ + DefaultDialogButton( + child: Text(AppLocalizations.of(context)!.grantCameraPermissionDialogButton), + onPressed: () async { + //Trigger the permission to request it + final cameraPermission = await _requestCameraPermission(); + setState(() => _cameraPermission = cameraPermission); + }, + ), + DefaultDialogButton( + child: Text(AppLocalizations.of(context)!.cancel), + onPressed: () { + Navigator.pop(context, null); + }, + ), + ], + ), + }; + }, + ); } diff --git a/lib/views/qr_scanner_view/qr_scanner_view_widgets/qr_scanner_widget.dart b/lib/views/qr_scanner_view/qr_scanner_view_widgets/qr_scanner_widget.dart index 470df7558..d77a99619 100644 --- a/lib/views/qr_scanner_view/qr_scanner_view_widgets/qr_scanner_widget.dart +++ b/lib/views/qr_scanner_view/qr_scanner_view_widgets/qr_scanner_widget.dart @@ -1,3 +1,23 @@ +/* + * privacyIDEA Authenticator + * + * Author: Frank Merkel + * + * Copyright (c) 2024 NetKnights GmbH + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import 'package:flutter/material.dart'; import 'package:flutter_zxing/flutter_zxing.dart'; @@ -9,12 +29,21 @@ class QRScannerWidget extends StatefulWidget { } class _QRScannerWidgetState extends State { + bool isInitialized = false; + @override Widget build(BuildContext context) => Material( color: Colors.black, child: ReaderWidget( - showFlashlight: false, - showGallery: false, + onControllerCreated: (controller, _) { + if (!mounted) return; + setState(() => isInitialized = controller != null); + }, + showFlashlight: true, + flashOnIcon: const Icon(Icons.flash_on), + flashOffIcon: const Icon(Icons.flash_off), + showGallery: true, + galleryIcon: const Icon(Icons.image), showToggleCamera: false, codeFormat: Format.qrCode, cropPercent: 0.70, diff --git a/pubspec.lock b/pubspec.lock index eeb09fdd1..cb7fc1e70 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "5534e701a2c505fed1f0799e652dd6ae23bd4d2c4cf797220e5ced5764a7c1c2" + sha256: "5a0296da7ae717ffb7444dee8439ca25ac80e162a345b933aa57f0a4a48dca2c" url: "https://pub.dev" source: hosted - version: "1.3.44" + version: "1.3.45" _macros: dependency: transitive description: dart @@ -98,10 +98,10 @@ packages: dependency: "direct main" description: name: asn1lib - sha256: "6b151826fcc95ff246cd219a0bf4c753ea14f4081ad71c61939becf3aba27f70" + sha256: "4bae5ae63e6d6dd17c4aac8086f3dec26c0236f6a0f03416c6c19d830c367cf5" url: "https://pub.dev" source: hosted - version: "1.5.5" + version: "1.5.8" async: dependency: transitive description: @@ -210,10 +210,10 @@ packages: dependency: transitive description: name: camera_avfoundation - sha256: "0d04cec8715b59fb6dc60eefb47e69024f51233c570e475b886dc9290568bca7" + sha256: "2e4c568f70e406ccb87376bc06b53d2f5bebaab71e2fbcc1a950e31449381bcf" url: "https://pub.dev" source: hosted - version: "0.9.17+4" + version: "0.9.17+5" camera_platform_interface: dependency: transitive description: @@ -266,10 +266,10 @@ packages: dependency: transitive description: name: code_builder - sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" url: "https://pub.dev" source: hosted - version: "4.10.0" + version: "4.10.1" collection: dependency: "direct main" description: @@ -306,10 +306,10 @@ packages: dependency: transitive description: name: coverage - sha256: "88b0fddbe4c92910fefc09cc0248f5e7f0cd23e450ded4c28f16ab8ee8f83268" + sha256: "4b03e11f6d5b8f6e5bb5e9f7889a56fe6c5cbe942da5378ea4d4d7f73ef9dfe5" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" cross_file: dependency: transitive description: @@ -378,10 +378,10 @@ packages: dependency: "direct main" description: name: device_info_plus - sha256: c4af09051b4f0508f6c1dc0a5c085bf014d5c9a4a0678ce1799c2b4d716387a0 + sha256: f545ffbadee826f26f2e1a0f0cbd667ae9a6011cc0f77c0f8f00a969655e6e95 url: "https://pub.dev" source: hosted - version: "11.1.0" + version: "11.1.1" device_info_plus_platform_interface: dependency: transitive description: @@ -506,10 +506,10 @@ packages: dependency: "direct main" description: name: firebase_core - sha256: "51dfe2fbf3a984787a2e7b8592f2f05c986bfedd6fdacea3f9e0a7beb334de96" + sha256: e59141ff83e70a9ba571a1f8733c5598cf57e6e68037ab185581d7fc0a436738 url: "https://pub.dev" source: hosted - version: "3.6.0" + version: "3.7.0" firebase_core_platform_interface: dependency: transitive description: @@ -530,26 +530,26 @@ packages: dependency: "direct main" description: name: firebase_messaging - sha256: eb6e28a3a35deda61fe8634967c84215efc19133ba58d8e0fc6c9a2af2cba05e + sha256: a988c6ab37fa5a6abf2f8087a44b765e058848ace6f3253fb1602d1d44a63747 url: "https://pub.dev" source: hosted - version: "15.1.3" + version: "15.1.4" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: b316c4ee10d93d32c033644207afc282d9b2b4372f3cf9c6022f3558b3873d2d + sha256: "66aa477277baf2430904096234dd2095ad2e0248d0bfefc1b11695e68bf1790e" url: "https://pub.dev" source: hosted - version: "4.5.46" + version: "4.5.47" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: d7f0147a1a9fe4313168e20154a01fd5cf332898de1527d3930ff77b8c7f5387 + sha256: "8b590d8c421dc4f63a28c6b9690a050424c28b99a54886ded4510c0806237130" url: "https://pub.dev" source: hosted - version: "3.9.2" + version: "3.9.3" fixnum: dependency: transitive description: @@ -562,10 +562,10 @@ packages: dependency: "direct main" description: name: fluentui_system_icons - sha256: "4f451b5512d5f28d0d671881e28519a2a05f252679f98ab41c32ff3da5dcc9cd" + sha256: f5eef03b53e1d3167677e968928090ddf191b20e8b512d5b403eb5275dd0285d url: "https://pub.dev" source: hosted - version: "1.1.261" + version: "1.1.264" flutter: dependency: "direct main" description: flutter @@ -588,26 +588,26 @@ packages: dependency: "direct main" description: name: flutter_local_notifications - sha256: "674173fd3c9eda9d4c8528da2ce0ea69f161577495a9cc835a2a4ecd7eadeb35" + sha256: ef41ae901e7529e52934feba19ed82827b11baa67336829564aeab3129460610 url: "https://pub.dev" source: hosted - version: "17.2.4" + version: "18.0.1" flutter_local_notifications_linux: dependency: transitive description: name: flutter_local_notifications_linux - sha256: c49bd06165cad9beeb79090b18cd1eb0296f4bf4b23b84426e37dd7c027fc3af + sha256: "8f685642876742c941b29c32030f6f4f6dacd0e4eaecb3efbb187d6a3812ca01" url: "https://pub.dev" source: hosted - version: "4.0.1" + version: "5.0.0" flutter_local_notifications_platform_interface: dependency: transitive description: name: flutter_local_notifications_platform_interface - sha256: "85f8d07fe708c1bdcf45037f2c0109753b26ae077e9d9e899d55971711a4ea66" + sha256: "6c5b83c86bf819cdb177a9247a3722067dd8cc6313827ce7c77a4b238a26fd52" url: "https://pub.dev" source: hosted - version: "7.2.0" + version: "8.0.0" flutter_localizations: dependency: "direct main" description: flutter @@ -697,10 +697,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2" + sha256: "578bd8c508144fdaffd4f77b8ef2d8c523602275cd697cc3db284dbd762ef4ce" url: "https://pub.dev" source: hosted - version: "2.0.10+1" + version: "2.0.14" flutter_test: dependency: "direct dev" description: flutter @@ -1141,10 +1141,10 @@ packages: dependency: "direct main" description: name: otp - sha256: fcb7f21e30c4cd80a0a982c27a9b75151cc1fe3d8f7ee680673c090171b1ad55 + sha256: "337fddb07d10df56dc57f3f8a3e1a7e7abe7463cd85e4efc567c4d2bc94d4ed6" url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "3.1.3" package_config: dependency: transitive description: @@ -1157,10 +1157,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: df3eb3e0aed5c1107bb0fdb80a8e82e778114958b1c5ac5644fb1ac9cae8a998 + sha256: da8d9ac8c4b1df253d1a328b7bf01ae77ef132833479ab40763334db13b91cce url: "https://pub.dev" source: hosted - version: "8.1.0" + version: "8.1.1" package_info_plus_platform_interface: dependency: transitive description: @@ -1181,18 +1181,18 @@ packages: dependency: transitive description: name: path_parsing - sha256: "45f7d6bba1128761de5540f39d5ca000ea8a1f22f06b76b61094a60a2997bd0e" + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.0" path_provider: dependency: "direct main" description: name: path_provider - sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" path_provider_android: dependency: transitive description: @@ -1412,10 +1412,10 @@ packages: dependency: "direct main" description: name: shared_preferences - sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051" + sha256: "95f9997ca1fb9799d494d0cb2a780fd7be075818d59f00c43832ed112b158a82" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.3" shared_preferences_android: dependency: transitive description: @@ -1641,10 +1641,10 @@ packages: dependency: transitive description: name: timezone - sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d" + sha256: ffc9d5f4d1193534ef051f9254063fa53d588609418c84299956c3db9383587d url: "https://pub.dev" source: hosted - version: "0.9.4" + version: "0.10.0" timing: dependency: transitive description: @@ -1673,10 +1673,10 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: "0dea215895a4d254401730ca0ba8204b29109a34a99fb06ae559a2b60988d2de" + sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193" url: "https://pub.dev" source: hosted - version: "6.3.13" + version: "6.3.14" url_launcher_ios: dependency: transitive description: @@ -1737,26 +1737,26 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3" + sha256: "773c9522d66d523e1c7b25dfb95cc91c26a1e17b107039cfe147285e92de7878" url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.14" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da + sha256: "2430b973a4ca3c4dbc9999b62b8c719a160100dcbae5c819bae0cacce32c9cdb" url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.12" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: "12faff3f73b1741a36ca7e31b292ddeb629af819ca9efe9953b70bd63fc8cd81" + sha256: ab9ff38fc771e9ee1139320adbe3d18a60327370c218c60752068ebee4b49ab1 url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.15" vector_math: dependency: transitive description: @@ -1825,10 +1825,10 @@ packages: dependency: transitive description: name: win32 - sha256: "10169d3934549017f0ae278ccb07f828f9d6ea21573bab0fb77b0e1ef0fce454" + sha256: "84ba388638ed7a8cb3445a320c8273136ab2631cd5f2c57888335504ddab1bc2" url: "https://pub.dev" source: hosted - version: "5.7.2" + version: "5.8.0" win32_registry: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 5bcba3b9b..d3ab1f2f8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,7 @@ publish_to: none # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 4.4.2+404203 # TODO Set the right version number +version: 4.4.2+404205 # TODO Set the right version number # version: major.minor.build + 2x major|2x minor|3x build # version: version number + build number (optional) @@ -30,7 +30,7 @@ dependencies: flutter_localizations: sdk: flutter app_minimizer: ^1.0.0+2 - flutter_local_notifications: ^17.2.2 + flutter_local_notifications: ^18.0.1 home_widget: ^0.7.0 image: ^4.1.6 local_auth: ^2.1.6