File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ class _ColorButtonState extends State<ColorButton> {
125
125
);
126
126
}
127
127
128
- void _changeColor (Color color) {
128
+ void _changeColor (BuildContext context, Color color) {
129
129
var hex = color.value.toRadixString (16 );
130
130
if (hex.startsWith ('ff' )) {
131
131
hex = hex.substring (2 );
@@ -139,15 +139,16 @@ class _ColorButtonState extends State<ColorButton> {
139
139
void _showColorPicker () {
140
140
showDialog (
141
141
context: context,
142
- builder: (_) => AlertDialog (
143
- title: const Text ('Select Color' ),
144
- backgroundColor: Theme .of (context).canvasColor,
145
- content: SingleChildScrollView (
146
- child: MaterialPicker (
147
- pickerColor: const Color (0x00000000 ),
148
- onColorChanged: _changeColor,
149
- ),
150
- )),
142
+ builder: (context) => AlertDialog (
143
+ title: const Text ('Select Color' ),
144
+ backgroundColor: Theme .of (context).canvasColor,
145
+ content: SingleChildScrollView (
146
+ child: MaterialPicker (
147
+ pickerColor: const Color (0x00000000 ),
148
+ onColorChanged: (color) => _changeColor (context, color),
149
+ ),
150
+ ),
151
+ ),
151
152
);
152
153
}
153
154
}
You can’t perform that action at this time.
0 commit comments