@@ -49,6 +49,8 @@ class ImagePainter extends StatefulWidget {
4949 this .optionColor,
5050 this .onUndo,
5151 this .onClear,
52+ this .optionSelectedBackgroundColor,
53+ this .optionUnselectedBackgroundColor,
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 ? selectedBackgroundColor,
83+ Color ? unselectedBackgroundColor,
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: selectedBackgroundColor,
111+ optionUnselectedBackgroundColor: unselectedBackgroundColor,
106112 );
107113 }
108114
@@ -132,6 +138,8 @@ class ImagePainter extends StatefulWidget {
132138 Color ? optionColor,
133139 VoidCallback ? onUndo,
134140 VoidCallback ? onClear,
141+ Color ? selectedBackgroundColor,
142+ Color ? unselectedBackgroundColor,
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: selectedBackgroundColor,
170+ optionUnselectedBackgroundColor: unselectedBackgroundColor,
161171 );
162172 }
163173
@@ -187,6 +197,8 @@ class ImagePainter extends StatefulWidget {
187197 Color ? optionColor,
188198 VoidCallback ? onUndo,
189199 VoidCallback ? onClear,
200+ Color ? selectedBackgroundColor,
201+ Color ? unselectedBackgroundColor,
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: selectedBackgroundColor,
229+ optionUnselectedBackgroundColor: unselectedBackgroundColor,
216230 );
217231 }
218232
@@ -242,6 +256,8 @@ class ImagePainter extends StatefulWidget {
242256 Color ? optionColor,
243257 VoidCallback ? onUndo,
244258 VoidCallback ? onClear,
259+ Color ? selectedBackgroundColor,
260+ Color ? unselectedBackgroundColor,
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: selectedBackgroundColor,
288+ optionUnselectedBackgroundColor: unselectedBackgroundColor,
271289 );
272290 }
273291
@@ -393,8 +411,12 @@ class ImagePainter extends StatefulWidget {
393411
394412 final Color ? optionSelectedColor;
395413
414+ final Color ? optionSelectedBackgroundColor;
415+
396416 final Color ? optionUnselectedColor;
397417
418+ final Color ? optionUnselectedBackgroundColor;
419+
398420 final Color ? optionColor;
399421
400422 final VoidCallback ? onUndo;
@@ -718,7 +740,11 @@ class ImagePainterState extends State<ImagePainter> {
718740 data: item,
719741 isSelected: _controller.mode == item.mode,
720742 selectedColor: widget.optionSelectedColor,
743+ selectedBackgroundColor:
744+ widget.optionSelectedBackgroundColor,
721745 unselectedColor: widget.optionUnselectedColor,
746+ unselectedBackgroundColor:
747+ widget.optionUnselectedBackgroundColor,
722748 onTap: () {
723749 if (widget.onPaintModeChanged != null ) {
724750 widget.onPaintModeChanged !(item.mode);
0 commit comments