flutter_colorpicker: Provides a material color picker for your app
onPressed: () {
// 4
showDialog(
context: context,
builder: (context) {
// 5
return AlertDialog(
content: BlockPicker(
pickerColor: Colors.white,
// 6
onColorChanged: (color) {
setState(() => _currentColor = color);
}),
actions: [
// 7
TextButton(
child: const Text('Save'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
},