FormeSwitchTile constructor

FormeSwitchTile({
  1. Key? key,
  2. String? name,
  3. bool initialValue = false,
  4. FormeAsyncValidator<bool>? asyncValidator,
  5. Duration? asyncValidatorDebounce,
  6. AutovalidateMode? autovalidateMode,
  7. bool enabled = true,
  8. FocusNode? focusNode,
  9. FormeFieldInitialized<bool>? onInitialized,
  10. FormeFieldSetter<bool>? onSaved,
  11. FormeFieldStatusChanged<bool>? onStatusChanged,
  12. int? order,
  13. bool quietlyValidate = false,
  14. bool readOnly = false,
  15. bool requestFocusOnUserInteraction = true,
  16. FormeFieldValidationFilter<bool>? validationFilter,
  17. FormeValidator<bool>? validator,
  18. FormeFieldDecorator<bool>? decorator,
  19. bool tristate = false,
  20. Color? activeColor,
  21. ImageProvider<Object>? activeThumbImage,
  22. Color? activeTrackColor,
  23. bool autofocus = false,
  24. EdgeInsets? contentPadding,
  25. ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
  26. bool dense = false,
  27. bool? enableFeedback,
  28. Color? hoverColor,
  29. Color? inactiveThumbColor,
  30. ImageProvider<Object>? inactiveThumbImage,
  31. Color? inactiveTrackColor,
  32. bool isThreeLine = false,
  33. Widget? secondary,
  34. bool selected = false,
  35. Color? selectedTileColor,
  36. ShapeBorder? shape,
  37. Widget? subtitle,
  38. Color? tileColor,
  39. Widget? title,
  40. 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();
                  },
          );
        },
      );