showColorPicker method

Future<Color> showColorPicker(
  1. BuildContext rootContext,
  2. Offset offset
)

Implementation

Future<Color> showColorPicker(BuildContext rootContext, Offset offset) async {
  if (pickerOverlay != null) return Future.value(widget.color);

  pickerOverlay = _buildPickerOverlay(offset, rootContext);

  Overlay.of(rootContext).insert(pickerOverlay!);

  return Future.value(widget.color);
}