FormeSwitchTile constructor
FormeSwitchTile({
- Key? key,
- String? name,
- bool initialValue = false,
- FormeAsyncValidator<
bool> ? asyncValidator, - Duration? asyncValidatorDebounce,
- AutovalidateMode? autovalidateMode,
- bool enabled = true,
- FocusNode? focusNode,
- FormeFieldInitialized<
bool> ? onInitialized, - FormeFieldSetter<
bool> ? onSaved, - FormeFieldStatusChanged<
bool> ? onStatusChanged, - int? order,
- bool quietlyValidate = false,
- bool readOnly = false,
- bool requestFocusOnUserInteraction = true,
- FormeFieldValidationFilter<
bool> ? validationFilter, - FormeValidator<
bool> ? validator, - FormeFieldDecorator<
bool> ? decorator, - bool tristate = false,
- Color? activeColor,
- ImageProvider<
Object> ? activeThumbImage, - Color? activeTrackColor,
- bool autofocus = false,
- EdgeInsets? contentPadding,
- ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
- bool dense = false,
- bool? enableFeedback,
- Color? hoverColor,
- Color? inactiveThumbColor,
- ImageProvider<
Object> ? inactiveThumbImage, - Color? inactiveTrackColor,
- bool isThreeLine = false,
- Widget? secondary,
- bool selected = false,
- Color? selectedTileColor,
- ShapeBorder? shape,
- Widget? subtitle,
- Color? tileColor,
- Widget? title,
- VisualDensity? visualDensity,
Implementation
FormeSwitchTile({
super.key,
super.name,
super.initialValue = false,
super.asyncValidator,
super.asyncValidatorDebounce,
super.autovalidateMode,
super.enabled = true,
super.focusNode,
super.onInitialized,
super.onSaved,
super.onStatusChanged,
super.order,
super.quietlyValidate = false,
super.readOnly = false,
super.requestFocusOnUserInteraction = true,
super.validationFilter,
super.validator,
super.decorator,
this.tristate = false,
this.activeColor,
this.activeThumbImage,
this.activeTrackColor,
this.autofocus = false,
this.contentPadding,
this.controlAffinity = ListTileControlAffinity.platform,
this.dense = false,
this.enableFeedback,
this.hoverColor,
this.inactiveThumbColor,
this.inactiveThumbImage,
this.inactiveTrackColor,
this.isThreeLine = false,
this.secondary,
this.selected = false,
this.selectedTileColor,
this.shape,
this.subtitle,
this.tileColor,
this.title,
this.visualDensity,
}) : super.allFields(
builder: (state) {
final bool readOnly = state.readOnly;
final bool value = state.value;
return SwitchListTile(
visualDensity: visualDensity,
enableFeedback: enableFeedback,
hoverColor: hoverColor,
focusNode: state.focusNode,
selected: selected,
value: value,
activeColor: activeColor,
activeTrackColor: activeTrackColor,
inactiveThumbColor: inactiveThumbColor,
inactiveTrackColor: inactiveTrackColor,
activeThumbImage: activeThumbImage,
inactiveThumbImage: inactiveThumbImage,
tileColor: tileColor,
title: title,
subtitle: subtitle,
isThreeLine: isThreeLine,
dense: dense,
secondary: secondary,
controlAffinity: controlAffinity,
autofocus: autofocus,
contentPadding: contentPadding,
shape: shape,
selectedTileColor: selectedTileColor,
onChanged: readOnly
? null
: (value) {
state.didChange(value);
state.requestFocusOnUserInteraction();
},
);
},
);