Skip to content

Commit e69e974

Browse files
authored
1 parent 06a7f4a commit e69e974

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/src/widgets/toolbar/color_button.dart

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class _ColorButtonState extends State<ColorButton> {
125125
);
126126
}
127127

128-
void _changeColor(Color color) {
128+
void _changeColor(BuildContext context, Color color) {
129129
var hex = color.value.toRadixString(16);
130130
if (hex.startsWith('ff')) {
131131
hex = hex.substring(2);
@@ -139,15 +139,16 @@ class _ColorButtonState extends State<ColorButton> {
139139
void _showColorPicker() {
140140
showDialog(
141141
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+
),
151152
);
152153
}
153154
}

0 commit comments

Comments
 (0)