CycleButton<T>.secondary constructor
CycleButton<T>.secondary ({
- Key? key,
- required List<
T> values, - required Widget builder(
- BuildContext,
- T
- required T initialValue,
- dynamic onChanged(
- T value
- ButtonSize size = ButtonSize.normal,
- ButtonDensity density = ButtonDensity.icon,
- ButtonShape shape = ButtonShape.rectangle,
- FocusNode? focusNode,
- bool disableTransition = false,
- ValueChanged<
bool> ? onHover, - ValueChanged<
bool> ? onFocus, - bool? enableFeedback,
Creates a secondary-styled CycleButton.
Initializes the CycleButton with ButtonStyle.secondary(), for less prominent toggles, such as secondary options in dialogs or MutableText format cycling.
Parameters follow the default constructor, with fixed secondary styling. Assertions ensure data integrity at construction.
Implementation
CycleButton.secondary({
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.secondary(),
assert(values.isNotEmpty, 'Values map must not be empty'),
assert(values.contains(initialValue),
'Initial value must be a key in the values map');