@@ -49,6 +49,8 @@ class ImagePainter extends StatefulWidget {
4949 this .optionColor,
5050 this .onUndo,
5151 this .onClear,
52+ this .optionSelectedBackgroundColor,
53+ this .optionsBackgroundColor,
5254 }) : super (key: key);
5355
5456 ///Constructor for loading image from network url.
@@ -77,6 +79,8 @@ class ImagePainter extends StatefulWidget {
7779 Color ? optionColor,
7880 VoidCallback ? onUndo,
7981 VoidCallback ? onClear,
82+ Color ? optionsSelectedBackgroundColor,
83+ Color ? optionsBackgroundColor,
8084 }) {
8185 return ImagePainter ._(
8286 key: key,
@@ -103,6 +107,8 @@ class ImagePainter extends StatefulWidget {
103107 optionColor: optionColor,
104108 onUndo: onUndo,
105109 onClear: onClear,
110+ optionSelectedBackgroundColor: optionsSelectedBackgroundColor,
111+ optionsBackgroundColor: optionsBackgroundColor,
106112 );
107113 }
108114
@@ -132,6 +138,8 @@ class ImagePainter extends StatefulWidget {
132138 Color ? optionColor,
133139 VoidCallback ? onUndo,
134140 VoidCallback ? onClear,
141+ Color ? optionsSelectedBackgroundColor,
142+ Color ? optionsBackgroundColor,
135143 }) {
136144 return ImagePainter ._(
137145 controller: controller,
@@ -158,6 +166,8 @@ class ImagePainter extends StatefulWidget {
158166 optionColor: optionColor,
159167 onUndo: onUndo,
160168 onClear: onClear,
169+ optionSelectedBackgroundColor: optionsSelectedBackgroundColor,
170+ optionsBackgroundColor: optionsBackgroundColor,
161171 );
162172 }
163173
@@ -187,6 +197,8 @@ class ImagePainter extends StatefulWidget {
187197 Color ? optionColor,
188198 VoidCallback ? onUndo,
189199 VoidCallback ? onClear,
200+ Color ? optionsSelectedBackgroundColor,
201+ Color ? optionsBackgroundColor,
190202 }) {
191203 return ImagePainter ._(
192204 controller: controller,
@@ -213,6 +225,8 @@ class ImagePainter extends StatefulWidget {
213225 optionColor: optionColor,
214226 onUndo: onUndo,
215227 onClear: onClear,
228+ optionSelectedBackgroundColor: optionsSelectedBackgroundColor,
229+ optionsBackgroundColor: optionsBackgroundColor,
216230 );
217231 }
218232
@@ -242,6 +256,8 @@ class ImagePainter extends StatefulWidget {
242256 Color ? optionColor,
243257 VoidCallback ? onUndo,
244258 VoidCallback ? onClear,
259+ Color ? optionsSelectedBackgroundColor,
260+ Color ? optionsBackgroundColor,
245261 }) {
246262 return ImagePainter ._(
247263 controller: controller,
@@ -268,6 +284,8 @@ class ImagePainter extends StatefulWidget {
268284 optionColor: optionColor,
269285 onUndo: onUndo,
270286 onClear: onClear,
287+ optionSelectedBackgroundColor: optionsSelectedBackgroundColor,
288+ optionsBackgroundColor: optionsBackgroundColor,
271289 );
272290 }
273291
@@ -393,6 +411,12 @@ class ImagePainter extends StatefulWidget {
393411
394412 final Color ? optionSelectedColor;
395413
414+ /// The background color of the selected option in the options list.
415+ final Color ? optionSelectedBackgroundColor;
416+
417+ /// The background color of the options list.
418+ final Color ? optionsBackgroundColor;
419+
396420 final Color ? optionUnselectedColor;
397421
398422 final Color ? optionColor;
@@ -718,6 +742,8 @@ class ImagePainterState extends State<ImagePainter> {
718742 data: item,
719743 isSelected: _controller.mode == item.mode,
720744 selectedColor: widget.optionSelectedColor,
745+ selectedBackgroundColor:
746+ widget.optionSelectedBackgroundColor,
721747 unselectedColor: widget.optionUnselectedColor,
722748 onTap: () {
723749 if (widget.onPaintModeChanged != null ) {
@@ -834,6 +860,7 @@ class ImagePainterState extends State<ImagePainter> {
834860 .firstWhere ((item) => item.mode == _controller.mode)
835861 .icon;
836862 return PopupMenuButton (
863+ color: widget.optionsBackgroundColor,
837864 tooltip: textDelegate.changeMode,
838865 shape: ContinuousRectangleBorder (
839866 borderRadius: BorderRadius .circular (40 ),
0 commit comments