diff --git a/lib/api/token_container_api_endpoint.dart b/lib/api/privacy_idea_container_api.dart similarity index 92% rename from lib/api/token_container_api_endpoint.dart rename to lib/api/privacy_idea_container_api.dart index 7fa031921..b65ed0299 100644 --- a/lib/api/token_container_api_endpoint.dart +++ b/lib/api/privacy_idea_container_api.dart @@ -28,33 +28,24 @@ 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/errors.dart'; +import 'package:privacyidea_authenticator/model/exception_errors/localized_argument_error.dart'; import 'package:privacyidea_authenticator/utils/privacyidea_io_client.dart'; import '../model/api_results/pi_server_results/pi_server_result_value.dart'; +import '../model/exception_errors/response_error.dart'; import '../model/pi_server_response.dart'; import '../model/riverpod_states/token_state.dart'; -import '../model/token_template.dart'; import '../model/token_container.dart'; +import '../model/token_template.dart'; import '../model/tokens/token.dart'; import '../utils/globals.dart'; import '../utils/identifiers.dart'; import '../utils/logger.dart'; import '../widgets/dialog_widgets/enter_passphrase_dialog.dart'; -class PiSyncResponse { - final List updatedTokens; - final List deletedSerials; - - const PiSyncResponse({ - required this.updatedTokens, - required this.deletedSerials, - }); -} - -class PrivacyideaContainerApi { +class PrivacyIdeaContainerApi { final PrivacyideaIOClient _ioClient; - const PrivacyideaContainerApi({required PrivacyideaIOClient ioClient}) : _ioClient = ioClient; + const PrivacyIdeaContainerApi({required PrivacyideaIOClient ioClient}) : _ioClient = ioClient; // Returns a tuple of updated/new tokens and serials of deleted tokens Future<(List, List)?> sync(TokenContainerFinalized container, TokenState tokenState) async { @@ -289,23 +280,3 @@ class PrivacyideaContainerApi { return (mergedTemplatesWithSerial, deleteSerials); } } - -class ResponseError { - final int _statusCode; - int get statusCode => _statusCode; - final String _message; - String get message => _message.substring(0, _message.length > 100 ? 100 : _message.length); - String get fullMessage => _message; - - const ResponseError._(int statusCode, String message) - : _statusCode = statusCode, - _message = message; - - factory ResponseError(Response response) { - assert(response.statusCode != 200, 'Status code of an response error should not be 200'); - return ResponseError._(response.statusCode, response.body); - } - - @override - String toString() => '($statusCode) $message'; -} diff --git a/lib/model/api_results/pi_server_results/pi_server_result.dart b/lib/model/api_results/pi_server_results/pi_server_result.dart index 89764620b..953e90713 100644 --- a/lib/model/api_results/pi_server_results/pi_server_result.dart +++ b/lib/model/api_results/pi_server_results/pi_server_result.dart @@ -17,7 +17,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import 'pi_server_result_error.dart'; +import '../../exception_errors/pi_server_result_error.dart'; import 'pi_server_result_value.dart'; abstract class PiServerResult { diff --git a/lib/utils/errors.dart b/lib/model/exception_errors/localized_argument_error.dart similarity index 84% rename from lib/utils/errors.dart rename to lib/model/exception_errors/localized_argument_error.dart index 807a2a030..aad86605f 100644 --- a/lib/utils/errors.dart +++ b/lib/model/exception_errors/localized_argument_error.dart @@ -17,7 +17,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import '../l10n/app_localizations.dart'; +import '../../l10n/app_localizations.dart'; +import 'localized_exception.dart'; class LocalizedArgumentError extends LocalizedException implements ArgumentError { final String _invalidValue; @@ -60,13 +61,3 @@ class LocalizedArgumentError extends LocalizedException implements ArgumentError @override String toString() => 'ArgumentError: $message'; } - -class LocalizedException implements Exception { - final String Function(AppLocalizations localizations) localizedMessage; - final String unlocalizedMessage; - - const LocalizedException({required this.localizedMessage, required this.unlocalizedMessage}); - - @override - String toString() => 'Exception: $unlocalizedMessage'; -} diff --git a/lib/model/exception_errors/localized_exception.dart b/lib/model/exception_errors/localized_exception.dart new file mode 100644 index 000000000..ba821a06d --- /dev/null +++ b/lib/model/exception_errors/localized_exception.dart @@ -0,0 +1,31 @@ +/* + * 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 '../../l10n/app_localizations.dart'; + +class LocalizedException implements Exception { + final String Function(AppLocalizations localizations) localizedMessage; + final String unlocalizedMessage; + + const LocalizedException({required this.localizedMessage, required this.unlocalizedMessage}); + + @override + String toString() => 'Exception: $unlocalizedMessage'; +} diff --git a/lib/model/api_results/pi_server_results/pi_server_result_error.dart b/lib/model/exception_errors/pi_server_result_error.dart similarity index 94% rename from lib/model/api_results/pi_server_results/pi_server_result_error.dart rename to lib/model/exception_errors/pi_server_result_error.dart index 23eaf5fa9..746d91605 100644 --- a/lib/model/api_results/pi_server_results/pi_server_result_error.dart +++ b/lib/model/exception_errors/pi_server_result_error.dart @@ -19,8 +19,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import '../../../utils/object_validator.dart'; -import 'pi_server_result.dart'; +import '../../utils/object_validator.dart'; +import '../api_results/pi_server_results/pi_server_result.dart'; class PiServerResultError extends PiServerResult implements Error { static const CODE = 'code'; diff --git a/lib/model/exception_errors/response_error.dart b/lib/model/exception_errors/response_error.dart new file mode 100644 index 000000000..3e4a2b1f0 --- /dev/null +++ b/lib/model/exception_errors/response_error.dart @@ -0,0 +1,37 @@ +/* + * 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:http/http.dart'; + +class ResponseError { + final int _statusCode; + int get statusCode => _statusCode; + final String _message; + String get message => _message.substring(0, _message.length > 100 ? 100 : _message.length); + String get fullMessage => _message; + + const ResponseError._(int statusCode, String message) + : _statusCode = statusCode, + _message = message; + + factory ResponseError(Response response) { + assert(response.statusCode != 200, 'Status code of an response error should not be 200'); + return ResponseError._(response.statusCode, response.body); + } +} diff --git a/lib/model/pi_server_response.dart b/lib/model/pi_server_response.dart index 1b29434ba..27fd9dac8 100644 --- a/lib/model/pi_server_response.dart +++ b/lib/model/pi_server_response.dart @@ -26,7 +26,7 @@ import 'package:http/http.dart'; import '../utils/logger.dart'; import '../utils/object_validator.dart'; -import 'api_results/pi_server_results/pi_server_result_error.dart'; +import 'exception_errors/pi_server_result_error.dart'; import 'api_results/pi_server_results/pi_server_result_value.dart'; part 'pi_server_response.freezed.dart'; diff --git a/lib/model/riverpod_states/token_container_state.dart b/lib/model/riverpod_states/token_container_state.dart index b7aebe0f5..9dfab0929 100644 --- a/lib/model/riverpod_states/token_container_state.dart +++ b/lib/model/riverpod_states/token_container_state.dart @@ -21,7 +21,9 @@ import 'dart:convert'; import 'package:collection/collection.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:privacyidea_authenticator/model/tokens/token.dart'; +import '../enums/sync_state.dart'; import '../token_container.dart'; part 'token_container_state.freezed.dart'; @@ -51,4 +53,12 @@ class TokenContainerState with _$TokenContainerState { TokenContainer? ofSerial(String serial) => containerList.firstWhereOrNull((container) => container.serial == serial); factory TokenContainerState.fromJson(Map json) => _$TokenContainerStateFromJson(json); + + SyncState? getSyncState(Token token) { + if (token.containerSerial == null) return null; + final container = containerOf(token.containerSerial!); + if (container == null) return null; + if (container is TokenContainerFinalized) return container.syncState; + return null; + } } diff --git a/lib/model/token_container.dart b/lib/model/token_container.dart index d983ac2bd..4d762bada 100644 --- a/lib/model/token_container.dart +++ b/lib/model/token_container.dart @@ -30,8 +30,8 @@ import 'package:privacyidea_authenticator/utils/identifiers.dart'; import '../utils/ecc_utils.dart'; import '../utils/logger.dart'; import '../utils/object_validator.dart'; -import 'enums/rollout_state.dart'; import 'enums/ec_key_algorithm.dart'; +import 'enums/rollout_state.dart'; import 'enums/sync_state.dart'; import 'enums/token_origin_source_type.dart'; import 'token_import/token_origin_data.dart'; diff --git a/lib/model/tokens/day_password_token.dart b/lib/model/tokens/day_password_token.dart index 18ee45ea2..91a9ff1ab 100644 --- a/lib/model/tokens/day_password_token.dart +++ b/lib/model/tokens/day_password_token.dart @@ -20,16 +20,16 @@ import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; -import '../../utils/identifiers.dart'; -import '../../utils/object_validator.dart'; -import '../token_template.dart'; import 'package:uuid/uuid.dart'; +import '../../utils/identifiers.dart'; +import '../../utils/object_validator.dart'; import '../enums/algorithms.dart'; import '../enums/day_password_token_view_mode.dart'; import '../enums/token_types.dart'; import '../extensions/enums/algorithms_extension.dart'; import '../token_import/token_origin_data.dart'; +import '../token_template.dart'; import 'otp_token.dart'; import 'token.dart'; diff --git a/lib/model/tokens/otp_token.dart b/lib/model/tokens/otp_token.dart index c1f6e0715..0fdd2dc68 100644 --- a/lib/model/tokens/otp_token.dart +++ b/lib/model/tokens/otp_token.dart @@ -22,9 +22,9 @@ import 'dart:convert'; import '../../utils/identifiers.dart'; import '../../utils/logger.dart'; import '../enums/algorithms.dart'; -import '../token_template.dart'; -import '../token_import/token_origin_data.dart'; import '../token_container.dart'; +import '../token_import/token_origin_data.dart'; +import '../token_template.dart'; import 'token.dart'; abstract class OTPToken extends Token { diff --git a/lib/model/tokens/push_token.dart b/lib/model/tokens/push_token.dart index 952064dcf..e4314432f 100644 --- a/lib/model/tokens/push_token.dart +++ b/lib/model/tokens/push_token.dart @@ -25,14 +25,14 @@ import 'package:privacyidea_authenticator/model/token_template.dart'; import 'package:uuid/uuid.dart'; import '../../utils/custom_int_buffer.dart'; -import '../../utils/errors.dart'; +import '../exception_errors/localized_argument_error.dart'; import '../../utils/identifiers.dart'; import '../../utils/object_validator.dart'; import '../../utils/rsa_utils.dart'; import '../enums/push_token_rollout_state.dart'; import '../enums/token_types.dart'; -import '../token_import/token_origin_data.dart'; import '../token_container.dart'; +import '../token_import/token_origin_data.dart'; import 'token.dart'; part 'push_token.g.dart'; diff --git a/lib/model/tokens/token.dart b/lib/model/tokens/token.dart index 495fca65f..f9d75bbd8 100644 --- a/lib/model/tokens/token.dart +++ b/lib/model/tokens/token.dart @@ -21,14 +21,14 @@ */ import 'package:flutter/material.dart'; import 'package:privacyidea_authenticator/model/token_container.dart'; -import '../../utils/object_validator.dart'; -import '../token_template.dart'; import '../../utils/identifiers.dart'; +import '../../utils/object_validator.dart'; import '../enums/token_types.dart'; import '../extensions/enum_extension.dart'; import '../mixins/sortable_mixin.dart'; import '../token_import/token_origin_data.dart'; +import '../token_template.dart'; import 'day_password_token.dart'; import 'hotp_token.dart'; import 'push_token.dart'; diff --git a/lib/processors/scheme_processors/token_container_processor.dart b/lib/processors/scheme_processors/token_container_processor.dart index 23441c7a1..7fffe1b7c 100644 --- a/lib/processors/scheme_processors/token_container_processor.dart +++ b/lib/processors/scheme_processors/token_container_processor.dart @@ -18,7 +18,7 @@ * limitations under the License. */ import 'package:privacyidea_authenticator/l10n/app_localizations.dart'; -import 'package:privacyidea_authenticator/utils/errors.dart'; +import 'package:privacyidea_authenticator/model/exception_errors/localized_argument_error.dart'; import 'package:privacyidea_authenticator/utils/globals.dart'; import '../../model/processor_result.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 1d1ca3b95..41019cef1 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,11 +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_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 '../../utils/errors.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/authenticator_pro_import_file_processor.dart b/lib/processors/token_import_file_processor/authenticator_pro_import_file_processor.dart index bcdec348a..a61f4878c 100644 --- a/lib/processors/token_import_file_processor/authenticator_pro_import_file_processor.dart +++ b/lib/processors/token_import_file_processor/authenticator_pro_import_file_processor.dart @@ -29,13 +29,13 @@ import '../../model/encryption/uint_8_buffer.dart'; import '../../model/enums/algorithms.dart'; import '../../model/enums/token_origin_source_type.dart'; import '../../model/enums/token_types.dart'; +import '../../model/exception_errors/localized_exception.dart'; import '../../model/extensions/enums/token_origin_source_type.dart'; import '../../model/processor_result.dart'; import '../../model/tokens/token.dart'; import '../../processors/scheme_processors/token_import_scheme_processors/otp_auth_processor.dart'; import '../../processors/token_import_file_processor/two_fas_import_file_processor.dart'; import '../../utils/encryption/aes_encrypted.dart'; -import '../../utils/errors.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 108372580..6801605e7 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 @@ -28,10 +28,10 @@ import 'package:privacyidea_authenticator/model/extensions/enums/encodings_exten import '../../l10n/app_localizations.dart'; import '../../model/enums/token_origin_source_type.dart'; +import '../../model/exception_errors/localized_exception.dart'; import '../../model/extensions/enums/token_origin_source_type.dart'; import '../../model/processor_result.dart'; import '../../model/tokens/token.dart'; -import '../../utils/errors.dart'; import '../../utils/globals.dart'; import '../../utils/identifiers.dart'; import '../../utils/logger.dart'; diff --git a/lib/processors/token_import_file_processor/two_fas_import_file_processor.dart b/lib/processors/token_import_file_processor/two_fas_import_file_processor.dart index f61104a8a..1ee4f4f6b 100644 --- a/lib/processors/token_import_file_processor/two_fas_import_file_processor.dart +++ b/lib/processors/token_import_file_processor/two_fas_import_file_processor.dart @@ -26,11 +26,11 @@ import 'package:file_selector/file_selector.dart'; import '../../l10n/app_localizations.dart'; import '../../model/enums/token_origin_source_type.dart'; +import '../../model/exception_errors/localized_exception.dart'; import '../../model/extensions/enums/token_origin_source_type.dart'; import '../../model/processor_result.dart'; import '../../model/tokens/token.dart'; import '../../utils/encryption/aes_encrypted.dart'; -import '../../utils/errors.dart'; import '../../utils/globals.dart'; import '../../utils/identifiers.dart'; import '../../utils/logger.dart'; diff --git a/lib/utils/customization/theme_customization.dart b/lib/utils/customization/theme_customization.dart index 86bd190be..305a8cc02 100644 --- a/lib/utils/customization/theme_customization.dart +++ b/lib/utils/customization/theme_customization.dart @@ -21,8 +21,9 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:privacyidea_authenticator/model/extensions/color_extension.dart'; -import 'theme_extentions/elevated_delete_button_theme.dart'; + import 'theme_extentions/action_theme.dart'; +import 'theme_extentions/elevated_delete_button_theme.dart'; import 'theme_extentions/extended_text_theme.dart'; import 'theme_extentions/push_request_theme.dart'; diff --git a/lib/utils/default_inkwell.dart b/lib/utils/default_inkwell.dart new file mode 100644 index 000000000..09f7b9655 --- /dev/null +++ b/lib/utils/default_inkwell.dart @@ -0,0 +1,53 @@ +/* + * 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'; + +class DefaultInkWell extends StatelessWidget { + final Widget child; + final VoidCallback? onTap; + final bool highlight; + + const DefaultInkWell({ + required this.child, + this.highlight = false, + this.onTap, + super.key, + }); + + @override + Widget build(BuildContext context) => Material( + // Material to draw on for the InkWell + color: Colors.transparent, + child: Container( + decoration: BoxDecoration( + color: highlight ? Theme.of(context).dividerColor : null, + borderRadius: const BorderRadius.all(Radius.circular(4)), + ), + child: InkWell( + customBorder: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(4)), + ), + onTap: onTap, + child: child, + ), + ), + ); +} diff --git a/lib/utils/object_validator.dart b/lib/utils/object_validator.dart index 2ef41e337..a5f0fcd9d 100644 --- a/lib/utils/object_validator.dart +++ b/lib/utils/object_validator.dart @@ -22,7 +22,7 @@ import 'package:privacyidea_authenticator/model/extensions/enums/encodings_exten import '../model/enums/algorithms.dart'; import '../model/enums/encodings.dart'; -import 'errors.dart'; +import '../model/exception_errors/localized_argument_error.dart'; import 'logger.dart'; final otpAutjPeriodSecondsValidatorNullable = otpAutjPeriodSecondsValidator.nullable(); 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 e5529b7f6..53f29992d 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,7 +23,7 @@ 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/api_results/pi_server_results/pi_server_result_error.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'; @@ -34,12 +34,13 @@ import 'package:privacyidea_authenticator/utils/riverpod/riverpod_providers/stat import 'package:privacyidea_authenticator/utils/view_utils.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; -import '../../../../api/token_container_api_endpoint.dart'; +import '../../../../api/privacy_idea_container_api.dart'; import '../../../../interfaces/repo/token_container_repository.dart'; import '../../../../l10n/app_localizations.dart'; import '../../../../model/api_results/pi_server_results/pi_server_result_value.dart'; import '../../../../model/enums/rollout_state.dart'; import '../../../../model/enums/sync_state.dart'; +import '../../../../model/exception_errors/response_error.dart'; import '../../../../model/pi_server_response.dart'; import '../../../../model/riverpod_states/token_container_state.dart'; import '../../../../model/riverpod_states/token_state.dart'; @@ -48,14 +49,14 @@ import '../../../../repo/secure_token_container_repository.dart'; import '../../../../widgets/dialog_widgets/add_container_progress_dialog.dart'; import '../../../../widgets/dialog_widgets/container_already_exists_dialog.dart'; import '../../../ecc_utils.dart'; -import '../../../errors.dart'; +import '../../../../model/exception_errors/localized_argument_error.dart'; import '../../../logger.dart'; part 'token_container_notifier.g.dart'; final tokenContainerProvider = tokenContainerNotifierProviderOf( repo: SecureTokenContainerRepository(), - containerApi: const PrivacyideaContainerApi(ioClient: PrivacyideaIOClient()), + containerApi: const PrivacyIdeaContainerApi(ioClient: PrivacyideaIOClient()), eccUtils: const EccUtils(), ); @@ -66,7 +67,7 @@ class TokenContainerNotifier extends _$TokenContainerNotifier with ResultHandler TokenContainerNotifier({ TokenContainerRepository? repoOverride, - PrivacyideaContainerApi? containerApiOverride, + PrivacyIdeaContainerApi? containerApiOverride, EccUtils? eccUtilsOverride, }) : _repoOverride = repoOverride, _containerApiOverride = containerApiOverride, @@ -78,9 +79,9 @@ class TokenContainerNotifier extends _$TokenContainerNotifier with ResultHandler final TokenContainerRepository? _repoOverride; @override - PrivacyideaContainerApi get containerApi => _containerApi; - late PrivacyideaContainerApi _containerApi; - final PrivacyideaContainerApi? _containerApiOverride; + PrivacyIdeaContainerApi get containerApi => _containerApi; + late PrivacyIdeaContainerApi _containerApi; + final PrivacyIdeaContainerApi? _containerApiOverride; @override EccUtils get eccUtils => _eccUtils; @@ -90,7 +91,7 @@ class TokenContainerNotifier extends _$TokenContainerNotifier with ResultHandler @override Future build({ required TokenContainerRepository repo, - required PrivacyideaContainerApi containerApi, + required PrivacyIdeaContainerApi containerApi, required EccUtils eccUtils, }) async { await _stateMutex.acquire(); diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.g.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.g.dart index f23c37b04..b52282505 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.g.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.g.dart @@ -7,7 +7,7 @@ part of 'token_container_notifier.dart'; // ************************************************************************** String _$tokenContainerNotifierHash() => - r'82e22b1c0f547326b3066410d429cd814b5897b6'; + r'ce579b9e2f02bf34af021a6bcb567f0889f8f5ed'; /// Copied from Dart SDK class _SystemHash { @@ -33,12 +33,12 @@ class _SystemHash { abstract class _$TokenContainerNotifier extends BuildlessAsyncNotifier { late final TokenContainerRepository repo; - late final PrivacyideaContainerApi containerApi; + late final PrivacyIdeaContainerApi containerApi; late final EccUtils eccUtils; FutureOr build({ required TokenContainerRepository repo, - required PrivacyideaContainerApi containerApi, + required PrivacyIdeaContainerApi containerApi, required EccUtils eccUtils, }); } @@ -56,7 +56,7 @@ class TokenContainerNotifierFamily /// See also [TokenContainerNotifier]. TokenContainerNotifierProvider call({ required TokenContainerRepository repo, - required PrivacyideaContainerApi containerApi, + required PrivacyIdeaContainerApi containerApi, required EccUtils eccUtils, }) { return TokenContainerNotifierProvider( @@ -98,7 +98,7 @@ class TokenContainerNotifierProvider extends AsyncNotifierProviderImpl< /// See also [TokenContainerNotifier]. TokenContainerNotifierProvider({ required TokenContainerRepository repo, - required PrivacyideaContainerApi containerApi, + required PrivacyIdeaContainerApi containerApi, required EccUtils eccUtils, }) : this._internal( () => TokenContainerNotifier() @@ -132,7 +132,7 @@ class TokenContainerNotifierProvider extends AsyncNotifierProviderImpl< }) : super.internal(); final TokenContainerRepository repo; - final PrivacyideaContainerApi containerApi; + final PrivacyIdeaContainerApi containerApi; final EccUtils eccUtils; @override @@ -198,7 +198,7 @@ mixin TokenContainerNotifierRef TokenContainerRepository get repo; /// The parameter `containerApi` of this provider. - PrivacyideaContainerApi get containerApi; + PrivacyIdeaContainerApi get containerApi; /// The parameter `eccUtils` of this provider. EccUtils get eccUtils; @@ -213,7 +213,7 @@ class _TokenContainerNotifierProviderElement TokenContainerRepository get repo => (origin as TokenContainerNotifierProvider).repo; @override - PrivacyideaContainerApi get containerApi => + PrivacyIdeaContainerApi get containerApi => (origin as TokenContainerNotifierProvider).containerApi; @override EccUtils get eccUtils => (origin as TokenContainerNotifierProvider).eccUtils; 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 c07165b04..84d52afad 100644 --- a/lib/views/import_tokens_view/pages/import_start_page.dart +++ b/lib/views/import_tokens_view/pages/import_start_page.dart @@ -21,8 +21,8 @@ import 'package:file_selector/file_selector.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_zxing/flutter_zxing.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'; 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 94ddbc4aa..50c4f0472 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 @@ -28,8 +28,8 @@ import '../../../../model/token_folder.dart'; import '../../../../utils/globals.dart'; import '../../../../utils/riverpod/riverpod_providers/generated_providers/token_folder_notifier.dart'; import '../../../../utils/riverpod/riverpod_providers/state_providers/dragging_sortable_provider.dart'; -import 'token_folder_expandable_widgets/token_folder_expandable_header.dart'; import 'token_folder_expandable_widgets/token_folder_expandable_body.dart'; +import 'token_folder_expandable_widgets/token_folder_expandable_header.dart'; class TokenFolderExpandable extends ConsumerStatefulWidget { final TokenFolder folder; 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 b8f16535c..5bbf55dba 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,6 +22,7 @@ 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 '../../../../../l10n/app_localizations.dart'; @@ -162,40 +163,3 @@ class _TokenFolderExpandableHeaderState extends ConsumerState asd = [5]; - asd.cast(); - - return Material( - // Material to draw on for the InkWell - color: Colors.transparent, - child: Container( - decoration: BoxDecoration( - color: highlight ? Theme.of(context).dividerColor : null, - borderRadius: const BorderRadius.all(Radius.circular(4)), - ), - child: InkWell( - customBorder: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(4)), - ), - onTap: onTap, - child: child, - ), - ), - ); - } -} 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 08b403951..0fd5dc6cd 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 @@ -26,7 +26,6 @@ import '../../../utils/riverpod/riverpod_providers/generated_providers/token_fol import '../../../utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart'; import '../../../utils/riverpod/riverpod_providers/state_providers/dragging_sortable_provider.dart'; import '../../../utils/riverpod/riverpod_providers/state_providers/token_filter_provider.dart'; - import 'main_view_tokens_list.dart'; class MainViewTokensListFiltered extends ConsumerWidget { diff --git a/lib/views/settings_view/settings_groups/settings_group_language.dart b/lib/views/settings_view/settings_groups/settings_group_language.dart index d8f0f1d02..515ebc962 100644 --- a/lib/views/settings_view/settings_groups/settings_group_language.dart +++ b/lib/views/settings_view/settings_groups/settings_group_language.dart @@ -24,7 +24,6 @@ import 'package:privacyidea_authenticator/widgets/dialog_widgets/default_dialog. import '../../../l10n/app_localizations.dart'; import '../../../utils/riverpod/riverpod_providers/generated_providers/settings_notifier.dart'; - import '../settings_view_widgets/settings_group.dart'; class SettingsGroupLanguage extends ConsumerWidget { diff --git a/lib/widgets/button_widgets/countdown_button.dart b/lib/widgets/button_widgets/countdown_button.dart index 20c1ace16..248272b91 100644 --- a/lib/widgets/button_widgets/countdown_button.dart +++ b/lib/widgets/button_widgets/countdown_button.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import '../pi_circular_progress_indicator.dart'; class CountdownButton extends StatefulWidget { diff --git a/lib/widgets/default_refresh_indicator.dart b/lib/widgets/default_refresh_indicator.dart index d9fb0b82a..8e3a2741f 100644 --- a/lib/widgets/default_refresh_indicator.dart +++ b/lib/widgets/default_refresh_indicator.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import '../utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart'; import '../utils/push_provider.dart'; import '../utils/riverpod/riverpod_providers/generated_providers/token_container_notifier.dart'; +import '../utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart'; import '../views/main_view/main_view_widgets/loading_indicator.dart'; import 'deactivateable_refresh_indicator.dart';