From 71fd9b08dbaf161fdebb5e28ba01d325e1f0d7cd Mon Sep 17 00:00:00 2001 From: Frank Merkel <138444693+frankmer@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:20:20 +0200 Subject: [PATCH] Cleaned up dependencies --- lib/api/privacy_idea_container_api.dart | 10 +- .../repo/token_folder_repository.dart | 2 +- lib/mains/main_customizer.dart | 2 +- lib/mains/main_netknights.dart | 2 +- .../enums/rollout_state_extension.dart | 5 +- .../enums/sync_state_extension.dart | 3 +- lib/model/processor_result.dart | 2 +- .../token_container_state.dart | 2 +- lib/model/riverpod_states/token_filter.dart | 5 +- lib/model/riverpod_states/token_state.dart | 2 +- lib/model/token_container.dart | 8 +- lib/model/token_import/token_origin_data.dart | 2 +- lib/model/token_template.dart | 8 +- lib/model/tokens/push_token.dart | 2 +- lib/model/tokens/steam_token.dart | 2 +- lib/model/tokens/token.dart | 2 +- lib/model/widget_image.dart | 2 +- .../scheme_processor_interface.dart | 3 +- .../token_container_processor.dart | 7 +- .../aegis_import_file_processor.dart | 2 +- .../free_otp_plus_import_file_processor.dart | 4 +- .../customization/theme_customization.dart | 2 +- lib/utils/ecc_utils.dart | 5 +- lib/utils/firebase_utils.dart | 98 +++--- lib/utils/logger.dart | 16 +- lib/utils/object_validator.dart | 3 +- lib/utils/privacyidea_io_client.dart | 4 +- lib/utils/push_provider.dart | 4 +- .../push_request_provider.dart | 4 +- .../settings_notifier.dart | 2 +- .../sortable_notifier.dart | 2 +- .../token_container_notifier.dart | 18 +- .../token_folder_notifier.dart | 2 +- .../generated_providers/token_notifier.dart | 29 +- lib/utils/utils.dart | 12 +- lib/utils/view_utils.dart | 17 +- .../add_daypassword_manually.dart | 4 +- .../add_hotp_manually.dart | 4 +- .../add_steam_manually.dart | 2 +- .../add_totp_manually.dart | 4 +- .../rows/duration_dropdown_button.dart | 2 +- .../rows/label_input_field.dart | 2 +- .../rows/secret_input_field.dart | 4 +- lib/views/container_view/container_view.dart | 10 +- .../details_container_action.dart | 2 +- .../details_container_action_dialog.dart | 6 +- .../export_container_action_dialog.dart | 6 +- .../container_widgets/container_widget.dart | 5 +- .../container_widget_tile.dart | 2 +- lib/views/feedback_view/feedback_view.dart | 2 +- .../pages/import_start_page.dart | 2 +- .../conflicted_import_tokens_tile.dart | 2 +- .../widgets/dialogs/qr_not_found_dialog.dart | 9 +- .../add_token_folder_dialog.dart | 2 +- .../rename_token_folder_action.dart | 2 +- .../token_folder_expandable.dart | 2 +- .../token_folder_expandable_header.dart | 4 +- .../license_push_view_button.dart | 2 +- .../qr_scanner_button.dart | 2 +- .../main_view_tokens_list.dart | 2 +- .../main_view_tokens_list_filtered.dart | 2 +- .../sortable_widget_builder.dart | 2 +- .../day_password_token_widget_tile.dart | 8 +- .../default_edit_action_dialog.dart | 2 +- .../hotp_token_widget_tile.dart | 10 +- .../push_token_widgets/push_token_widget.dart | 2 +- .../token_widgets/token_widget_base.dart | 2 +- .../token_widgets/token_widget_tile.dart | 2 +- .../totp_token_widget_tile.dart | 5 +- .../qr_scanner_widget.dart | 3 +- .../dialogs/export_tokens_to_file_dialog.dart | 6 +- .../dialogs/select_tokens_dialog.dart | 2 +- .../settings_group_container.dart | 6 +- .../settings_group_language.dart | 4 +- .../settings_group_push_token.dart | 2 +- .../settings_view_widgets/logging_menu.dart | 2 +- .../update_firebase_token_dialog.dart | 5 +- lib/views/splash_screen/splash_screen.dart | 2 +- .../add_container_progress_dialog.dart | 4 +- .../container_already_exists_dialog.dart | 10 +- .../push_decline_confirm_dialog.dart | 4 +- .../push_presence_button_row.dart | 2 +- .../pi_circular_progress_indicator.dart | 3 +- .../lib/pi_authenticator_legacy.dart | 3 +- pubspec.lock | 293 ++++-------------- pubspec.yaml | 117 +++---- .../aegis_import_file_processor_test.dart | 2 +- 87 files changed, 327 insertions(+), 557 deletions(-) diff --git a/lib/api/privacy_idea_container_api.dart b/lib/api/privacy_idea_container_api.dart index e3d7f4462..a75ba4d5c 100644 --- a/lib/api/privacy_idea_container_api.dart +++ b/lib/api/privacy_idea_container_api.dart @@ -24,12 +24,12 @@ import 'dart:convert'; import 'package:collection/collection.dart'; import 'package:cryptography/cryptography.dart'; import 'package:http/http.dart'; -import 'package:privacyidea_authenticator/l10n/app_localizations_en.dart'; -import 'package:privacyidea_authenticator/model/extensions/token_folder_extension.dart'; -import 'package:privacyidea_authenticator/processors/scheme_processors/token_import_scheme_processors/otp_auth_processor.dart'; -import 'package:privacyidea_authenticator/utils/ecc_utils.dart'; -import 'package:privacyidea_authenticator/utils/privacyidea_io_client.dart'; +import '../../../../../../../l10n/app_localizations_en.dart'; +import '../../../../../../../model/extensions/token_folder_extension.dart'; +import '../../../../../../../processors/scheme_processors/token_import_scheme_processors/otp_auth_processor.dart'; +import '../../../../../../../utils/ecc_utils.dart'; +import '../../../../../../../utils/privacyidea_io_client.dart'; import '../model/api_results/pi_server_results/pi_server_result_value.dart'; import '../model/exception_errors/localized_exception.dart'; import '../model/exception_errors/response_error.dart'; diff --git a/lib/interfaces/repo/token_folder_repository.dart b/lib/interfaces/repo/token_folder_repository.dart index 8b60c1f98..aba541122 100644 --- a/lib/interfaces/repo/token_folder_repository.dart +++ b/lib/interfaces/repo/token_folder_repository.dart @@ -17,7 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import 'package:privacyidea_authenticator/model/riverpod_states/token_folder_state.dart'; +import '../../../../../../../model/riverpod_states/token_folder_state.dart'; abstract class TokenFolderRepository { /// Overwrite the current state with the new folders diff --git a/lib/mains/main_customizer.dart b/lib/mains/main_customizer.dart index deebd80af..4efc8134b 100644 --- a/lib/mains/main_customizer.dart +++ b/lib/mains/main_customizer.dart @@ -22,8 +22,8 @@ import 'package:easy_dynamic_theme/easy_dynamic_theme.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:privacyidea_authenticator/utils/customization/application_customization.dart'; +import '../../../../../../../utils/customization/application_customization.dart'; import '../l10n/app_localizations.dart'; import '../model/enums/app_feature.dart'; import '../model/riverpod_states/settings_state.dart'; diff --git a/lib/mains/main_netknights.dart b/lib/mains/main_netknights.dart index 5c813d8f5..672e784ba 100644 --- a/lib/mains/main_netknights.dart +++ b/lib/mains/main_netknights.dart @@ -23,8 +23,8 @@ import 'package:easy_dynamic_theme/easy_dynamic_theme.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:privacyidea_authenticator/model/riverpod_states/settings_state.dart'; +import '../../../../../../../model/riverpod_states/settings_state.dart'; import '../firebase_options/default_firebase_options.dart'; import '../l10n/app_localizations.dart'; import '../model/enums/app_feature.dart'; diff --git a/lib/model/extensions/enums/rollout_state_extension.dart b/lib/model/extensions/enums/rollout_state_extension.dart index cfdfbd0d8..fc5185b16 100644 --- a/lib/model/extensions/enums/rollout_state_extension.dart +++ b/lib/model/extensions/enums/rollout_state_extension.dart @@ -18,9 +18,8 @@ * limitations under the License. */ -import 'package:privacyidea_authenticator/l10n/app_localizations.dart'; -import 'package:privacyidea_authenticator/l10n/app_localizations_en.dart'; - +import '../../../../../../../l10n/app_localizations.dart'; +import '../../../../../../../l10n/app_localizations_en.dart'; import '../../enums/rollout_state.dart'; extension RolloutStateX on RolloutState { diff --git a/lib/model/extensions/enums/sync_state_extension.dart b/lib/model/extensions/enums/sync_state_extension.dart index a73e9de30..07a016835 100644 --- a/lib/model/extensions/enums/sync_state_extension.dart +++ b/lib/model/extensions/enums/sync_state_extension.dart @@ -18,8 +18,7 @@ * limitations under the License. */ -import 'package:privacyidea_authenticator/l10n/app_localizations.dart'; - +import '../../../../../../../l10n/app_localizations.dart'; import '../../enums/sync_state.dart'; extension SyncStateX on SyncState { diff --git a/lib/model/processor_result.dart b/lib/model/processor_result.dart index 382d9466e..9c383b574 100644 --- a/lib/model/processor_result.dart +++ b/lib/model/processor_result.dart @@ -55,7 +55,7 @@ extension ListProcessorResult on List> { List getData() { final results = toList(); if (results.isEmpty) { - showMessage(message: 'No data found in QR code.', duration: const Duration(seconds: 3)); + showStatusMessage(message: 'No data found in QR code.'); Logger.warning('No data found in QR code.'); return []; } diff --git a/lib/model/riverpod_states/token_container_state.dart b/lib/model/riverpod_states/token_container_state.dart index 145ceb519..5e0e62c4f 100644 --- a/lib/model/riverpod_states/token_container_state.dart +++ b/lib/model/riverpod_states/token_container_state.dart @@ -21,8 +21,8 @@ import 'dart:convert'; import 'package:collection/collection.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:privacyidea_authenticator/model/tokens/token.dart'; +import '../../../../../../../model/tokens/token.dart'; import '../enums/sync_state.dart'; import '../token_container.dart'; diff --git a/lib/model/riverpod_states/token_filter.dart b/lib/model/riverpod_states/token_filter.dart index 01045b1b8..756aa4a44 100644 --- a/lib/model/riverpod_states/token_filter.dart +++ b/lib/model/riverpod_states/token_filter.dart @@ -17,9 +17,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import 'package:privacyidea_authenticator/model/mixins/sortable_mixin.dart'; -import 'package:privacyidea_authenticator/model/token_folder.dart'; - +import '../../../../../../../model/mixins/sortable_mixin.dart'; +import '../../../../../../../model/token_folder.dart'; import '../tokens/push_token.dart'; import '../tokens/token.dart'; diff --git a/lib/model/riverpod_states/token_state.dart b/lib/model/riverpod_states/token_state.dart index c88e598f5..83d13e8ae 100644 --- a/lib/model/riverpod_states/token_state.dart +++ b/lib/model/riverpod_states/token_state.dart @@ -19,8 +19,8 @@ */ import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; -import 'package:privacyidea_authenticator/model/extensions/token_folder_extension.dart'; +import '../../../../../../../model/extensions/token_folder_extension.dart'; import '../../utils/logger.dart'; import '../enums/push_token_rollout_state.dart'; import '../token_folder.dart'; diff --git a/lib/model/token_container.dart b/lib/model/token_container.dart index c60cfb59d..da1c0b21f 100644 --- a/lib/model/token_container.dart +++ b/lib/model/token_container.dart @@ -22,11 +22,11 @@ import 'package:basic_utils/basic_utils.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:privacyidea_authenticator/model/enums/algorithms.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/ec_key_algorithm_extension.dart'; -import 'package:privacyidea_authenticator/model/tokens/token.dart'; -import 'package:privacyidea_authenticator/utils/identifiers.dart'; +import '../../../../../../../model/enums/algorithms.dart'; +import '../../../../../../../model/extensions/enums/ec_key_algorithm_extension.dart'; +import '../../../../../../../model/tokens/token.dart'; +import '../../../../../../../utils/identifiers.dart'; import '../utils/ecc_utils.dart'; import '../utils/logger.dart'; import '../utils/object_validator.dart'; diff --git a/lib/model/token_import/token_origin_data.dart b/lib/model/token_import/token_origin_data.dart index cf2cce83e..bf822bede 100644 --- a/lib/model/token_import/token_origin_data.dart +++ b/lib/model/token_import/token_origin_data.dart @@ -18,8 +18,8 @@ * limitations under the License. */ import 'package:json_annotation/json_annotation.dart'; -import 'package:privacyidea_authenticator/model/token_container.dart'; +import '../../../../../../../model/token_container.dart'; import '../enums/token_origin_source_type.dart'; import '../version.dart'; diff --git a/lib/model/token_template.dart b/lib/model/token_template.dart index ec33e72da..2e70071c4 100644 --- a/lib/model/token_template.dart +++ b/lib/model/token_template.dart @@ -23,11 +23,11 @@ import 'package:flutter/foundation.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:privacyidea_authenticator/model/enums/token_origin_source_type.dart'; -import 'package:privacyidea_authenticator/model/token_container.dart'; -import 'package:privacyidea_authenticator/model/tokens/otp_token.dart'; -import 'package:privacyidea_authenticator/utils/identifiers.dart'; +import '../../../../../../../model/enums/token_origin_source_type.dart'; +import '../../../../../../../model/token_container.dart'; +import '../../../../../../../model/tokens/otp_token.dart'; +import '../../../../../../../utils/identifiers.dart'; import '../utils/object_validator.dart'; import 'token_import/token_origin_data.dart'; import 'tokens/token.dart'; diff --git a/lib/model/tokens/push_token.dart b/lib/model/tokens/push_token.dart index b30b49bd1..f93eb0476 100644 --- a/lib/model/tokens/push_token.dart +++ b/lib/model/tokens/push_token.dart @@ -21,9 +21,9 @@ */ import 'package:json_annotation/json_annotation.dart'; import 'package:pointycastle/asymmetric/api.dart'; -import 'package:privacyidea_authenticator/model/token_template.dart'; import 'package:uuid/uuid.dart'; +import '../../../../../../../model/token_template.dart'; import '../../utils/custom_int_buffer.dart'; import '../../utils/identifiers.dart'; import '../../utils/object_validator.dart'; diff --git a/lib/model/tokens/steam_token.dart b/lib/model/tokens/steam_token.dart index 6f856ee4d..2db7f0a8e 100644 --- a/lib/model/tokens/steam_token.dart +++ b/lib/model/tokens/steam_token.dart @@ -20,9 +20,9 @@ import 'package:base32/base32.dart'; import 'package:crypto/crypto.dart'; import 'package:json_annotation/json_annotation.dart'; -import 'package:privacyidea_authenticator/model/token_template.dart'; import 'package:uuid/uuid.dart'; +import '../../../../../../../model/token_template.dart'; import '../../utils/identifiers.dart'; import '../../utils/object_validator.dart'; import '../enums/algorithms.dart'; diff --git a/lib/model/tokens/token.dart b/lib/model/tokens/token.dart index f9d75bbd8..b75bd346d 100644 --- a/lib/model/tokens/token.dart +++ b/lib/model/tokens/token.dart @@ -20,8 +20,8 @@ * limitations under the License. */ import 'package:flutter/material.dart'; -import 'package:privacyidea_authenticator/model/token_container.dart'; +import '../../../../../../../model/token_container.dart'; import '../../utils/identifiers.dart'; import '../../utils/object_validator.dart'; import '../enums/token_types.dart'; diff --git a/lib/model/widget_image.dart b/lib/model/widget_image.dart index 0c22b0bcb..0ead61a3c 100644 --- a/lib/model/widget_image.dart +++ b/lib/model/widget_image.dart @@ -23,8 +23,8 @@ import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/image_file_type_extension.dart'; +import '../../../../../../../model/extensions/enums/image_file_type_extension.dart'; import '../utils/logger.dart'; import 'enums/image_file_type.dart'; diff --git a/lib/processors/scheme_processors/scheme_processor_interface.dart b/lib/processors/scheme_processors/scheme_processor_interface.dart index 8a07bbf66..13b1477d8 100644 --- a/lib/processors/scheme_processors/scheme_processor_interface.dart +++ b/lib/processors/scheme_processors/scheme_processor_interface.dart @@ -17,8 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import 'package:privacyidea_authenticator/model/processor_result.dart'; - +import '../../../../../../../model/processor_result.dart'; import '../../utils/logger.dart'; import 'home_widget_processor.dart'; import 'navigation_scheme_processors/navigation_scheme_processor_interface.dart'; diff --git a/lib/processors/scheme_processors/token_container_processor.dart b/lib/processors/scheme_processors/token_container_processor.dart index 7fffe1b7c..d33f467c7 100644 --- a/lib/processors/scheme_processors/token_container_processor.dart +++ b/lib/processors/scheme_processors/token_container_processor.dart @@ -17,10 +17,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import 'package:privacyidea_authenticator/l10n/app_localizations.dart'; -import 'package:privacyidea_authenticator/model/exception_errors/localized_argument_error.dart'; -import 'package:privacyidea_authenticator/utils/globals.dart'; - +import '../../../../../../../l10n/app_localizations.dart'; +import '../../../../../../../model/exception_errors/localized_argument_error.dart'; +import '../../../../../../../utils/globals.dart'; import '../../model/processor_result.dart'; import '../../model/token_container.dart'; import '../../utils/logger.dart'; diff --git a/lib/processors/token_import_file_processor/aegis_import_file_processor.dart b/lib/processors/token_import_file_processor/aegis_import_file_processor.dart index 41019cef1..d49b886a6 100644 --- a/lib/processors/token_import_file_processor/aegis_import_file_processor.dart +++ b/lib/processors/token_import_file_processor/aegis_import_file_processor.dart @@ -31,12 +31,12 @@ import 'package:pointycastle/export.dart'; import '../../l10n/app_localizations.dart'; import '../../model/enums/encodings.dart'; import '../../model/enums/token_origin_source_type.dart'; +import '../../model/exception_errors/localized_argument_error.dart'; import '../../model/exception_errors/localized_exception.dart'; import '../../model/extensions/enums/encodings_extension.dart'; import '../../model/extensions/enums/token_origin_source_type.dart'; import '../../model/processor_result.dart'; import '../../model/tokens/token.dart'; -import '../../model/exception_errors/localized_argument_error.dart'; import '../../utils/globals.dart'; import '../../utils/identifiers.dart'; import '../../utils/logger.dart'; diff --git a/lib/processors/token_import_file_processor/free_otp_plus_import_file_processor.dart b/lib/processors/token_import_file_processor/free_otp_plus_import_file_processor.dart index 6801605e7..fa1c8f929 100644 --- a/lib/processors/token_import_file_processor/free_otp_plus_import_file_processor.dart +++ b/lib/processors/token_import_file_processor/free_otp_plus_import_file_processor.dart @@ -23,9 +23,9 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:file_selector/file_selector.dart'; -import 'package:privacyidea_authenticator/model/enums/encodings.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/encodings_extension.dart'; +import '../../../../../../../model/enums/encodings.dart'; +import '../../../../../../../model/extensions/enums/encodings_extension.dart'; import '../../l10n/app_localizations.dart'; import '../../model/enums/token_origin_source_type.dart'; import '../../model/exception_errors/localized_exception.dart'; diff --git a/lib/utils/customization/theme_customization.dart b/lib/utils/customization/theme_customization.dart index 5263c8fd1..2fdb00db5 100644 --- a/lib/utils/customization/theme_customization.dart +++ b/lib/utils/customization/theme_customization.dart @@ -20,8 +20,8 @@ import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:privacyidea_authenticator/model/extensions/color_extension.dart'; +import '../../../../../../../model/extensions/color_extension.dart'; import 'theme_extentions/action_theme.dart'; import 'theme_extentions/elevated_delete_button_theme.dart'; import 'theme_extentions/extended_text_theme.dart'; diff --git a/lib/utils/ecc_utils.dart b/lib/utils/ecc_utils.dart index ed1340fcc..62f8a8b54 100644 --- a/lib/utils/ecc_utils.dart +++ b/lib/utils/ecc_utils.dart @@ -21,8 +21,9 @@ import 'dart:typed_data'; import 'package:basic_utils/basic_utils.dart'; -import 'package:privacyidea_authenticator/model/enums/ec_key_algorithm.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/ec_key_algorithm_extension.dart'; + +import '../../../../../../../model/enums/ec_key_algorithm.dart'; +import '../../../../../../../model/extensions/enums/ec_key_algorithm_extension.dart'; class EccUtils { const EccUtils(); diff --git a/lib/utils/firebase_utils.dart b/lib/utils/firebase_utils.dart index faf1edb05..0e77de324 100644 --- a/lib/utils/firebase_utils.dart +++ b/lib/utils/firebase_utils.dart @@ -23,12 +23,11 @@ import 'dart:io'; import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:mutex/mutex.dart'; -import 'globals.dart'; +import '../../../../../../../utils/view_utils.dart'; import 'identifiers.dart'; import 'logger.dart'; @@ -54,24 +53,24 @@ class FirebaseUtils { _initialized = true; Logger.info('Initializing Firebase'); - try { - // await FirebaseMessaging.instance.requestPermission(); - } on FirebaseException catch (e, s) { - Logger.warning( - 'e.code: ${e.code}, ' - 'e.message: ${e.message}, ' - 'e.plugin: ${e.plugin},', - error: e, - stackTrace: s, - ); - String errorMessage = e.message ?? 'no error message'; - final SnackBar snackBar = SnackBar( - behavior: SnackBarBehavior.floating, - content: Text( - "Firebase notification permission error! ($errorMessage: ${e.code}", - )); - globalSnackbarKey.currentState?.showSnackBar(snackBar); - } + // try { + // // await FirebaseMessaging.instance.requestPermission(); + // } on FirebaseException catch (e, s) { + // Logger.warning( + // 'e.code: ${e.code}, ' + // 'e.message: ${e.message}, ' + // 'e.plugin: ${e.plugin},', + // error: e, + // stackTrace: s, + // ); + // String errorMessage = e.message ?? 'no error message'; + // final SnackBar snackBar = SnackBar( + // behavior: SnackBarBehavior.floating, + // content: Text( + // "Firebase notification permission error! ($errorMessage: ${e.code}", + // )); + // globalSnackbarKey.currentState?.showSnackBar(snackBar); + // } FirebaseMessaging.onMessage.listen(foregroundHandler); FirebaseMessaging.onBackgroundMessage(backgroundHandler); @@ -82,38 +81,24 @@ class FirebaseUtils { if (firebaseToken != await getCurrentFirebaseToken() && firebaseToken != null) { updateFirebaseToken(firebaseToken); } - } on PlatformException catch (error) { - if (error.code == FIREBASE_TOKEN_ERROR_CODE) { - // ignore - } else { - String errorMessage = error.message ?? 'no error message'; - final SnackBar snackBar = SnackBar( - behavior: SnackBarBehavior.floating, - content: Text( - 'Push cant be initialized, restart the app and try again. ${error.code}: $errorMessage', - overflow: TextOverflow.fade, - softWrap: false, - )); - globalSnackbarKey.currentState?.showSnackBar(snackBar); + } catch (error, stackTrace) { + String? errorMessage; + String? subMessage; + if (error is PlatformException) { + if (error.code == FIREBASE_TOKEN_ERROR_CODE) return; // ignore + errorMessage = 'Push cant be initialized, restart the app and try again.'; + subMessage = '${error.code}: ${error.message ?? 'no error message'}'; + } + if (error is FirebaseException) { + if (error.code == FIREBASE_TOKEN_ERROR_CODE) return; // ignore + errorMessage = 'Push cant be initialized, restart the app and try again.'; + subMessage = '${error.code}: ${error.message ?? 'no error message'}'; + } + if (errorMessage != null) { + showStatusMessage(message: errorMessage, subMessage: subMessage); + return; } - } on FirebaseException catch (error) { - final SnackBar snackBar = SnackBar( - behavior: SnackBarBehavior.floating, - content: Text( - "Push cant be initialized, restart the app and try again$error", - overflow: TextOverflow.fade, - softWrap: false, - )); - globalSnackbarKey.currentState?.showSnackBar(snackBar); - } catch (error) { - final SnackBar snackBar = SnackBar( - behavior: SnackBarBehavior.floating, - content: Text( - "Unknown error: $error", - overflow: TextOverflow.fade, - softWrap: false, - )); - globalSnackbarKey.currentState?.showSnackBar(snackBar); + Logger.error('Unknown Firebase error', error: error, stackTrace: stackTrace); } FirebaseMessaging.instance.onTokenRefresh.listen((String newToken) async { @@ -122,15 +107,8 @@ class FirebaseUtils { // TODO what if this fails, when should a retry be attempted? try { updateFirebaseToken(newToken); - } catch (error) { - final SnackBar snackBar = SnackBar( - behavior: SnackBarBehavior.floating, - content: Text( - "Unknown error: $error", - overflow: TextOverflow.fade, - softWrap: false, - )); - globalSnackbarKey.currentState?.showSnackBar(snackBar); + } catch (error, stackTrace) { + Logger.error('Error updating firebase token', error: error, stackTrace: stackTrace); } } }); diff --git a/lib/utils/logger.dart b/lib/utils/logger.dart index 3fc1101c3..eeaaada6d 100644 --- a/lib/utils/logger.dart +++ b/lib/utils/logger.dart @@ -37,6 +37,7 @@ import '../utils/app_info_utils.dart'; import '../utils/pi_mailer.dart'; import '../views/settings_view/settings_view_widgets/send_error_dialog.dart'; import 'globals.dart'; +import 'view_utils.dart'; final provider = Provider((ref) => 0); @@ -209,7 +210,7 @@ class Logger { _lastError = error.toString().substring(0, min(error.toString().length, 100)); } _logToFile(errorString); - _showSnackbar(); + _showErrorSnackbar(); StackTrace? stackTraceObject; if (stackTrace is StackTrace) { stackTraceObject = stackTrace; @@ -262,16 +263,7 @@ Device Parameters $deviceInfo"""; final directory = await getApplicationDocumentsDirectory(); final file = File('${directory.path}/$_filename'); await file.writeAsString('', mode: FileMode.write); - globalSnackbarKey.currentState?.showSnackBar( - SnackBar( - behavior: SnackBarBehavior.floating, - content: Text( - _context != null ? AppLocalizations.of(_context!)!.errorLogCleared : 'Error Log Cleared', - overflow: TextOverflow.fade, - softWrap: false, - ), - ), - ); + showSnackBar(_context != null ? AppLocalizations.of(_context!)!.errorLogCleared : 'Error Log Cleared'); } /*----------- SETUPS -----------*/ @@ -369,7 +361,7 @@ Device Parameters $deviceInfo"""; /*----------- DISPLAY OUTPUTS -----------*/ - void _showSnackbar() { + void _showErrorSnackbar() { if (_flutterIsRunning == false) return; WidgetsBinding.instance.addPostFrameCallback((_) { globalSnackbarKey.currentState?.showSnackBar( diff --git a/lib/utils/object_validator.dart b/lib/utils/object_validator.dart index dbeb61b78..a85bf386c 100644 --- a/lib/utils/object_validator.dart +++ b/lib/utils/object_validator.dart @@ -18,8 +18,7 @@ * limitations under the License. */ -import 'package:privacyidea_authenticator/model/extensions/enums/encodings_extension.dart'; - +import '../../../../../../../model/extensions/enums/encodings_extension.dart'; import '../model/enums/algorithms.dart'; import '../model/enums/encodings.dart'; import '../model/exception_errors/localized_argument_error.dart'; diff --git a/lib/utils/privacyidea_io_client.dart b/lib/utils/privacyidea_io_client.dart index 9d9000fbe..683cbbb54 100644 --- a/lib/utils/privacyidea_io_client.dart +++ b/lib/utils/privacyidea_io_client.dart @@ -25,8 +25,8 @@ import 'package:flutter/foundation.dart'; import 'package:http/http.dart'; import 'package:http/io_client.dart'; import 'package:package_info_plus/package_info_plus.dart'; -import 'package:privacyidea_authenticator/model/pi_server_response.dart'; +import '../../../../../../../model/pi_server_response.dart'; import '../l10n/app_localizations.dart'; import '../model/api_results/pi_server_results/pi_server_result_value.dart'; import '../utils/globals.dart'; @@ -117,7 +117,7 @@ class PrivacyideaIOClient { response = await ioClient.post(url, body: body).timeout(const Duration(seconds: 15)); } on HandshakeException catch (e, _) { Logger.info('Handshake failed. sslVerify: $sslVerify'); - showMessage(message: 'Handshake failed, please check the server certificate and try again.'); + showStatusMessage(message: 'Handshake failed, please check the server certificate and try again.'); ioClient.close(); return ResponseBuilder.fromStatusCode(525); } on TimeoutException catch (e, _) { diff --git a/lib/utils/push_provider.dart b/lib/utils/push_provider.dart index 90d4337c8..d582690f5 100644 --- a/lib/utils/push_provider.dart +++ b/lib/utils/push_provider.dart @@ -26,9 +26,9 @@ import 'package:collection/collection.dart'; import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:http/http.dart'; -import 'package:privacyidea_authenticator/repo/secure_push_request_repository.dart'; -import 'package:privacyidea_authenticator/utils/pi_notifications.dart'; +import '../../../../../../../repo/secure_push_request_repository.dart'; +import '../../../../../../../utils/pi_notifications.dart'; import '../l10n/app_localizations.dart'; import '../model/push_request.dart'; import '../model/tokens/push_token.dart'; diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/push_request_provider.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/push_request_provider.dart index 47e58a2ba..a59ba2aa3 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/push_request_provider.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/push_request_provider.dart @@ -21,10 +21,10 @@ import 'dart:async'; import 'package:http/http.dart'; import 'package:mutex/mutex.dart'; -import 'package:privacyidea_authenticator/interfaces/repo/push_request_repository.dart'; -import 'package:privacyidea_authenticator/utils/rsa_utils.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; +import '../../../../../../../interfaces/repo/push_request_repository.dart'; +import '../../../../../../../utils/rsa_utils.dart'; import '../../../../l10n/app_localizations.dart'; import '../../../../model/push_request.dart'; import '../../../../model/riverpod_states/push_request_state.dart'; diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/settings_notifier.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/settings_notifier.dart index 418366ed5..0503227be 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/settings_notifier.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/settings_notifier.dart @@ -21,9 +21,9 @@ import 'dart:ui'; import 'package:mutex/mutex.dart'; -import 'package:privacyidea_authenticator/repo/preference_settings_repository.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; +import '../../../../../../../repo/preference_settings_repository.dart'; import '../../../../interfaces/repo/settings_repository.dart'; import '../../../../model/riverpod_states/settings_state.dart'; import '../../../../model/version.dart'; diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/sortable_notifier.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/sortable_notifier.dart index a3c21ff4f..fc46aa7bd 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/sortable_notifier.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/sortable_notifier.dart @@ -19,9 +19,9 @@ */ import 'package:flutter/widgets.dart'; -import 'package:privacyidea_authenticator/model/extensions/sortable_list.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; +import '../../../../../../../model/extensions/sortable_list.dart'; import '../../../../model/mixins/sortable_mixin.dart'; import '../../../../model/token_folder.dart'; import '../../../../model/tokens/token.dart'; diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart index c29012f00..664cd1aed 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart @@ -23,17 +23,17 @@ import 'package:basic_utils/basic_utils.dart'; import 'package:collection/collection.dart'; import 'package:http/http.dart'; import 'package:mutex/mutex.dart'; -import 'package:privacyidea_authenticator/model/exception_errors/pi_server_result_error.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/rollout_state_extension.dart'; -import 'package:privacyidea_authenticator/model/processor_result.dart'; -import 'package:privacyidea_authenticator/model/tokens/token.dart'; -import 'package:privacyidea_authenticator/utils/globals.dart'; -import 'package:privacyidea_authenticator/utils/privacyidea_io_client.dart'; -import 'package:privacyidea_authenticator/utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart'; -import 'package:privacyidea_authenticator/utils/riverpod/riverpod_providers/state_providers/status_message_provider.dart'; -import 'package:privacyidea_authenticator/utils/view_utils.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; +import '../../../../../../../model/exception_errors/pi_server_result_error.dart'; +import '../../../../../../../model/extensions/enums/rollout_state_extension.dart'; +import '../../../../../../../model/processor_result.dart'; +import '../../../../../../../model/tokens/token.dart'; +import '../../../../../../../utils/globals.dart'; +import '../../../../../../../utils/privacyidea_io_client.dart'; +import '../../../../../../../utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart'; +import '../../../../../../../utils/riverpod/riverpod_providers/state_providers/status_message_provider.dart'; +import '../../../../../../../utils/view_utils.dart'; import '../../../../api/privacy_idea_container_api.dart'; import '../../../../interfaces/repo/token_container_repository.dart'; import '../../../../l10n/app_localizations.dart'; diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/token_folder_notifier.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/token_folder_notifier.dart index 8c022f267..62670dddc 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/token_folder_notifier.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/token_folder_notifier.dart @@ -18,9 +18,9 @@ * limitations under the License. */ import 'package:mutex/mutex.dart'; -import 'package:privacyidea_authenticator/repo/preference_token_folder_repository.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; +import '../../../../../../../repo/preference_token_folder_repository.dart'; import '../../../../interfaces/repo/token_folder_repository.dart'; import '../../../../model/riverpod_states/token_folder_state.dart'; import '../../../../model/token_folder.dart'; diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart index 9a4457c36..08471ea68 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart @@ -22,19 +22,18 @@ import 'dart:convert'; import 'dart:io'; import 'package:collection/collection.dart'; -import 'package:firebase_core/firebase_core.dart'; +import 'package:firebase_core/firebase_core.dart' show FirebaseException; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:http/http.dart'; import 'package:mutex/mutex.dart'; import 'package:pointycastle/asymmetric/api.dart'; -import 'package:privacyidea_authenticator/interfaces/repo/token_repository.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/push_token_rollout_state_extension.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/token_origin_source_type.dart'; -import 'package:privacyidea_authenticator/repo/secure_token_repository.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; +import '../../../../../../model/extensions/enums/push_token_rollout_state_extension.dart'; +import '../../../../../../model/extensions/enums/token_origin_source_type.dart'; +import '../../../../interfaces/repo/token_repository.dart'; import '../../../../l10n/app_localizations.dart'; import '../../../../model/enums/push_token_rollout_state.dart'; import '../../../../model/enums/token_import_type.dart'; @@ -46,6 +45,7 @@ import '../../../../model/tokens/otp_token.dart'; import '../../../../model/tokens/push_token.dart'; import '../../../../model/tokens/token.dart'; import '../../../../processors/scheme_processors/token_import_scheme_processors/token_import_scheme_processor_interface.dart'; +import '../../../../repo/secure_token_repository.dart'; import '../../../../views/import_tokens_view/pages/import_plain_tokens_page.dart'; import '../../../firebase_utils.dart'; import '../../../globals.dart'; @@ -615,9 +615,7 @@ class TokenNotifier extends _$TokenNotifier with ResultHandler { return false; } } on FormatException catch (e, s) { - showMessage(message: "Couldn't parsing RSA public key: ${e.message}", duration: const Duration(seconds: 3)); - - Logger.warning('Error while parsing RSA public key.', error: e, stackTrace: s); + Logger.error('Error while parsing RSA public key.', error: e, stackTrace: s); if (pushToken == null) { Logger.warning('Tried to update a token that does not exist.'); return false; @@ -666,22 +664,13 @@ class TokenNotifier extends _$TokenNotifier with ResultHandler { } if (e is PlatformException && e.code == FIREBASE_TOKEN_ERROR_CODE || e is SocketException || e is TimeoutException || e is FirebaseException) { Logger.warning('Connection error: Roll out push token failed.', error: e, stackTrace: s); - showMessage( - message: AppLocalizations.of(globalNavigatorKey.currentContext!)!.errorRollOutNoConnectionToServer(pushToken.label), - duration: const Duration(seconds: 3), - ); + showSnackBar(AppLocalizations.of(globalNavigatorKey.currentContext!)!.errorRollOutNoConnectionToServer(pushToken.label)); } else if (e is HandshakeException) { Logger.warning('SSL error: Roll out push token failed.', error: e, stackTrace: s); - showMessage( - message: AppLocalizations.of(globalNavigatorKey.currentContext!)!.errorRollOutSSLHandshakeFailed, - duration: const Duration(seconds: 3), - ); + showSnackBar(AppLocalizations.of(globalNavigatorKey.currentContext!)!.errorRollOutSSLHandshakeFailed); } else { if (globalNavigatorKey.currentContext != null) { - showMessage( - message: AppLocalizations.of(globalNavigatorKey.currentContext!)!.errorRollOutUnknownError(e), - duration: const Duration(seconds: 3), - ); + showSnackBar(AppLocalizations.of(globalNavigatorKey.currentContext!)!.errorRollOutUnknownError(e)); } Logger.error('Roll out push token failed.', error: e, stackTrace: s); } diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 0a04e2861..ea4619670 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -29,13 +29,13 @@ import 'package:http/http.dart'; import 'package:image/image.dart' as img; import 'package:package_info_plus/package_info_plus.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:privacyidea_authenticator/mains/main_netknights.dart'; -import 'package:privacyidea_authenticator/model/extensions/sortable_list.dart'; -import 'package:privacyidea_authenticator/utils/logger.dart'; -import 'package:privacyidea_authenticator/utils/riverpod/riverpod_providers/generated_providers/sortable_notifier.dart'; -import 'package:privacyidea_authenticator/views/main_view/main_view_widgets/loading_indicator.dart'; import 'package:zxing2/qrcode.dart'; +import '../../../../../../../mains/main_netknights.dart'; +import '../../../../../../../model/extensions/sortable_list.dart'; +import '../../../../../../../utils/logger.dart'; +import '../../../../../../../utils/riverpod/riverpod_providers/generated_providers/sortable_notifier.dart'; +import '../../../../../../../views/main_view/main_view_widgets/loading_indicator.dart'; import '../model/enums/token_origin_source_type.dart'; import '../model/mixins/sortable_mixin.dart'; import '../model/processor_result.dart'; @@ -219,7 +219,7 @@ Future scanQrCode({BuildContext? context, required List res _ => throw ArgumentError('Invalid type for qrCode: $qrCode'), }; } catch (e) { - showMessage(message: 'The scanned QR code is not a valid URI.', duration: const Duration(seconds: 3)); + showStatusMessage(message: 'The scanned QR code is not a valid URI.'); Logger.warning('Scanned Data: $qrCode'); return; } diff --git a/lib/utils/view_utils.dart b/lib/utils/view_utils.dart index ceb0e4d11..bc81bf0b1 100644 --- a/lib/utils/view_utils.dart +++ b/lib/utils/view_utils.dart @@ -23,20 +23,23 @@ import 'globals.dart'; import 'logger.dart'; import 'riverpod/riverpod_providers/state_providers/status_message_provider.dart'; +ScaffoldFeatureController? showSnackBar(String message) => _showSnackBar(message, const Duration(seconds: 3)); +ScaffoldFeatureController? showSnackBarLong(String message) => _showSnackBar(message, const Duration(seconds: 10)); + /// Shows a snackbar message to the user for a given `Duration`. -void showMessage({ - required String message, - Duration duration = const Duration(seconds: 5), -}) { +ScaffoldFeatureController? _showSnackBar( + String message, + Duration duration, +) { if (globalSnackbarKey.currentState == null) { Logger.warning('globalSnackbarKey.currentState is null'); - return; + return null; } - globalSnackbarKey.currentState!.showSnackBar( + return globalSnackbarKey.currentState!.showSnackBar( SnackBar( behavior: SnackBarBehavior.floating, content: Text(message), - duration: duration, + duration: const Duration(seconds: 5), ), ); } diff --git a/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_daypassword_manually.dart b/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_daypassword_manually.dart index 0abfa21ce..6ddf31b7a 100644 --- a/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_daypassword_manually.dart +++ b/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_daypassword_manually.dart @@ -19,10 +19,10 @@ */ import 'package:flutter/material.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/encodings_extension.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/token_origin_source_type.dart'; import 'package:uuid/uuid.dart'; +import '../../../../../../../model/extensions/enums/encodings_extension.dart'; +import '../../../../../../../model/extensions/enums/token_origin_source_type.dart'; import '../../../../model/enums/algorithms.dart'; import '../../../../model/enums/duration_unit.dart'; import '../../../../model/enums/encodings.dart'; diff --git a/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_hotp_manually.dart b/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_hotp_manually.dart index 91f7e7803..12b271ccf 100644 --- a/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_hotp_manually.dart +++ b/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_hotp_manually.dart @@ -19,10 +19,10 @@ */ import 'package:flutter/material.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/encodings_extension.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/token_origin_source_type.dart'; import 'package:uuid/uuid.dart'; +import '../../../../../../../model/extensions/enums/encodings_extension.dart'; +import '../../../../../../../model/extensions/enums/token_origin_source_type.dart'; import '../../../../model/enums/algorithms.dart'; import '../../../../model/enums/encodings.dart'; import '../../../../model/enums/token_origin_source_type.dart'; diff --git a/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_steam_manually.dart b/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_steam_manually.dart index 3ec9f6ba2..ce269b477 100644 --- a/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_steam_manually.dart +++ b/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_steam_manually.dart @@ -19,9 +19,9 @@ */ import 'package:flutter/material.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/token_origin_source_type.dart'; import 'package:uuid/uuid.dart'; +import '../../../../../../../model/extensions/enums/token_origin_source_type.dart'; import '../../../../model/enums/algorithms.dart'; import '../../../../model/enums/duration_unit.dart'; import '../../../../model/enums/encodings.dart'; diff --git a/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_totp_manually.dart b/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_totp_manually.dart index 39dfbcee4..e1e9d8e7a 100644 --- a/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_totp_manually.dart +++ b/lib/views/add_token_manually_view/add_token_manually_view_widgets/add_tokens_manually/add_totp_manually.dart @@ -18,10 +18,10 @@ * limitations under the License. */ import 'package:flutter/material.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/encodings_extension.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/token_origin_source_type.dart'; import 'package:uuid/uuid.dart'; +import '../../../../../../../model/extensions/enums/encodings_extension.dart'; +import '../../../../../../../model/extensions/enums/token_origin_source_type.dart'; import '../../../../model/enums/algorithms.dart'; import '../../../../model/enums/duration_unit.dart'; import '../../../../model/enums/encodings.dart'; diff --git a/lib/views/add_token_manually_view/add_token_manually_view_widgets/rows/duration_dropdown_button.dart b/lib/views/add_token_manually_view/add_token_manually_view_widgets/rows/duration_dropdown_button.dart index 63160f565..c848efbb4 100644 --- a/lib/views/add_token_manually_view/add_token_manually_view_widgets/rows/duration_dropdown_button.dart +++ b/lib/views/add_token_manually_view/add_token_manually_view_widgets/rows/duration_dropdown_button.dart @@ -18,8 +18,8 @@ * limitations under the License. */ import 'package:flutter/material.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/duration_unit_extension.dart'; +import '../../../../../../../model/extensions/enums/duration_unit_extension.dart'; import '../../../../l10n/app_localizations.dart'; import '../../../../model/enums/duration_unit.dart'; import '../labeled_dropdown_button.dart'; diff --git a/lib/views/add_token_manually_view/add_token_manually_view_widgets/rows/label_input_field.dart b/lib/views/add_token_manually_view/add_token_manually_view_widgets/rows/label_input_field.dart index 04721d5a3..d038a530f 100644 --- a/lib/views/add_token_manually_view/add_token_manually_view_widgets/rows/label_input_field.dart +++ b/lib/views/add_token_manually_view/add_token_manually_view_widgets/rows/label_input_field.dart @@ -18,8 +18,8 @@ * limitations under the License. */ import 'package:flutter/material.dart'; -import 'package:privacyidea_authenticator/widgets/pi_text_field.dart'; +import '../../../../../../../widgets/pi_text_field.dart'; import '../../../../l10n/app_localizations.dart'; class LabelInputField extends StatefulWidget { diff --git a/lib/views/add_token_manually_view/add_token_manually_view_widgets/rows/secret_input_field.dart b/lib/views/add_token_manually_view/add_token_manually_view_widgets/rows/secret_input_field.dart index 40bea3dda..32dba7e67 100644 --- a/lib/views/add_token_manually_view/add_token_manually_view_widgets/rows/secret_input_field.dart +++ b/lib/views/add_token_manually_view/add_token_manually_view_widgets/rows/secret_input_field.dart @@ -18,9 +18,9 @@ * limitations under the License. */ import 'package:flutter/material.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/encodings_extension.dart'; -import 'package:privacyidea_authenticator/widgets/pi_text_field.dart'; +import '../../../../../../../model/extensions/enums/encodings_extension.dart'; +import '../../../../../../../widgets/pi_text_field.dart'; import '../../../../l10n/app_localizations.dart'; import '../../../../model/enums/encodings.dart'; diff --git a/lib/views/container_view/container_view.dart b/lib/views/container_view/container_view.dart index 4a8a7845d..c049504ae 100644 --- a/lib/views/container_view/container_view.dart +++ b/lib/views/container_view/container_view.dart @@ -21,8 +21,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; -import 'package:privacyidea_authenticator/views/main_view/main_view_widgets/main_view_navigation_buttons/qr_scanner_button.dart'; +import '../../../../../../../views/main_view/main_view_widgets/drag_target_divider.dart'; +import '../../../../../../../views/main_view/main_view_widgets/main_view_navigation_buttons/qr_scanner_button.dart'; import '../../l10n/app_localizations.dart'; import '../../utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart'; import '../view_interface.dart'; @@ -40,7 +41,7 @@ class ContainerView extends ConsumerView { @override Widget build(BuildContext context, WidgetRef ref) { - final container = ref.watch(tokenContainerProvider).whenOrNull(data: (data) => data.containerList) ?? []; + final containerList = ref.watch(tokenContainerProvider).whenOrNull(data: (data) => data.containerList) ?? []; return Scaffold( appBar: AppBar( title: Text(AppLocalizations.of(context)!.container), @@ -52,7 +53,10 @@ class ContainerView extends ConsumerView { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - for (var containerCredential in container) ContainerWidget(container: containerCredential), + for (var container in containerList) ...[ + if (containerList.indexOf(container) != 0) const DefaultDivider(), + ContainerWidget(container: container), + ], ], ), ), diff --git a/lib/views/container_view/container_widgets/container_actions/details_container_action.dart b/lib/views/container_view/container_widgets/container_actions/details_container_action.dart index 6a9a4c606..db372847b 100644 --- a/lib/views/container_view/container_widgets/container_actions/details_container_action.dart +++ b/lib/views/container_view/container_widgets/container_actions/details_container_action.dart @@ -20,8 +20,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; -import 'package:privacyidea_authenticator/views/container_view/container_widgets/container_actions/details_container_action_dialog.dart'; +import '../../../../../../../views/container_view/container_widgets/container_actions/details_container_action_dialog.dart'; import '../../../../l10n/app_localizations.dart'; import '../../../../model/token_container.dart'; import '../../../../utils/customization/theme_extentions/action_theme.dart'; diff --git a/lib/views/container_view/container_widgets/container_actions/details_container_action_dialog.dart b/lib/views/container_view/container_widgets/container_actions/details_container_action_dialog.dart index a5fc73955..d404a35f5 100644 --- a/lib/views/container_view/container_widgets/container_actions/details_container_action_dialog.dart +++ b/lib/views/container_view/container_widgets/container_actions/details_container_action_dialog.dart @@ -20,10 +20,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/rollout_state_extension.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/sync_state_extension.dart'; -import 'package:privacyidea_authenticator/widgets/enable_text_edit_after_many_taps.dart'; +import '../../../../../../../model/extensions/enums/rollout_state_extension.dart'; +import '../../../../../../../model/extensions/enums/sync_state_extension.dart'; +import '../../../../../../../widgets/enable_text_edit_after_many_taps.dart'; import '../../../../l10n/app_localizations.dart'; import '../../../../model/token_container.dart'; import '../../../../utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart'; diff --git a/lib/views/container_view/container_widgets/container_actions/export_container_action_dialog.dart b/lib/views/container_view/container_widgets/container_actions/export_container_action_dialog.dart index fc92e2f2a..aa64a806c 100644 --- a/lib/views/container_view/container_widgets/container_actions/export_container_action_dialog.dart +++ b/lib/views/container_view/container_widgets/container_actions/export_container_action_dialog.dart @@ -20,10 +20,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:privacyidea_authenticator/model/token_container.dart'; -import 'package:privacyidea_authenticator/utils/view_utils.dart'; -import 'package:privacyidea_authenticator/widgets/button_widgets/cooldown_button.dart'; +import '../../../../../../../model/token_container.dart'; +import '../../../../../../../utils/view_utils.dart'; +import '../../../../../../../widgets/button_widgets/cooldown_button.dart'; import '../../../../utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart'; import '../../../../utils/utils.dart'; import '../../../../widgets/dialog_widgets/default_dialog.dart'; diff --git a/lib/views/container_view/container_widgets/container_widget.dart b/lib/views/container_view/container_widgets/container_widget.dart index 1a7a18219..1f6059370 100644 --- a/lib/views/container_view/container_widgets/container_widget.dart +++ b/lib/views/container_view/container_widgets/container_widget.dart @@ -55,7 +55,10 @@ class ContainerWidget extends ConsumerWidget { ExportContainerAction(container: container as TokenContainerFinalized, key: Key('${container.serial}-ExportContainerAction')), ], stack: stack, - child: ContainerWidgetTile(container: container), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 14), + child: ContainerWidgetTile(container: container), + ), ), ); } diff --git a/lib/views/container_view/container_widgets/container_widget_tile.dart b/lib/views/container_view/container_widgets/container_widget_tile.dart index fa81c4082..3fdca31ee 100644 --- a/lib/views/container_view/container_widgets/container_widget_tile.dart +++ b/lib/views/container_view/container_widgets/container_widget_tile.dart @@ -20,8 +20,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:privacyidea_authenticator/model/extensions/enums/rollout_state_extension.dart'; +import '../../../../../../../model/extensions/enums/rollout_state_extension.dart'; import '../../../l10n/app_localizations.dart'; import '../../../model/enums/sync_state.dart'; import '../../../model/token_container.dart'; diff --git a/lib/views/feedback_view/feedback_view.dart b/lib/views/feedback_view/feedback_view.dart index 1dfc31835..5c8011438 100644 --- a/lib/views/feedback_view/feedback_view.dart +++ b/lib/views/feedback_view/feedback_view.dart @@ -19,9 +19,9 @@ */ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; -import 'package:privacyidea_authenticator/views/feedback_view/widgets/feedback_send_row.dart'; import 'package:url_launcher/url_launcher.dart'; +import '../../../../../../../views/feedback_view/widgets/feedback_send_row.dart'; import '../../l10n/app_localizations.dart'; import '../../utils/globals.dart'; import '../view_interface.dart'; diff --git a/lib/views/import_tokens_view/pages/import_start_page.dart b/lib/views/import_tokens_view/pages/import_start_page.dart index 950037b97..f1ddf31ca 100644 --- a/lib/views/import_tokens_view/pages/import_start_page.dart +++ b/lib/views/import_tokens_view/pages/import_start_page.dart @@ -24,8 +24,8 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_zxing/flutter_zxing.dart' as zxing; import 'package:flutter_zxing/flutter_zxing.dart'; import 'package:image_picker/image_picker.dart'; -import 'package:privacyidea_authenticator/utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart'; +import '../../../../../../../utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart'; import '../../../l10n/app_localizations.dart'; import '../../../model/enums/token_import_type.dart'; import '../../../model/enums/token_origin_source_type.dart'; diff --git a/lib/views/import_tokens_view/widgets/conflicted_import_tokens_tile.dart b/lib/views/import_tokens_view/widgets/conflicted_import_tokens_tile.dart index 1420f355e..a4856eee2 100644 --- a/lib/views/import_tokens_view/widgets/conflicted_import_tokens_tile.dart +++ b/lib/views/import_tokens_view/widgets/conflicted_import_tokens_tile.dart @@ -18,8 +18,8 @@ * limitations under the License. */ import 'package:flutter/material.dart'; -import 'package:privacyidea_authenticator/utils/logger.dart'; +import '../../../../../../../utils/logger.dart'; import '../../../model/token_import/token_import_entry.dart'; import '../../../model/tokens/token.dart'; import 'no_conflict_import_tokens_tile.dart'; diff --git a/lib/views/import_tokens_view/widgets/dialogs/qr_not_found_dialog.dart b/lib/views/import_tokens_view/widgets/dialogs/qr_not_found_dialog.dart index f366eb6f4..7a4eaf933 100644 --- a/lib/views/import_tokens_view/widgets/dialogs/qr_not_found_dialog.dart +++ b/lib/views/import_tokens_view/widgets/dialogs/qr_not_found_dialog.dart @@ -22,8 +22,8 @@ import 'package:flutter/material.dart'; import 'package:image_cropper/image_cropper.dart'; import '../../../../l10n/app_localizations.dart'; -import '../../../../utils/globals.dart'; import '../../../../utils/logger.dart'; +import '../../../../utils/view_utils.dart'; import '../../../../widgets/dialog_widgets/default_dialog.dart'; class QrNotFoundDialog extends StatelessWidget { @@ -73,12 +73,7 @@ class QrNotFoundDialog extends StatelessWidget { } catch (e) { if (!context.mounted) return; Navigator.of(context).pop(); - globalSnackbarKey.currentState?.showSnackBar( - const SnackBar( - behavior: SnackBarBehavior.floating, - content: Text("File not currently available! Please try again."), - ), - ); + showStatusMessage(message: "File not currently available! Please try again."); return; } if (!context.mounted) return; diff --git a/lib/views/main_view/main_view_widgets/folder_widgets/add_token_folder_dialog.dart b/lib/views/main_view/main_view_widgets/folder_widgets/add_token_folder_dialog.dart index c14c2fa8e..80533777c 100644 --- a/lib/views/main_view/main_view_widgets/folder_widgets/add_token_folder_dialog.dart +++ b/lib/views/main_view/main_view_widgets/folder_widgets/add_token_folder_dialog.dart @@ -19,8 +19,8 @@ */ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:privacyidea_authenticator/widgets/pi_text_field.dart'; +import '../../../../../../../widgets/pi_text_field.dart'; import '../../../../l10n/app_localizations.dart'; import '../../../../model/enums/introduction.dart'; import '../../../../utils/riverpod/riverpod_providers/generated_providers/introduction_provider.dart'; diff --git a/lib/views/main_view/main_view_widgets/folder_widgets/token_folder_actions.dart/rename_token_folder_action.dart b/lib/views/main_view/main_view_widgets/folder_widgets/token_folder_actions.dart/rename_token_folder_action.dart index 2a26ac27a..e2a31e9af 100644 --- a/lib/views/main_view/main_view_widgets/folder_widgets/token_folder_actions.dart/rename_token_folder_action.dart +++ b/lib/views/main_view/main_view_widgets/folder_widgets/token_folder_actions.dart/rename_token_folder_action.dart @@ -19,8 +19,8 @@ */ import 'package:flutter/material.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; -import 'package:privacyidea_authenticator/widgets/pi_text_field.dart'; +import '../../../../../../../widgets/pi_text_field.dart'; import '../../../../../l10n/app_localizations.dart'; import '../../../../../model/token_folder.dart'; import '../../../../../utils/customization/theme_extentions/action_theme.dart'; diff --git a/lib/views/main_view/main_view_widgets/folder_widgets/token_folder_expandable.dart b/lib/views/main_view/main_view_widgets/folder_widgets/token_folder_expandable.dart index 523eed629..8c67f2918 100644 --- a/lib/views/main_view/main_view_widgets/folder_widgets/token_folder_expandable.dart +++ b/lib/views/main_view/main_view_widgets/folder_widgets/token_folder_expandable.dart @@ -21,8 +21,8 @@ import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:privacyidea_authenticator/model/tokens/token.dart'; +import '../../../../../../../model/tokens/token.dart'; import '../../../../model/riverpod_states/token_filter.dart'; import '../../../../model/token_folder.dart'; import '../../../../utils/globals.dart'; diff --git a/lib/views/main_view/main_view_widgets/folder_widgets/token_folder_expandable_widgets/token_folder_expandable_header.dart b/lib/views/main_view/main_view_widgets/folder_widgets/token_folder_expandable_widgets/token_folder_expandable_header.dart index 8065301a0..32a298d10 100644 --- a/lib/views/main_view/main_view_widgets/folder_widgets/token_folder_expandable_widgets/token_folder_expandable_header.dart +++ b/lib/views/main_view/main_view_widgets/folder_widgets/token_folder_expandable_widgets/token_folder_expandable_header.dart @@ -22,9 +22,9 @@ import 'dart:async'; import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:privacyidea_authenticator/utils/default_inkwell.dart'; -import 'package:privacyidea_authenticator/widgets/pi_slidable.dart'; +import '../../../../../../../utils/default_inkwell.dart'; +import '../../../../../../../widgets/pi_slidable.dart'; import '../../../../../l10n/app_localizations.dart'; import '../../../../../model/token_folder.dart'; import '../../../../../model/tokens/token.dart'; diff --git a/lib/views/main_view/main_view_widgets/main_view_navigation_buttons/license_push_view_button.dart b/lib/views/main_view/main_view_widgets/main_view_navigation_buttons/license_push_view_button.dart index 1190a184f..0565365d1 100644 --- a/lib/views/main_view/main_view_widgets/main_view_navigation_buttons/license_push_view_button.dart +++ b/lib/views/main_view/main_view_widgets/main_view_navigation_buttons/license_push_view_button.dart @@ -19,8 +19,8 @@ */ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:privacyidea_authenticator/model/riverpod_states/settings_state.dart'; +import '../../../../../../../model/riverpod_states/settings_state.dart'; import '../../../../l10n/app_localizations.dart'; import '../../../../model/enums/introduction.dart'; import '../../../../utils/riverpod/riverpod_providers/generated_providers/introduction_provider.dart'; diff --git a/lib/views/main_view/main_view_widgets/main_view_navigation_buttons/qr_scanner_button.dart b/lib/views/main_view/main_view_widgets/main_view_navigation_buttons/qr_scanner_button.dart index 3f33eae0c..8f7c4a8d2 100644 --- a/lib/views/main_view/main_view_widgets/main_view_navigation_buttons/qr_scanner_button.dart +++ b/lib/views/main_view/main_view_widgets/main_view_navigation_buttons/qr_scanner_button.dart @@ -20,8 +20,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:privacyidea_authenticator/utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart'; +import '../../../../../../../utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart'; import '../../../../l10n/app_localizations.dart'; import '../../../../model/processor_result.dart'; import '../../../../utils/globals.dart'; diff --git a/lib/views/main_view/main_view_widgets/main_view_tokens_list.dart b/lib/views/main_view/main_view_widgets/main_view_tokens_list.dart index 2f8d16170..9e2e36886 100644 --- a/lib/views/main_view/main_view_widgets/main_view_tokens_list.dart +++ b/lib/views/main_view/main_view_widgets/main_view_tokens_list.dart @@ -21,8 +21,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; -import 'package:privacyidea_authenticator/views/main_view/main_view_widgets/token_widgets/token_widget_builder.dart'; +import '../../../../../../../views/main_view/main_view_widgets/token_widgets/token_widget_builder.dart'; import '../../../model/mixins/sortable_mixin.dart'; import '../../../model/riverpod_states/settings_state.dart'; import '../../../model/riverpod_states/token_filter.dart'; diff --git a/lib/views/main_view/main_view_widgets/main_view_tokens_list_filtered.dart b/lib/views/main_view/main_view_widgets/main_view_tokens_list_filtered.dart index 0fd5dc6cd..6ef32ee4f 100644 --- a/lib/views/main_view/main_view_widgets/main_view_tokens_list_filtered.dart +++ b/lib/views/main_view/main_view_widgets/main_view_tokens_list_filtered.dart @@ -19,8 +19,8 @@ */ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:privacyidea_authenticator/utils/riverpod/riverpod_providers/generated_providers/settings_notifier.dart'; +import '../../../../../../../utils/riverpod/riverpod_providers/generated_providers/settings_notifier.dart'; import '../../../model/mixins/sortable_mixin.dart'; import '../../../utils/riverpod/riverpod_providers/generated_providers/token_folder_notifier.dart'; import '../../../utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart'; diff --git a/lib/views/main_view/main_view_widgets/sortable_widget_builder.dart b/lib/views/main_view/main_view_widgets/sortable_widget_builder.dart index 026947713..76b5d4ec0 100644 --- a/lib/views/main_view/main_view_widgets/sortable_widget_builder.dart +++ b/lib/views/main_view/main_view_widgets/sortable_widget_builder.dart @@ -18,7 +18,7 @@ // * limitations under the License. // */ // import 'package:flutter/material.dart'; -// import 'package:privacyidea_authenticator/model/riverpod_states/token_filter.dart'; +// import '../../../../../../../model/riverpod_states/token_filter.dart'; // import '../../../model/mixins/sortable_mixin.dart'; // import '../../../model/token_folder.dart'; diff --git a/lib/views/main_view/main_view_widgets/token_widgets/day_password_token_widgets/day_password_token_widget_tile.dart b/lib/views/main_view/main_view_widgets/token_widgets/day_password_token_widgets/day_password_token_widget_tile.dart index 5583edd91..436f644cf 100644 --- a/lib/views/main_view/main_view_widgets/token_widgets/day_password_token_widgets/day_password_token_widget_tile.dart +++ b/lib/views/main_view/main_view_widgets/token_widgets/day_password_token_widgets/day_password_token_widget_tile.dart @@ -24,6 +24,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:intl/intl.dart'; +import '../../../../../../../utils/view_utils.dart'; import '../../../../../l10n/app_localizations.dart'; import '../../../../../model/enums/day_password_token_view_mode.dart'; import '../../../../../model/riverpod_states/settings_state.dart'; @@ -75,12 +76,7 @@ class _DayPasswordTokenWidgetTileState extends ConsumerState { globalRef?.read(disableCopyOtpProvider.notifier).state = true; Clipboard.setData(ClipboardData(text: widget.token.otpValue)); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(behavior: SnackBarBehavior.floating, content: Text(AppLocalizations.of(context)!.otpValueCopiedMessage(widget.token.otpValue))), - ); + showSnackBar(AppLocalizations.of(context)!.otpValueCopiedMessage(widget.token.otpValue)); Future.delayed(const Duration(seconds: 5), () => globalRef?.read(disableCopyOtpProvider.notifier).state = false); } 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 59556cc1c..6589d65f6 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 @@ -20,7 +20,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_zxing/flutter_zxing.dart'; -import 'package:privacyidea_authenticator/l10n/app_localizations.dart'; + +import '../../../../../../../l10n/app_localizations.dart'; class QRScannerWidget extends StatefulWidget { const QRScannerWidget({super.key}); diff --git a/lib/views/settings_view/settings_groups/import_export_tokens_widgets/dialogs/export_tokens_to_file_dialog.dart b/lib/views/settings_view/settings_groups/import_export_tokens_widgets/dialogs/export_tokens_to_file_dialog.dart index 90e863ba3..3c1b97a59 100644 --- a/lib/views/settings_view/settings_groups/import_export_tokens_widgets/dialogs/export_tokens_to_file_dialog.dart +++ b/lib/views/settings_view/settings_groups/import_export_tokens_widgets/dialogs/export_tokens_to_file_dialog.dart @@ -24,6 +24,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:path_provider/path_provider.dart'; +import '../../../../../../../utils/view_utils.dart'; import '../../../../../l10n/app_localizations.dart'; import '../../../../../mains/main_netknights.dart'; import '../../../../../model/tokens/token.dart'; @@ -171,8 +172,7 @@ class _ExportTokensToFileDialogState extends ConsumerState=3.0.0 < 4.0.0' dependencies: + app_links: ^6.3.2 + app_minimizer: ^1.0.0+3 + asn1lib: ^1.5.5 + async: ^2.11.0 + base32: ^2.1.3 + basic_utils: ^5.7.0 + collection: ^1.18.0 + connectivity_plus: ^6.1.0 + crypto: ^3.0.6 + cryptography: ^2.7.0 + device_info_plus: ^11.1.0 + easy_dynamic_theme: ^2.3.1 + encrypt: ^5.0.3 + expandable: ^5.0.1 + file_selector: ^1.0.3 + firebase_core: ^3.6.0 + firebase_messaging: ^15.1.3 + fixnum: ^1.1.1 + fluentui_system_icons: ^1.1.260 flutter: sdk: flutter + flutter_local_notifications: ^17.2.4 flutter_localizations: sdk: flutter - app_minimizer: ^1.0.0+2 - flutter_local_notifications: ^17.2.2 - home_widget: ^0.7.0 - image: ^4.1.6 - local_auth: ^2.1.6 - local_auth_android: ^1.0.37 - local_auth_darwin: ^1.2.2 - logger: ^2.0.0 - permission_handler: ^11.0.0 - pi_authenticator_legacy: - path: local_plugins/pi-authenticator-legacy - uuid: ^4.0.0 + flutter_mailer: ^2.1.2 + flutter_riverpod: ^2.6.1 + flutter_secure_storage: ^4.2.1 + flutter_slidable: ^3.1.1 flutter_svg: ^2.0.10+1 - freezed: ^2.5.7 - json_annotation: ^4.9.0 - # Crypto - mutex: ^3.0.0 + flutter_zxing: ^1.7.0 + font_awesome_flutter: ^10.7.0 + freezed_annotation: ^2.4.4 hex: ^0.2.0 - base32: ^2.1.1 - pointycastle: ^3.7.3 - asn1lib: ^1.5.0 - encrypt: ^5.0.3 - cryptography: ^2.7.0 - otp: ^3.0.1 - basic_utils: ^5.7.0 - # Storage - file_selector: ^1.0.2 - shared_preferences: ^2.2.0 - flutter_secure_storage: ^9.0.0 - # Info - package_info_plus: ^8.0.0 - device_info_plus: ^11.0.0 - # URI - app_links: ^6.1.1 - url_launcher: ^6.0.12 - http: ^1.2.0 - connectivity_plus: ^6.0.1 - flutter_mailer: ^2.1.1 - # Riverpod - flutter_riverpod: ^2.5.1 - flutterlifecyclehooks: ^5.0.0 - # Icons - lottie: ^3.0.0 - cupertino_icons: ^1.0.4 - fluentui_system_icons: ^1.1.223 - material_design_icons_flutter: ^7.0.7296 - # UI - easy_dynamic_theme: ^2.2.0 - flutter_slidable: ^3.0.0 - expandable: ^5.0.1 - camera: ^0.11.0 - firebase_messaging: ^15.0.2 - collection: ^1.18.0 - crypto: ^3.0.3 + home_widget: ^0.7.0 + http: ^1.2.2 + image: ^4.3.0 + image_cropper: ^8.0.2 + image_picker: ^1.1.2 intl: ^0.19.0 + json_annotation: ^4.9.0 + local_auth: ^2.3.0 + local_auth_android: ^1.0.46 + local_auth_darwin: ^1.4.1 + logger: ^2.4.0 + material_design_icons_flutter: ^7.0.7296 + mutex: ^3.1.0 + otp: ^3.1.4 + package_info_plus: ^8.1.0 + path_provider: ^2.1.4 + permission_handler: ^11.3.1 + pointycastle: ^3.9.1 protobuf: ^3.1.0 - firebase_core: ^3.1.1 + riverpod_annotation: ^2.6.1 + shared_preferences: ^2.3.2 simple_icons: ^10.1.3 - path_provider: ^2.1.2 - qr_flutter: ^4.1.0 - image_cropper: ^8.0.2 - riverpod_generator: ^2.4.0 - riverpod_annotation: ^2.3.5 - freezed_annotation: ^2.4.4 - async: ^2.11.0 - image_picker: ^1.1.2 - flutter_zxing: ^1.7.0 + url_launcher: ^6.3.1 + uuid: ^4.5.1 zxing2: ^0.2.3 - font_awesome_flutter: ^10.7.0 dev_dependencies: - flutter_driver: - sdk: flutter flutter_test: sdk: flutter integration_test: @@ -111,11 +94,9 @@ dev_dependencies: mockito: ^5.4.2 test: ^1.24.1 flutter_launcher_icons: ^0.14.1 - riverpod_lint: ^2.3.10 - custom_lint: ^0.6.4 - # dependencies to serialize objects to json build_runner: ^2.4.11 json_serializable: ^6.8.0 + dependency_validator: ^4.1.1 # For information on the generic Dart part of this file, see the diff --git a/test/unit_test/processors/token_import_file_processor/aegis_import_file_processor_test.dart b/test/unit_test/processors/token_import_file_processor/aegis_import_file_processor_test.dart index 52b990109..2825eff32 100644 --- a/test/unit_test/processors/token_import_file_processor/aegis_import_file_processor_test.dart +++ b/test/unit_test/processors/token_import_file_processor/aegis_import_file_processor_test.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:camera/camera.dart'; +import 'package:file_selector/file_selector.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:privacyidea_authenticator/model/processor_result.dart';