From ac0d6f3497a0269bb1ea7dc52cf19e77bdc7e5ac Mon Sep 17 00:00:00 2001 From: Sadra Kafiri Date: Wed, 13 Aug 2025 18:15:20 +0330 Subject: [PATCH 1/2] add feedbackMenuBackgroundColor property for change menu bg color --- feedback/lib/src/controls_column.dart | 3 +++ feedback/lib/src/feedback_widget.dart | 2 ++ feedback/lib/src/theme/feedback_theme.dart | 5 +++++ feedback/test/controls_column_test.dart | 2 ++ 4 files changed, 12 insertions(+) diff --git a/feedback/lib/src/controls_column.dart b/feedback/lib/src/controls_column.dart index 27eec0d1..8f31b2d7 100644 --- a/feedback/lib/src/controls_column.dart +++ b/feedback/lib/src/controls_column.dart @@ -13,6 +13,7 @@ class ControlsColumn extends StatelessWidget { super.key, required this.mode, required this.activeColor, + required this.backgroundColor, required this.onColorChanged, required this.onUndo, required this.onControlModeChanged, @@ -32,12 +33,14 @@ class ControlsColumn extends StatelessWidget { final VoidCallback onClearDrawing; final List colors; final Color activeColor; + final Color backgroundColor; final FeedbackMode mode; @override Widget build(BuildContext context) { final isNavigatingActive = FeedbackMode.navigate == mode; return Card( + color: backgroundColor, margin: EdgeInsets.zero, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all( diff --git a/feedback/lib/src/feedback_widget.dart b/feedback/lib/src/feedback_widget.dart index 5a9a2715..6881f817 100644 --- a/feedback/lib/src/feedback_widget.dart +++ b/feedback/lib/src/feedback_widget.dart @@ -217,6 +217,8 @@ class FeedbackWidgetState extends State progress: sheetProgress, minScale: .7, child: ControlsColumn( + backgroundColor: FeedbackTheme.of(context) + .feedbackMenuBackgroundColor, mode: mode, activeColor: painterController.drawColor, colors: widget.drawColors, diff --git a/feedback/lib/src/theme/feedback_theme.dart b/feedback/lib/src/theme/feedback_theme.dart index 5befc0fb..eb005709 100644 --- a/feedback/lib/src/theme/feedback_theme.dart +++ b/feedback/lib/src/theme/feedback_theme.dart @@ -35,6 +35,7 @@ class FeedbackThemeData { FeedbackThemeData( {this.background = Colors.grey, this.feedbackSheetColor = _lightGrey, + this.feedbackMenuBackgroundColor = _lightGrey, this.feedbackSheetHeight = .25, this.activeFeedbackModeColor = _blue, this.drawColors = _defaultDrawColors, @@ -97,6 +98,10 @@ class FeedbackThemeData { /// his feedback and thoughts. final Color feedbackSheetColor; + /// The background color of the column containing the action buttons + /// in the feedback menu. + final Color feedbackMenuBackgroundColor; + /// The height of the bottom sheet as a fraction of the screen height. /// /// Values between .2 and .3 are usually ideal. diff --git a/feedback/test/controls_column_test.dart b/feedback/test/controls_column_test.dart index 0560ff1b..c876b3bf 100644 --- a/feedback/test/controls_column_test.dart +++ b/feedback/test/controls_column_test.dart @@ -7,6 +7,7 @@ import 'package:flutter/material.dart'; void main() { Widget create({ Color? activeColor, + Color? backgroundColor, FeedbackMode? mode, ValueChanged? onColorChanged, VoidCallback? onUndo, @@ -18,6 +19,7 @@ void main() { return FeedbackLocalization( child: ControlsColumn( activeColor: activeColor ?? Colors.red, + backgroundColor: backgroundColor ?? Colors.grey, mode: mode ?? FeedbackMode.draw, colors: colors ?? [Colors.red, Colors.green, Colors.blue, Colors.yellow], From d405133cf355681a5dcae90b46efc02d4e221b36 Mon Sep 17 00:00:00 2001 From: Sadra Kafiri Date: Wed, 13 Aug 2025 19:12:03 +0330 Subject: [PATCH 2/2] add feedbackMenuForegroundColor for menu button colors --- feedback/lib/src/controls_column.dart | 9 ++++++--- feedback/lib/src/theme/feedback_theme.dart | 9 +++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/feedback/lib/src/controls_column.dart b/feedback/lib/src/controls_column.dart index 8f31b2d7..68dc4f09 100644 --- a/feedback/lib/src/controls_column.dart +++ b/feedback/lib/src/controls_column.dart @@ -54,7 +54,8 @@ class ControlsColumn extends StatelessWidget { children: [ IconButton( key: const ValueKey('close_controls_column'), - icon: const Icon(Icons.close), + icon: Icon(Icons.close, + color: FeedbackTheme.of(context).feedbackMenuForegroundColor), onPressed: onCloseFeedback, ), _ColumnDivider(), @@ -86,12 +87,14 @@ class ControlsColumn extends StatelessWidget { ), IconButton( key: const ValueKey('undo_button'), - icon: const Icon(Icons.undo), + icon: Icon(Icons.undo, + color: FeedbackTheme.of(context).feedbackMenuForegroundColor), onPressed: isNavigatingActive ? null : onUndo, ), IconButton( key: const ValueKey('clear_button'), - icon: const Icon(Icons.delete), + icon: Icon(Icons.delete, + color: FeedbackTheme.of(context).feedbackMenuForegroundColor), onPressed: isNavigatingActive ? null : onClearDrawing, ), for (final color in colors) diff --git a/feedback/lib/src/theme/feedback_theme.dart b/feedback/lib/src/theme/feedback_theme.dart index eb005709..3feffb67 100644 --- a/feedback/lib/src/theme/feedback_theme.dart +++ b/feedback/lib/src/theme/feedback_theme.dart @@ -36,6 +36,7 @@ class FeedbackThemeData { {this.background = Colors.grey, this.feedbackSheetColor = _lightGrey, this.feedbackMenuBackgroundColor = _lightGrey, + this.feedbackMenuForegroundColor = Colors.black, this.feedbackSheetHeight = .25, this.activeFeedbackModeColor = _blue, this.drawColors = _defaultDrawColors, @@ -70,6 +71,8 @@ class FeedbackThemeData { background: Colors.grey.shade700, dragHandleColor: Colors.white38, feedbackSheetColor: _darkGrey, + feedbackMenuBackgroundColor: _darkGrey, + feedbackMenuForegroundColor: Colors.white, bottomSheetDescriptionStyle: const TextStyle( color: Colors.white, ), @@ -83,6 +86,8 @@ class FeedbackThemeData { background: Colors.grey, dragHandleColor: Colors.black26, feedbackSheetColor: _lightGrey, + feedbackMenuBackgroundColor: _lightGrey, + feedbackMenuForegroundColor: Colors.black, bottomSheetDescriptionStyle: _defaultBottomSheetDescriptionStyle, sheetIsDraggable: sheetIsDraggable, brightness: Brightness.light, @@ -102,6 +107,10 @@ class FeedbackThemeData { /// in the feedback menu. final Color feedbackMenuBackgroundColor; + /// The foreground color of the column containing the action buttons (Trash, Undo, ModeButtons) + /// in the feedback menu. + final Color feedbackMenuForegroundColor; + /// The height of the bottom sheet as a fraction of the screen height. /// /// Values between .2 and .3 are usually ideal.