FormeFluentToggleSwitch constructor

FormeFluentToggleSwitch({
  1. Key? key,
  2. String? name,
  3. bool initialValue = false,
  4. FormeAsyncValidator<bool>? asyncValidator,
  5. Duration? asyncValidatorDebounce,
  6. AutovalidateMode? autovalidateMode,
  7. FormeFieldDecorator<bool>? decorator,
  8. bool enabled = true,
  9. FocusNode? focusNode,
  10. FormeFieldInitialized<bool>? onInitialized,
  11. FormeFieldSetter<bool>? onSaved,
  12. FormeFieldStatusChanged<bool>? onStatusChanged,
  13. int? order,
  14. bool quietlyValidate = false,
  15. bool readOnly = false,
  16. bool requestFocusOnUserInteraction = true,
  17. FormeFieldValidationFilter<bool>? validationFilter,
  18. FormeValidator<bool>? validator,
  19. bool autofocus = false,
  20. Widget? content,
  21. String? semanticLabel,
  22. ToggleSwitchThemeData? style,
  23. bool leadingContent = false,
  24. Widget? thumb,
  25. 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();
                    });
        },
      );