CycleButton<T>.ghost constructor

CycleButton<T>.ghost({
  1. Key? key,
  2. required List<T> values,
  3. required Widget builder(
    1. BuildContext,
    2. T
    ),
  4. required T initialValue,
  5. dynamic onChanged(
    1. T value
    )?,
  6. ButtonSize size = ButtonSize.normal,
  7. ButtonDensity density = ButtonDensity.icon,
  8. ButtonShape shape = ButtonShape.rectangle,
  9. FocusNode? focusNode,
  10. bool disableTransition = false,
  11. ValueChanged<bool>? onHover,
  12. ValueChanged<bool>? onFocus,
  13. bool? enableFeedback,
})

Creates a ghost-styled CycleButton.

Implementation

CycleButton.ghost({
  super.key,
  required this.values,
  required this.builder,
  required this.initialValue,
  this.onChanged,
  this.size = ButtonSize.normal,
  this.density = ButtonDensity.icon,
  this.shape = ButtonShape.rectangle,
  this.focusNode,
  this.disableTransition = false,
  this.onHover,
  this.onFocus,
  this.enableFeedback,
})  : style = const ButtonStyle.ghost(),
      assert(values.isNotEmpty, 'Values map must not be empty'),
      assert(values.contains(initialValue),
          'Initial value must be a key in the values map');