@@ -41,6 +41,7 @@ class FeedbackThemeData {
4141 this .bottomSheetDescriptionStyle = _defaultBottomSheetDescriptionStyle,
4242 this .bottomSheetTextInputStyle = _defaultBottomSheetTextInputStyle,
4343 this .sheetIsDraggable = true ,
44+ Brightness ? brightness,
4445 Color ? dragHandleColor,
4546 ColorScheme ? colorScheme})
4647 :
@@ -50,8 +51,9 @@ class FeedbackThemeData {
5051 // ignore: prefer_is_empty
5152 drawColors.length > 0 ,
5253 'There must be at least one color to draw with' ,
53- ),
54- brightness = ThemeData .estimateBrightnessForColor (feedbackSheetColor) {
54+ ) {
55+ this .brightness =
56+ brightness ?? = ThemeData .estimateBrightnessForColor (feedbackSheetColor);
5557 final bool isDark = brightness == Brightness .dark;
5658 this .dragHandleColor =
5759 dragHandleColor ?? (isDark ? Colors .black26 : Colors .white38);
@@ -71,6 +73,7 @@ class FeedbackThemeData {
7173 color: Colors .white,
7274 ),
7375 sheetIsDraggable: sheetIsDraggable,
76+ brightness: Brightness .dark,
7477 );
7578
7679 /// Create a light version of the [FeedbackThemeData]
@@ -81,10 +84,11 @@ class FeedbackThemeData {
8184 feedbackSheetColor: _lightGrey,
8285 bottomSheetDescriptionStyle: _defaultBottomSheetDescriptionStyle,
8386 sheetIsDraggable: sheetIsDraggable,
87+ brightness: Brightness .light,
8488 );
8589
8690 /// Brightness of the theme based on the [background] color
87- final Brightness brightness;
91+ late final Brightness brightness;
8892
8993 /// The background of the feedback view.
9094 final Color background;
@@ -122,6 +126,39 @@ class FeedbackThemeData {
122126
123127 /// [ColorScheme] on the feedback UI
124128 late final ColorScheme colorScheme;
129+
130+ /// Creates a copy of the current [FeedbackThemeData] with the given
131+ /// optional fields replaced with the given values.
132+ FeedbackThemeData copyWith ({
133+ Color ? background,
134+ Color ? feedbackSheetColor,
135+ double ? feedbackSheetHeight,
136+ Color ? activeFeedbackModeColor,
137+ List <Color >? drawColors,
138+ TextStyle ? bottomSheetDescriptionStyle,
139+ TextStyle ? bottomSheetTextInputStyle,
140+ bool ? sheetIsDraggable,
141+ Color ? dragHandleColor,
142+ Brightness ? brightness,
143+ ColorScheme ? colorScheme,
144+ }) {
145+ return FeedbackThemeData (
146+ background: background ?? this .background,
147+ feedbackSheetColor: feedbackSheetColor ?? this .feedbackSheetColor,
148+ feedbackSheetHeight: feedbackSheetHeight ?? this .feedbackSheetHeight,
149+ activeFeedbackModeColor:
150+ activeFeedbackModeColor ?? this .activeFeedbackModeColor,
151+ drawColors: drawColors ?? this .drawColors,
152+ bottomSheetDescriptionStyle:
153+ bottomSheetDescriptionStyle ?? this .bottomSheetDescriptionStyle,
154+ bottomSheetTextInputStyle:
155+ bottomSheetTextInputStyle ?? this .bottomSheetTextInputStyle,
156+ sheetIsDraggable: sheetIsDraggable ?? this .sheetIsDraggable,
157+ dragHandleColor: dragHandleColor ?? this .dragHandleColor,
158+ brightness: brightness ?? this .brightness,
159+ colorScheme: colorScheme ?? this .colorScheme,
160+ );
161+ }
125162}
126163
127164/// Provides an instance of [FeedbackThemeData] for all descendants.
0 commit comments