diff --git a/lib/mains/main_customizer.dart b/lib/mains/main_customizer.dart index dcbec33c..aafa3b85 100644 --- a/lib/mains/main_customizer.dart +++ b/lib/mains/main_customizer.dart @@ -82,13 +82,13 @@ class CustomizationAuthenticator extends ConsumerWidget { FeedbackView.routeName: (context) => const FeedbackView(), ImportTokensView.routeName: (context) => const ImportTokensView(), LicenseView.routeName: (context) => LicenseView( - appImage: applicationCustomizer.licensesViewImage.getWidget, + appImage: applicationCustomizer.licensesViewImage?.getWidget ?? applicationCustomizer.splashScreenImage.getWidget, appName: applicationCustomizer.appName, websiteLink: applicationCustomizer.websiteLink, ), MainView.routeName: (context) => MainView( - appIcon: applicationCustomizer.appbarIcon.getWidget, - appImage: applicationCustomizer.splashScreenImage.getWidget, + appbarIcon: applicationCustomizer.appbarIcon.getWidget, + backgroundImage: applicationCustomizer.backgroundImage?.getWidget, appName: applicationCustomizer.appName, disablePatchNotes: applicationCustomizer.disabledFeatures.contains(AppFeature.patchNotes), ), diff --git a/lib/mains/main_netknights.dart b/lib/mains/main_netknights.dart index 46db0960..abae2b43 100644 --- a/lib/mains/main_netknights.dart +++ b/lib/mains/main_netknights.dart @@ -104,13 +104,13 @@ class PrivacyIDEAAuthenticator extends ConsumerWidget { FeedbackView.routeName: (context) => const FeedbackView(), ImportTokensView.routeName: (context) => const ImportTokensView(), LicenseView.routeName: (context) => LicenseView( - appImage: _customization.licensesViewImage.getWidget, + appImage: _customization.licensesViewImage?.getWidget ?? _customization.splashScreenImage.getWidget, appName: _customization.appName, websiteLink: _customization.websiteLink, ), MainView.routeName: (context) => MainView( - appIcon: _customization.appbarIcon.getWidget, - appImage: _customization.splashScreenImage.getWidget, + appbarIcon: _customization.appbarIcon.getWidget, + backgroundImage: _customization.backgroundImage?.getWidget, appName: _customization.appName, disablePatchNotes: _customization.disabledFeatures.contains(AppFeature.patchNotes), ), diff --git a/lib/model/enums/image_file_type.dart b/lib/model/enums/image_file_type.dart index 181b4673..152e5a84 100644 --- a/lib/model/enums/image_file_type.dart +++ b/lib/model/enums/image_file_type.dart @@ -19,7 +19,7 @@ */ // Do not rename or remove values, they are used for serialization. Only add new values. -enum ImageFileType { +enum ImageFormat { svg, svgz, png, diff --git a/lib/model/extensions/enums/image_file_type_extension.dart b/lib/model/extensions/enums/image_file_type_extension.dart index 27e3a46f..62fb782b 100644 --- a/lib/model/extensions/enums/image_file_type_extension.dart +++ b/lib/model/extensions/enums/image_file_type_extension.dart @@ -25,55 +25,55 @@ import 'package:image_picker/image_picker.dart'; import '../../enums/image_file_type.dart'; -extension ImageFileTypeX on ImageFileType { - static ImageFileType fromExtensionString(String ex) => switch (ex) { - 'svg' => ImageFileType.svg, - 'svgz' => ImageFileType.svgz, - 'png' => ImageFileType.png, - 'jpg' => ImageFileType.jpg, - 'jpeg' => ImageFileType.jpeg, - 'gif' => ImageFileType.gif, - 'bmp' => ImageFileType.bmp, - 'webp' => ImageFileType.webp, +extension ImageFileTypeX on ImageFormat { + static ImageFormat fromExtensionString(String ex) => switch (ex) { + 'svg' => ImageFormat.svg, + 'svgz' => ImageFormat.svgz, + 'png' => ImageFormat.png, + 'jpg' => ImageFormat.jpg, + 'jpeg' => ImageFormat.jpeg, + 'gif' => ImageFormat.gif, + 'bmp' => ImageFormat.bmp, + 'webp' => ImageFormat.webp, _ => throw Exception('Unknown extension: $ex'), }; Widget buildImageWidget(Uint8List imageData) => switch (this) { - ImageFileType.svg => SvgPicture.memory( + ImageFormat.svg => SvgPicture.memory( imageData, colorFilter: ColorFilter.mode( Colors.transparent, BlendMode.srcOver, ), ), - ImageFileType.svgz => SvgPicture.memory( + ImageFormat.svgz => SvgPicture.memory( imageData, colorFilter: ColorFilter.mode( Colors.transparent, BlendMode.srcOver, ), ), - ImageFileType.png => Image.memory( + ImageFormat.png => Image.memory( imageData, colorBlendMode: BlendMode.srcOver, ), - ImageFileType.jpg => Image.memory( + ImageFormat.jpg => Image.memory( imageData, colorBlendMode: BlendMode.srcOver, ), - ImageFileType.jpeg => Image.memory( + ImageFormat.jpeg => Image.memory( imageData, colorBlendMode: BlendMode.srcOver, ), - ImageFileType.gif => Image.memory( + ImageFormat.gif => Image.memory( imageData, colorBlendMode: BlendMode.srcOver, ), - ImageFileType.bmp => Image.memory( + ImageFormat.bmp => Image.memory( imageData, colorBlendMode: BlendMode.srcOver, ), - ImageFileType.webp => Image.memory( + ImageFormat.webp => Image.memory( imageData, colorBlendMode: BlendMode.srcOver, ), @@ -81,30 +81,33 @@ extension ImageFileTypeX on ImageFileType { String get extension => toString().split('.').last; - String get typeName => switch (this) { - ImageFileType.svg => 'Scalable Vector Graphic', - ImageFileType.svgz => 'Scalable Vector Graphic (compressed)', - ImageFileType.png => 'PNG', - ImageFileType.jpg => 'JPEG', - ImageFileType.jpeg => 'JPEG', - ImageFileType.gif => 'GIF', - ImageFileType.bmp => 'Bitmap', - ImageFileType.webp => 'WebP', + String get name => switch (this) { + ImageFormat.svg => 'Scalable Vector Graphic', + ImageFormat.svgz => 'Scalable Vector Graphic (compressed)', + ImageFormat.png => 'PNG', + ImageFormat.jpg => 'JPEG', + ImageFormat.jpeg => 'JPEG', + ImageFormat.gif => 'GIF', + ImageFormat.bmp => 'Bitmap', + ImageFormat.webp => 'WebP', }; String get mimeType => switch (this) { - ImageFileType.svg => 'image/svg+xml', - ImageFileType.svgz => 'image/svg+xml', - ImageFileType.png => 'image/png', - ImageFileType.jpg => 'image/jpeg', - ImageFileType.jpeg => 'image/jpeg', - ImageFileType.gif => 'image/gif', - ImageFileType.bmp => 'image/bmp', - ImageFileType.webp => 'image/webp', + ImageFormat.svg => 'image/svg+xml', + ImageFormat.svgz => 'image/svg+xml', + ImageFormat.png => 'image/png', + ImageFormat.jpg => 'image/jpeg', + ImageFormat.jpeg => 'image/jpeg', + ImageFormat.gif => 'image/gif', + ImageFormat.bmp => 'image/bmp', + ImageFormat.webp => 'image/webp', }; /// Builds an [XFile] from the given [imageData] and [fileName]. /// The [fileName] is used as the name of the file. - /// The file extension is determined by the [ImageFileType]. + /// The file extension is determined by the [ImageFormat]. XFile buildXFile(Uint8List imageData, String fileName) => XFile.fromData(imageData, name: "$fileName.$extension"); + + /// Compares the given [extension] with the extension of this [ImageFormat] case-insensitive. + bool matches(String extension) => extension.toLowerCase() == this.extension.toLowerCase(); } diff --git a/lib/model/riverpod_states/introduction_state.dart b/lib/model/riverpod_states/introduction_state.dart index b6b4ea5f..8871ea2a 100644 --- a/lib/model/riverpod_states/introduction_state.dart +++ b/lib/model/riverpod_states/introduction_state.dart @@ -46,11 +46,23 @@ class IntroductionState with _$IntroductionState { return IntroductionState(completedIntroductions: newCompletedIntroductions); } + IntroductionState withCompletedIntroductions(List values) { + final newCompletedIntroductions = {...completedIntroductions}; + newCompletedIntroductions.addAll(values); + return IntroductionState(completedIntroductions: newCompletedIntroductions); + } + IntroductionState withoutCompletedIntroduction(Introduction introduction) { final newCompletedIntroductions = {...completedIntroductions}; newCompletedIntroductions.remove(introduction); return IntroductionState(completedIntroductions: newCompletedIntroductions); } + IntroductionState withoutCompletedIntroductions(List values) { + final newCompletedIntroductions = {...completedIntroductions}; + newCompletedIntroductions.removeAll(values); + return IntroductionState(completedIntroductions: newCompletedIntroductions); + } + factory IntroductionState.fromJson(Map json) => _$IntroductionStateFromJson(json); } diff --git a/lib/model/widget_image.dart b/lib/model/widget_image.dart index 0c922432..4b74851d 100644 --- a/lib/model/widget_image.dart +++ b/lib/model/widget_image.dart @@ -44,27 +44,27 @@ class Uint8ListConverter implements JsonConverter { @JsonSerializable() @Uint8ListConverter() class WidgetImage { - final ImageFileType fileType; + final ImageFormat imageFormat; final Uint8List imageData; final String fileName; - String get fullFileName => '$fileName.${fileType.extension}'; + String get fullFileName => '$fileName.${imageFormat.extension}'; WidgetImage({ required this.fileName, - required this.fileType, + required this.imageFormat, required this.imageData, }); @override String toString() { - return 'WidgetImage(fileName: $fileName, fileType: $fileType, imageData: $imageData)'; + return 'WidgetImage(fileName: $fileName, imageFormat: $imageFormat, imageData: $imageData)'; } @override - bool operator ==(Object other) => other is WidgetImage && other.fileType == fileType && other.imageData == imageData; + bool operator ==(Object other) => other is WidgetImage && other.imageFormat == imageFormat && other.imageData == imageData; @override - int get hashCode => Object.hash(runtimeType, fileType, imageData); + int get hashCode => Object.hash(runtimeType, imageFormat, imageData); Widget? _widget; Widget get getWidget { @@ -75,9 +75,9 @@ class WidgetImage { Widget _buildImageWidget() { try { - return fileType.buildImageWidget(imageData); + return imageFormat.buildImageWidget(imageData); } catch (e) { - Logger.error('Image is not an ${fileType.typeName}, or the image data is corrupted.', error: e); + Logger.error('Image is not an ${imageFormat.name}, or the image data is corrupted.', error: e); rethrow; } } @@ -86,6 +86,6 @@ class WidgetImage { Map toJson() => _$WidgetImageToJson(this); XFile? toXFile() { - return fileType.buildXFile(imageData, fileName); + return imageFormat.buildXFile(imageData, fileName); } } diff --git a/lib/model/widget_image.g.dart b/lib/model/widget_image.g.dart index d1d939d5..0f545095 100644 --- a/lib/model/widget_image.g.dart +++ b/lib/model/widget_image.g.dart @@ -7,26 +7,24 @@ part of 'widget_image.dart'; // ************************************************************************** WidgetImage _$WidgetImageFromJson(Map json) => WidgetImage( - fileType: $enumDecode(_$ImageFileTypeEnumMap, json['fileType']), - imageData: - const Uint8ListConverter().fromJson(json['imageData'] as String), + imageFormat: $enumDecode(_$ImageFileTypeEnumMap, json['fileType']), + imageData: const Uint8ListConverter().fromJson(json['imageData'] as String), fileName: json['fileName'] as String, ); -Map _$WidgetImageToJson(WidgetImage instance) => - { - 'fileType': _$ImageFileTypeEnumMap[instance.fileType]!, +Map _$WidgetImageToJson(WidgetImage instance) => { + 'fileType': _$ImageFileTypeEnumMap[instance.imageFormat]!, 'imageData': const Uint8ListConverter().toJson(instance.imageData), 'fileName': instance.fileName, }; const _$ImageFileTypeEnumMap = { - ImageFileType.svg: 'svg', - ImageFileType.svgz: 'svgz', - ImageFileType.png: 'png', - ImageFileType.jpg: 'jpg', - ImageFileType.jpeg: 'jpeg', - ImageFileType.gif: 'gif', - ImageFileType.bmp: 'bmp', - ImageFileType.webp: 'webp', + ImageFormat.svg: 'svg', + ImageFormat.svgz: 'svgz', + ImageFormat.png: 'png', + ImageFormat.jpg: 'jpg', + ImageFormat.jpeg: 'jpeg', + ImageFormat.gif: 'gif', + ImageFormat.bmp: 'bmp', + ImageFormat.webp: 'webp', }; diff --git a/lib/utils/customization/application_customization.dart b/lib/utils/customization/application_customization.dart index 3cde0e8f..1854f018 100644 --- a/lib/utils/customization/application_customization.dart +++ b/lib/utils/customization/application_customization.dart @@ -82,9 +82,9 @@ class ApplicationCustomization { static const String appbarIconFileName = 'appbar_icon'; final WidgetImage splashScreenImage; static const String splashScreenImageFileName = 'splash_screen_image'; - final WidgetImage backgroundImage; + final WidgetImage? backgroundImage; static const String backgroundImageFileName = 'background_image'; - final WidgetImage licensesViewImage; + final WidgetImage? licensesViewImage; static const String licensesViewImageFileName = 'licenses_view_image'; final ThemeCustomization lightTheme; @@ -102,17 +102,17 @@ class ApplicationCustomization { this.customFontBytes, WidgetImage? appbarIcon, WidgetImage? splashScreenImage, - WidgetImage? backgroundImage, - WidgetImage? licensesViewImage, + WidgetImage? Function()? backgroundImage, + this.licensesViewImage, this.lightTheme = ThemeCustomization.defaultLightTheme, this.darkTheme = ThemeCustomization.defaultDarkTheme, this.disabledFeatures = const {}, - }) : appbarIcon = appbarIcon ?? WidgetImage(fileType: ImageFileType.png, imageData: defaultIconUint8List, fileName: appbarIconFileName), + }) : appbarIcon = appbarIcon ?? WidgetImage(imageFormat: ImageFormat.png, imageData: defaultIconUint8List, fileName: appbarIconFileName), splashScreenImage = - splashScreenImage ?? WidgetImage(fileType: ImageFileType.png, imageData: defaultImageUint8List, fileName: splashScreenImageFileName), - backgroundImage = backgroundImage ?? WidgetImage(fileType: ImageFileType.png, imageData: defaultImageUint8List, fileName: backgroundImageFileName), - licensesViewImage = - licensesViewImage ?? WidgetImage(fileType: ImageFileType.png, imageData: defaultImageUint8List, fileName: licensesViewImageFileName); + splashScreenImage ?? WidgetImage(imageFormat: ImageFormat.png, imageData: defaultImageUint8List, fileName: splashScreenImageFileName), + backgroundImage = backgroundImage != null + ? backgroundImage() + : WidgetImage(imageFormat: ImageFormat.png, imageData: defaultImageUint8List, fileName: splashScreenImageFileName); ApplicationCustomization copyWith({ String? appName, @@ -123,8 +123,8 @@ class ApplicationCustomization { String? feedbackSubjectPrefix, WidgetImage? appbarIcon, WidgetImage? splashScreenImage, - WidgetImage? backgroundImage, - WidgetImage? licensesViewImage, + WidgetImage? Function()? backgroundImage, + WidgetImage? Function()? licensesViewImage, ThemeCustomization? lightTheme, ThemeCustomization? darkTheme, Set? disabledFeatures, @@ -140,8 +140,8 @@ class ApplicationCustomization { customFontBytes: customFontBytes, appbarIcon: appbarIcon ?? this.appbarIcon, splashScreenImage: splashScreenImage ?? this.splashScreenImage, - backgroundImage: backgroundImage ?? this.backgroundImage, - licensesViewImage: licensesViewImage ?? this.licensesViewImage, + backgroundImage: backgroundImage ?? () => this.backgroundImage, + licensesViewImage: licensesViewImage != null ? licensesViewImage() : this.licensesViewImage, lightTheme: lightTheme ?? this.lightTheme, darkTheme: darkTheme ?? this.darkTheme, disabledFeatures: disabledFeatures ?? this.disabledFeatures, @@ -198,7 +198,7 @@ class ApplicationCustomization { customFontBytes: fontBytes, appbarIcon: appbarIcon, splashScreenImage: splashScreenImage, - backgroundImage: backgroundImage, + backgroundImage: () => backgroundImage, licensesViewImage: licensesViewImage, lightTheme: lightTheme, darkTheme: darkTheme, @@ -238,11 +238,7 @@ class ApplicationCustomization { : json['appImage'] != null ? WidgetImage.fromJson(json['appImage'] as Map) : null, - backgroundImage: json['backgroundImage'] != null - ? WidgetImage.fromJson(json['backgroundImage'] as Map) - : json['appImage'] != null - ? WidgetImage.fromJson(json['appImage'] as Map) - : null, + backgroundImage: json.containsKey('backgroundImage') ? () => WidgetImage.fromJson(json['backgroundImage'] as Map) : () => null, licensesViewImage: json['licensesViewImage'] != null ? WidgetImage.fromJson(json['licensesViewImage'] as Map) : json['appImage'] != null @@ -265,8 +261,8 @@ class ApplicationCustomization { 'customFontBytes': customFontBytes != null ? base64Encode(customFontBytes!) : null, 'appbarIcon': appbarIcon.toJson(), 'splashScreenImage': splashScreenImage.toJson(), - 'backgroundImage': backgroundImage.toJson(), - 'licensesViewImage': licensesViewImage.toJson(), + if (backgroundImage != null) 'backgroundImage': backgroundImage?.toJson(), + if (licensesViewImage != null) 'licensesViewImage': licensesViewImage?.toJson(), 'lightTheme': lightTheme.toJson(), 'darkTheme': darkTheme.toJson(), 'disabledFeatures': disabledFeatures.map((e) => e.name).toList(), diff --git a/lib/utils/riverpod/riverpod_providers/generated_providers/introduction_provider.dart b/lib/utils/riverpod/riverpod_providers/generated_providers/introduction_provider.dart index 8302a1f0..d92ae5d1 100644 --- a/lib/utils/riverpod/riverpod_providers/generated_providers/introduction_provider.dart +++ b/lib/utils/riverpod/riverpod_providers/generated_providers/introduction_provider.dart @@ -68,6 +68,13 @@ class IntroductionNotifier extends _$IntroductionNotifier { Logger.debug('New saved state after completion: ${await future}'); } + Future completeMultiple(List values) async { + Logger.info('Completing multiple introductions: $values'); + final newState = (await future).withCompletedIntroductions(values); + await _saveToRepo(newState); + state = AsyncValue.data(newState); + } + Future uncomplete(Introduction introduction) async { Logger.info('Uncompleting introduction: $introduction'); final newState = (await future).withoutCompletedIntroduction(introduction); @@ -75,6 +82,13 @@ class IntroductionNotifier extends _$IntroductionNotifier { state = AsyncValue.data(newState); } + Future uncompleteMultiple(List values) async { + Logger.info('Uncompleting multiple introductions: $values'); + final newState = (await future).withoutCompletedIntroductions(values); + await _saveToRepo(newState); + state = AsyncValue.data(newState); + } + Future completeAll() async { Logger.info('Completing all introductions'); final newState = IntroductionState.withAllCompleted(); diff --git a/lib/views/main_view/main_view.dart b/lib/views/main_view/main_view.dart index 4d115fa7..94caf53e 100644 --- a/lib/views/main_view/main_view.dart +++ b/lib/views/main_view/main_view.dart @@ -46,14 +46,14 @@ class MainView extends ConsumerStatefulView { @override RouteSettings get routeSettings => const RouteSettings(name: routeName); - final Widget appIcon; - final Widget appImage; + final Widget appbarIcon; + final Widget? backgroundImage; final String appName; final bool disablePatchNotes; const MainView({ - required this.appImage, - required this.appIcon, + required this.backgroundImage, + required this.appbarIcon, required this.appName, required this.disablePatchNotes, super.key, @@ -95,7 +95,7 @@ class _MainViewState extends ConsumerState { // maxLines: 2 only works like this. maxLines: 2, // Title can be shown on small screens too. ), - leading: widget.appIcon, + leading: widget.appbarIcon, actions: [ hasFilter ? AppBarItem( @@ -119,7 +119,7 @@ class _MainViewState extends ConsumerState { child: StatusBar( child: Stack( children: [ - MainViewBackgroundImage(appImage: widget.appImage), + if (widget.backgroundImage != null) MainViewBackgroundImage(appImage: widget.backgroundImage!), hasFilter ? const MainViewTokensListFiltered() : MainViewTokensList(nestedScrollViewKey: globalKey), if (!hasFilter) MainViewNavigationBar(), ], diff --git a/lib/views/splash_screen/splash_screen.dart b/lib/views/splash_screen/splash_screen.dart index 21da741b..2b51233d 100644 --- a/lib/views/splash_screen/splash_screen.dart +++ b/lib/views/splash_screen/splash_screen.dart @@ -96,13 +96,6 @@ class _SplashScreenState extends ConsumerState { if (_customization.disabledFeatures.isNotEmpty) { Logger.info('Disabled features: ${_customization.disabledFeatures}'); } - // final ViewWidget nextView = MainView( - // appName: _customization.appName, - // appIcon: _customization.appIcon.getWidget, - // appImage: _customization.appImage.getWidget, - // disablePatchNotes: _customization.disabledFeatures.contains(AppFeature.patchNotes), - // ); - // final routeBuilder = PageRouteBuilder(pageBuilder: (_, __, ___) => nextView); // Idle until the splash screen is the top route. // By default it is the top route, but it can be overridden by pushing a new route before initializing the app, e.g. by a deep link. await Future.doWhile(() async { diff --git a/lib/widgets/button_widgets/cooldown_button.dart b/lib/widgets/button_widgets/cooldown_button.dart index 8dd22e85..a2d0dde4 100644 --- a/lib/widgets/button_widgets/cooldown_button.dart +++ b/lib/widgets/button_widgets/cooldown_button.dart @@ -48,7 +48,7 @@ class _CooldownButtonState extends State { padding: widget.padding ?? const EdgeInsets.all(0), child: ElevatedButton( onPressed: isPressable && widget.isPressable ? press : null, - style: widget.style?.merge(Theme.of(context).elevatedButtonTheme.style) ?? Theme.of(context).elevatedButtonTheme.style, + style: widget.style ?? Theme.of(context).elevatedButtonTheme.style, child: isPressable && widget.isPressable ? widget.child : widget.childWhenCooldown ?? widget.child, ), ), @@ -56,13 +56,19 @@ class _CooldownButtonState extends State { padding: widget.padding ?? const EdgeInsets.all(0), splashRadius: 26, onPressed: isPressable && widget.isPressable ? press : null, - style: widget.style?.merge(Theme.of(context).iconButtonTheme.style) ?? Theme.of(context).iconButtonTheme.style, + style: widget.style ?? Theme.of(context).iconButtonTheme.style, icon: isPressable && widget.isPressable ? widget.child : widget.childWhenCooldown ?? widget.child, ), + CooldownButtonStyleType.textButton => TextButton( + onPressed: isPressable && widget.isPressable ? press : null, + style: widget.style ?? Theme.of(context).textButtonTheme.style, + child: isPressable && widget.isPressable ? widget.child : widget.childWhenCooldown ?? widget.child, + ), }; } enum CooldownButtonStyleType { elevatedButton, iconButton, + textButton, } diff --git a/lib/widgets/dialog_widgets/push_request_dialog/push_request_dialog.dart b/lib/widgets/dialog_widgets/push_request_dialog/push_request_dialog.dart index 9ff37437..b47be486 100644 --- a/lib/widgets/dialog_widgets/push_request_dialog/push_request_dialog.dart +++ b/lib/widgets/dialog_widgets/push_request_dialog/push_request_dialog.dart @@ -81,7 +81,7 @@ class _PushRequestDialogState extends ConsumerState { children: [ const SizedBox(height: 12), Text( - localizations.requestInfo(token.issuer, token.label), + localizations.requestInfo(token.label, token.issuer), style: Theme.of(context).textTheme.bodyLarge!, textAlign: TextAlign.center, ), @@ -105,6 +105,7 @@ class _PushRequestDialogState extends ConsumerState { onAccept: (answer) => _onAccept(token, answer: answer), ), ), + const SizedBox(height: 8), PaddedRow( peddingPercent: 0.33, child: PushDeclineConfirmButton( diff --git a/lib/widgets/dialog_widgets/push_request_dialog/push_request_dialog_widgets/push_decline_confirm_dialog.dart b/lib/widgets/dialog_widgets/push_request_dialog/push_request_dialog_widgets/push_decline_confirm_dialog.dart index 865601e8..9c65a94c 100644 --- a/lib/widgets/dialog_widgets/push_request_dialog/push_request_dialog_widgets/push_decline_confirm_dialog.dart +++ b/lib/widgets/dialog_widgets/push_request_dialog/push_request_dialog_widgets/push_decline_confirm_dialog.dart @@ -144,6 +144,7 @@ class _PushDeclineConfirmDialogState extends State { ), ), ), + SizedBox(height: 8), PaddedRow( peddingPercent: 0.33, child: CooldownButton( diff --git a/test/unit_test/utils/customization/application_customization_test.dart b/test/unit_test/utils/customization/application_customization_test.dart index 684e0e79..a7112a7a 100644 --- a/test/unit_test/utils/customization/application_customization_test.dart +++ b/test/unit_test/utils/customization/application_customization_test.dart @@ -18,12 +18,12 @@ void _testAppCustomizer() { appName: 'test', websiteLink: 'https://test', appbarIcon: WidgetImage( - fileType: ImageFileType.png, + imageFormat: ImageFormat.png, imageData: defaultIconUint8List, fileName: "appbarIcon", ), splashScreenImage: WidgetImage( - fileType: ImageFileType.png, + imageFormat: ImageFormat.png, imageData: defaultImageUint8List, fileName: "splashScreenImage", ), @@ -51,12 +51,12 @@ void _testAppCustomizer() { appName: 'test2', websiteLink: 'https://test2', appbarIcon: WidgetImage( - fileType: ImageFileType.png, + imageFormat: ImageFormat.png, imageData: defaultImageUint8List, fileName: "appbarIcon", ), splashScreenImage: WidgetImage( - fileType: ImageFileType.png, + imageFormat: ImageFormat.png, imageData: defaultIconUint8List, fileName: "appImage", ), @@ -118,10 +118,10 @@ void _testAppCustomizer() { // Assert expect(newCustomization.appName, equals('test2')); expect(newCustomization.websiteLink, equals('https://test2')); - expect(newCustomization.appbarIcon.fileType, equals(ImageFileType.png)); + expect(newCustomization.appbarIcon.imageFormat, equals(ImageFormat.png)); expect(newCustomization.appbarIcon.imageData, equals(defaultIconUint8List)); expect(newCustomization.appbarIcon.fileName, equals('appbarIcon')); - expect(newCustomization.splashScreenImage.fileType, equals(ImageFileType.png)); + expect(newCustomization.splashScreenImage.imageFormat, equals(ImageFormat.png)); expect(newCustomization.splashScreenImage.imageData, equals(defaultImageUint8List)); expect(newCustomization.splashScreenImage.fileName, equals('splashScreenImage')); expect(newCustomization.lightTheme, equals(ApplicationCustomization.defaultCustomization.lightTheme));