ColorPicker.rectangle constructor

ColorPicker.rectangle({
  1. Key? key,
  2. required ValueChanged<Color> onTap,
  3. List<Color>? colors,
  4. double extent = _defaultExtent,
  5. Color? initialColor,
  6. EdgeInsets padding = _defaultPadding,
  7. double spacing = _defaultSpacing,
  8. Widget? title = _defaultTitle,
})

A color picker that represents all MaterialColor via a GridView.

Circle uses a BoxDecoration with BoxShape.rectangle.

Implementation

ColorPicker.rectangle({
  super.key,
  required this.onTap,
  List<Color>? colors,
  this.extent = _defaultExtent,
  this.initialColor,
  this.padding = _defaultPadding,
  this.spacing = _defaultSpacing,
  this.title = _defaultTitle,
})  : colors = colors ?? _defaultColors,
      isCompact = false,
      decoration = BoxDecoration(
        border: Border.all(),
      );