Button.toggle constructor
Button.toggle({
- Key? key,
- required bool checked,
- required ValueChanged<
bool> onChanged, - Widget? child,
- ToggleButtonThemeData? style,
- FocusNode? focusNode,
- bool autofocus = false,
- String? semanticLabel,
Creates a button that can be on or of. Uses a ToggleButton under the hood
Implementation
Button.toggle({
Key? key,
required bool checked,
required ValueChanged<bool> onChanged,
Widget? child,
ToggleButtonThemeData? style,
this.focusNode,
this.autofocus = false,
this.semanticLabel,
}) : child = ToggleButton(
checked: checked,
onChanged: onChanged,
child: child,
focusNode: focusNode,
semanticLabel: semanticLabel,
style: style,
),
style = null,
onPressed = null,
onLongPress = null,
type = _ButtonType.toggle,
builder = null,
super(key: key);