chooseColor function
void
chooseColor({
- required BuildContext context,
- required Size size,
- required dynamic selectedColor(),
Implementation
void chooseColor({
required BuildContext context,
required Size size,
required Function(Color) selectedColor,
}) {
showDialog(
context: context,
builder: (ctx) {
return AlertDialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
title: const Text("Choose Color"),
content: SizedBox(
height: size.height * 0.3,
width: size.width * 0.2,
child: ColorPickerPalette(
onSelectColor: (Color value) {
selectedColor(value);
Navigator.pop(context);
},
),
),
);
},
);
}