ReactiveSwitchListTile constructor

ReactiveSwitchListTile({
  1. Key? key,
  2. String? formControlName,
  3. FormControl<bool>? formControl,
  4. Color? tileColor,
  5. Color? activeColor,
  6. Color? activeTrackColor,
  7. Color? inactiveThumbColor,
  8. Color? inactiveTrackColor,
  9. Color? hoverColor,
  10. ImageProvider<Object>? activeThumbImage,
  11. ImageProvider<Object>? inactiveThumbImage,
  12. Widget? title,
  13. Widget? subtitle,
  14. bool isThreeLine = false,
  15. bool? dense,
  16. bool selected = false,
  17. bool autofocus = false,
  18. EdgeInsetsGeometry? contentPadding,
  19. Widget? secondary,
  20. ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
  21. ShapeBorder? shape,
  22. Color? selectedTileColor,
  23. VisualDensity? visualDensity,
  24. bool? enableFeedback,
  25. FocusNode? focusNode,
  26. ReactiveFormFieldCallback<bool>? onChanged,
  27. ImageErrorListener? onActiveThumbImageError,
  28. ImageErrorListener? onInactiveThumbImageError,
  29. WidgetStateProperty<Color?>? thumbColor,
  30. WidgetStateProperty<Color?>? trackColor,
  31. WidgetStateProperty<Color?>? trackOutlineColor,
  32. WidgetStateProperty<Icon?>? thumbIcon,
  33. MaterialTapTargetSize? materialTapTargetSize,
  34. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  35. MouseCursor? mouseCursor,
  36. WidgetStateProperty<Color?>? overlayColor,
  37. double? splashRadius,
  38. ValueChanged<bool>? onFocusChange,
})

Create an instance of a ReactiveCheckbox.

The formControlName arguments must not be null.

See also CheckboxListTile

Implementation

ReactiveSwitchListTile({
  super.key,
  super.formControlName,
  super.formControl,
  Color? tileColor,
  Color? activeColor,
  Color? activeTrackColor,
  Color? inactiveThumbColor,
  Color? inactiveTrackColor,
  Color? hoverColor,
  ImageProvider? activeThumbImage,
  ImageProvider? inactiveThumbImage,
  Widget? title,
  Widget? subtitle,
  bool isThreeLine = false,
  bool? dense,
  bool selected = false,
  bool autofocus = false,
  EdgeInsetsGeometry? contentPadding,
  Widget? secondary,
  ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
  ShapeBorder? shape,
  Color? selectedTileColor,
  VisualDensity? visualDensity,
  bool? enableFeedback,
  super.focusNode,
  ReactiveFormFieldCallback<bool>? onChanged,
  ImageErrorListener? onActiveThumbImageError,
  ImageErrorListener? onInactiveThumbImageError,
  WidgetStateProperty<Color?>? thumbColor,
  WidgetStateProperty<Color?>? trackColor,
  WidgetStateProperty<Color?>? trackOutlineColor,
  WidgetStateProperty<Icon?>? thumbIcon,
  MaterialTapTargetSize? materialTapTargetSize,
  DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  MouseCursor? mouseCursor,
  WidgetStateProperty<Color?>? overlayColor,
  double? splashRadius,
  ValueChanged<bool>? onFocusChange,
}) : super(
       builder: (field) {
         return SwitchListTile(
           value: field.value ?? false,
           activeColor: activeColor,
           activeTrackColor: activeTrackColor,
           inactiveThumbColor: inactiveThumbColor,
           inactiveTrackColor: inactiveTrackColor,
           mouseCursor: mouseCursor,
           overlayColor: overlayColor,
           splashRadius: splashRadius,
           onFocusChange: onFocusChange,
           thumbColor: thumbColor,
           trackColor: trackColor,
           dragStartBehavior: dragStartBehavior,
           materialTapTargetSize: materialTapTargetSize,
           thumbIcon: thumbIcon,
           trackOutlineColor: trackOutlineColor,
           onActiveThumbImageError: onActiveThumbImageError,
           onInactiveThumbImageError: onInactiveThumbImageError,
           hoverColor: hoverColor,
           activeThumbImage: activeThumbImage,
           title: title,
           subtitle: subtitle,
           isThreeLine: isThreeLine,
           dense: dense,
           contentPadding: contentPadding,
           secondary: secondary,
           inactiveThumbImage: inactiveThumbImage,
           tileColor: tileColor,
           selected: selected,
           autofocus: autofocus,
           controlAffinity: controlAffinity,
           shape: shape,
           selectedTileColor: selectedTileColor,
           visualDensity: visualDensity,
           enableFeedback: enableFeedback,
           focusNode: field.focusNode,
           onChanged:
               field.control.enabled
                   ? (value) {
                     field.didChange(value);
                     onChanged?.call(field.control);
                   }
                   : null,
         );
       },
     );