ReactiveSwitchListTile constructor
ReactiveSwitchListTile({
- Key? key,
- String? formControlName,
- FormControl<
bool> ? formControl, - Color? tileColor,
- Color? activeColor,
- Color? activeTrackColor,
- Color? inactiveThumbColor,
- Color? inactiveTrackColor,
- Color? hoverColor,
- ImageProvider<
Object> ? activeThumbImage, - ImageProvider<
Object> ? 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,
- FocusNode? focusNode,
- ReactiveFormFieldCallback<
bool> ? onChanged,
Create an instance of a ReactiveCheckbox.
The formControlName
arguments must not be null.
See also CheckboxListTile
Implementation
ReactiveSwitchListTile({
Key? key,
String? formControlName,
FormControl<bool>? 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,
FocusNode? focusNode,
ReactiveFormFieldCallback<bool>? onChanged,
}) : super(
key: key,
formControl: formControl,
formControlName: formControlName,
focusNode: focusNode,
builder: (field) {
return SwitchListTile(
value: field.value ?? false,
activeColor: activeColor,
activeTrackColor: activeTrackColor,
inactiveThumbColor: inactiveThumbColor,
inactiveTrackColor: inactiveTrackColor,
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,
);
},
);