LiteSwitch constructor
LiteSwitch({
- Key? key,
- required String name,
- LiteSwitchPosition switchPosition = LiteSwitchPosition.left,
- LiteSwitchReactionArea reactionArea = LiteSwitchReactionArea.full,
- ValueChanged<
bool> ? onChanged, - String? label,
- MarkdownTapLinkCallback? onTapLink,
- double paddingTop = 0.0,
- double paddingBottom = 0.0,
- double paddingLeft = 0.0,
- double paddingRight = 0.0,
- LiteFormValueSerializer serializer = nonConvertingValueConvertor,
- LiteFormValueSerializer? initialValueDeserializer,
- List<
LiteValidator> ? validators, - Object? initialValue,
- AutovalidateMode? autovalidateMode,
- LiteSwitchType type = LiteSwitchType.adaptive,
- CustomLiteToggleBuilder? customLiteToggleBuilder,
- Color? activeColor,
- ImageProvider<
Object> ? activeThumbImage, - Color? activeTrackColor,
- bool autofocus = false,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- Color? focusColor,
- FocusNode? focusNode,
- Color? hoverColor,
- Color? inactiveThumbColor,
- Color? inactiveTrackColor,
- MaterialTapTargetSize? materialTapTargetSize,
- MouseCursor? mouseCursor,
- ImageErrorListener? onActiveThumbImageError,
- ValueChanged<
bool> ? onFocusChange, - MaterialStateProperty<
Color?> ? overlayColor, - double? splashRadius,
- MaterialStateProperty<
Color?> ? thumbColor, - MaterialStateProperty<
Icon?> ? thumbIcon, - MaterialStateProperty<
Color?> ? trackColor, - EdgeInsets childPadding = const EdgeInsets.symmetric(vertical: 8.0),
- Widget? child,
- String? text,
- bool useMarkdown = false,
- bool readOnly = false,
- bool useSmoothError = true,
- MarkdownStyleSheet? markdownStyleSheet,
- TextStyle? style,
- ImageErrorListener? onInactiveThumbImageError,
- EdgeInsets? smoothErrorPadding = const EdgeInsets.only(top: 8.0),
- TextStyle? errorStyle,
Implementation
LiteSwitch({
Key? key,
required this.name,
this.switchPosition = LiteSwitchPosition.left,
this.reactionArea = LiteSwitchReactionArea.full,
this.onChanged,
this.label,
this.onTapLink,
this.paddingTop = 0.0,
this.paddingBottom = 0.0,
this.paddingLeft = 0.0,
this.paddingRight = 0.0,
this.serializer = nonConvertingValueConvertor,
this.initialValueDeserializer,
this.validators,
this.initialValue,
this.autovalidateMode,
this.type = LiteSwitchType.adaptive,
this.customLiteToggleBuilder,
this.activeColor,
this.activeThumbImage,
this.activeTrackColor,
this.autofocus = false,
this.dragStartBehavior = DragStartBehavior.start,
this.focusColor,
this.focusNode,
this.hoverColor,
this.inactiveThumbColor,
this.inactiveTrackColor,
this.materialTapTargetSize,
this.mouseCursor,
this.onActiveThumbImageError,
this.onFocusChange,
this.overlayColor,
this.splashRadius,
this.thumbColor,
this.thumbIcon,
this.trackColor,
this.childPadding = const EdgeInsets.symmetric(
vertical: 8.0,
),
this.child,
this.text,
this.useMarkdown = false,
this.readOnly = false,
this.useSmoothError = true,
this.markdownStyleSheet,
this.style,
this.onInactiveThumbImageError,
this.smoothErrorPadding = const EdgeInsets.only(
top: 8.0,
),
this.errorStyle,
}) : assert(
(child == null || text == null),
'You cannot pass both `text` and `child` at the same time',
),
super(key: key ?? Key(name));