FormeFluentToggleSwitch constructor
FormeFluentToggleSwitch({
- Key? key,
- String? name,
- bool initialValue = false,
- FormeAsyncValidator<
bool> ? asyncValidator, - Duration? asyncValidatorDebounce,
- AutovalidateMode? autovalidateMode,
- FormeFieldDecorator<
bool> ? decorator, - 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, - bool autofocus = false,
- Widget? content,
- String? semanticLabel,
- ToggleSwitchThemeData? style,
- bool leadingContent = false,
- Widget? thumb,
- dynamic thumbBuilder,
Implementation
FormeFluentToggleSwitch({
super.key,
super.name,
super.initialValue = false,
super.asyncValidator,
super.asyncValidatorDebounce,
super.autovalidateMode,
super.decorator,
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,
this.autofocus = false,
this.content,
this.semanticLabel,
this.style,
this.leadingContent = false,
this.thumb,
this.thumbBuilder,
}) : super.allFields(
builder: (state) {
return ToggleSwitch(
style: style,
content: content,
leadingContent: leadingContent,
semanticLabel: semanticLabel,
thumb: thumb,
thumbBuilder: thumbBuilder,
focusNode: state.focusNode,
autofocus: autofocus,
checked: state.value,
onChanged: readOnly
? null
: (v) {
state.didChange(v);
state.requestFocusOnUserInteraction();
});
},
);