Skip to content

Commit ac0d6f3

Browse files
committed
add feedbackMenuBackgroundColor property for change menu bg color
1 parent 6807209 commit ac0d6f3

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

feedback/lib/src/controls_column.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class ControlsColumn extends StatelessWidget {
1313
super.key,
1414
required this.mode,
1515
required this.activeColor,
16+
required this.backgroundColor,
1617
required this.onColorChanged,
1718
required this.onUndo,
1819
required this.onControlModeChanged,
@@ -32,12 +33,14 @@ class ControlsColumn extends StatelessWidget {
3233
final VoidCallback onClearDrawing;
3334
final List<Color> colors;
3435
final Color activeColor;
36+
final Color backgroundColor;
3537
final FeedbackMode mode;
3638

3739
@override
3840
Widget build(BuildContext context) {
3941
final isNavigatingActive = FeedbackMode.navigate == mode;
4042
return Card(
43+
color: backgroundColor,
4144
margin: EdgeInsets.zero,
4245
shape: const RoundedRectangleBorder(
4346
borderRadius: BorderRadius.all(

feedback/lib/src/feedback_widget.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ class FeedbackWidgetState extends State<FeedbackWidget>
217217
progress: sheetProgress,
218218
minScale: .7,
219219
child: ControlsColumn(
220+
backgroundColor: FeedbackTheme.of(context)
221+
.feedbackMenuBackgroundColor,
220222
mode: mode,
221223
activeColor: painterController.drawColor,
222224
colors: widget.drawColors,

feedback/lib/src/theme/feedback_theme.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class FeedbackThemeData {
3535
FeedbackThemeData(
3636
{this.background = Colors.grey,
3737
this.feedbackSheetColor = _lightGrey,
38+
this.feedbackMenuBackgroundColor = _lightGrey,
3839
this.feedbackSheetHeight = .25,
3940
this.activeFeedbackModeColor = _blue,
4041
this.drawColors = _defaultDrawColors,
@@ -97,6 +98,10 @@ class FeedbackThemeData {
9798
/// his feedback and thoughts.
9899
final Color feedbackSheetColor;
99100

101+
/// The background color of the column containing the action buttons
102+
/// in the feedback menu.
103+
final Color feedbackMenuBackgroundColor;
104+
100105
/// The height of the bottom sheet as a fraction of the screen height.
101106
///
102107
/// Values between .2 and .3 are usually ideal.

feedback/test/controls_column_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
77
void main() {
88
Widget create({
99
Color? activeColor,
10+
Color? backgroundColor,
1011
FeedbackMode? mode,
1112
ValueChanged<Color>? onColorChanged,
1213
VoidCallback? onUndo,
@@ -18,6 +19,7 @@ void main() {
1819
return FeedbackLocalization(
1920
child: ControlsColumn(
2021
activeColor: activeColor ?? Colors.red,
22+
backgroundColor: backgroundColor ?? Colors.grey,
2123
mode: mode ?? FeedbackMode.draw,
2224
colors:
2325
colors ?? [Colors.red, Colors.green, Colors.blue, Colors.yellow],

0 commit comments

Comments
 (0)