From 65f2df89102468f723fe2633a65f838649cdc884 Mon Sep 17 00:00:00 2001 From: Aliaksei Date: Tue, 15 Jul 2025 14:45:34 +0300 Subject: [PATCH] add secondary button customization --- .../pages/suggestion/suggestion_page.dart | 6 ++++-- .../presentation/pages/theme/suggestions_theme.dart | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/src/presentation/pages/suggestion/suggestion_page.dart b/lib/src/presentation/pages/suggestion/suggestion_page.dart index 93dc93c..82e7353 100644 --- a/lib/src/presentation/pages/suggestion/suggestion_page.dart +++ b/lib/src/presentation/pages/suggestion/suggestion_page.dart @@ -797,10 +797,12 @@ class _NewCommentButton extends StatelessWidget { child: FilledButton( style: context.theme.filledButtonTheme.style?.copyWith( backgroundColor: WidgetStateProperty.resolveWith( - (states) => context.theme.colorScheme.secondaryContainer, + (states) => theme.secondaryButtonBackgroundColor ?? + context.theme.colorScheme.secondaryContainer, ), foregroundColor: WidgetStatePropertyAll( - context.theme.colorScheme.onSecondaryContainer, + theme.secondaryButtonForegroundColor ?? + context.theme.colorScheme.onSecondaryContainer, ), ), onPressed: onClick, diff --git a/lib/src/presentation/pages/theme/suggestions_theme.dart b/lib/src/presentation/pages/theme/suggestions_theme.dart index 23a1d1b..4ca8a7c 100644 --- a/lib/src/presentation/pages/theme/suggestions_theme.dart +++ b/lib/src/presentation/pages/theme/suggestions_theme.dart @@ -17,7 +17,10 @@ class SuggestionsTheme { final Color featureLabelColor; final Color bugLabelColor; + final Color? backgroundColor; + final Color? secondaryButtonBackgroundColor; + final Color? secondaryButtonForegroundColor; SuggestionsTheme({ required this.actionColor, @@ -35,6 +38,8 @@ class SuggestionsTheme { required this.fade, required this.fabColor, this.backgroundColor, + this.secondaryButtonBackgroundColor, + this.secondaryButtonForegroundColor, }); factory SuggestionsTheme.initial() => SuggestionsTheme( @@ -70,6 +75,8 @@ class SuggestionsTheme { Color? fade, Color? fabColor, Color? backgroundColor, + Color? secondaryButtonBackgroundColor, + Color? secondaryButtonForegroundColor, }) { return SuggestionsTheme( actionColor: actionColor ?? this.actionColor, @@ -88,6 +95,10 @@ class SuggestionsTheme { fade: fade ?? this.fade, fabColor: fabColor ?? this.fabColor, backgroundColor: backgroundColor ?? this.backgroundColor, + secondaryButtonBackgroundColor: + secondaryButtonBackgroundColor ?? this.secondaryButtonBackgroundColor, + secondaryButtonForegroundColor: + secondaryButtonForegroundColor ?? this.secondaryButtonForegroundColor, ); } }