GlassColorSwatches constructor

const GlassColorSwatches({
  1. Key? key,
  2. required List<Color> colors,
  3. required Color? value,
  4. required ValueChanged<Color>? onChanged,
  5. double size = 28,
  6. double spacing = 12,
  7. List<String>? labels,
  8. String? semanticLabel,
  9. FocusNode? focusNode,
  10. bool autofocus = false,
})

Creates colour swatches; labels, if given, must have one per colour.

Implementation

const GlassColorSwatches({
  super.key,
  required this.colors,
  required this.value,
  required this.onChanged,
  this.size = 28,
  this.spacing = 12,
  this.labels,
  this.semanticLabel,
  this.focusNode,
  this.autofocus = false,
}) : assert(size > 0),
     assert(labels == null || labels.length == colors.length);