showIOSCustomColorPicker method

void showIOSCustomColorPicker({
  1. required BuildContext context,
  2. required ValueChanged<Color> onColorChanged,
  3. Color? startingColor,
})

iOS Native color Picker clone, for all Platforms.

startingColor is null then the default color will be green

Implementation

void showIOSCustomColorPicker({
  required BuildContext context,
  required ValueChanged<Color> onColorChanged,
  Color? startingColor,
}) async {
  colorController = ColorController(startingColor ?? selectedColor);
  return showModalBottomSheet(
      backgroundColor: Colors.transparent,
      barrierColor: Colors.black26,
      isScrollControlled: true,
      context: context,
      builder: (context) {
        return IosColorPicker(
          onColorSelected: (value) {
            selectedColor = value;
            onColorChanged(selectedColor);
          },
        );
      });
}