AdaptiveSwitchListTile class
Creates a Material ListTile with an adaptive Switch, following Material design's Cross-platform guidelines.
This widget uses Switch.adaptive to change the graphics of the switch component.
On IOS CupertinoSwitch will be used. On Android a Material design Switch will be used.
If a CupertinoSwitch is created (on iOS), the following parameters are ignored: activeTrackColor, inactiveThumbColor, inactiveTrackColor, activeThumbImage, inactiveThumbImage.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SwitchListTile
- AdaptiveSwitchListTile
- Available extensions
Constructors
-
AdaptiveSwitchListTile({Key? key, Color? activeColor, Color? activeTrackColor, Color? inactiveThumbColor, Color? inactiveTrackColor, ImageProvider<
Object> ? activeThumbImage, ImageErrorListener? onActiveThumbImageError, ImageProvider<Object> ? inactiveThumbImage, 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, FocusNode? focusNode, ValueChanged<bool> ? onFocusChange, bool autofocus = false, bool? applyCupertinoTheme, Color? tileColor, Widget? title, Widget? subtitle, bool? isThreeLine = false, bool? dense, EdgeInsetsGeometry? contentPadding, Widget? secondary, bool selected = false, ListTileControlAffinity? controlAffinity = ListTileControlAffinity.platform, ShapeBorder? shape, Color? selectedTileColor, VisualDensity? visualDensity, bool? enableFeedback, Color? hoverColor, required bool value, required ValueChanged<bool> ? onChanged}) -
const
Properties
- activeColor → Color?
-
The color to use when this switch is on.
finalinherited
- activeThumbColor → Color?
-
The color to use when this switch is on.
finalinherited
-
activeThumbImage
→ ImageProvider<
Object> ? -
An image to use on the thumb of this switch when the switch is on.
finalinherited
- activeTrackColor → Color?
-
The color to use on the track when this switch is on.
finalinherited
- applyCupertinoTheme → bool?
-
Whether to apply the ambient CupertinoThemeData.
finalinherited
- autofocus → bool
-
True if this widget will be selected as the initial focus when no other
node in its scope is currently focused.
finalinherited
- contentPadding → EdgeInsetsGeometry?
-
The tile's internal padding.
finalinherited
- controlAffinity → ListTileControlAffinity?
-
Defines the position of control and secondary, relative to text.
finalinherited
- dense → bool?
-
Whether this list tile is part of a vertically dense list.
finalinherited
- dragStartBehavior → DragStartBehavior
-
Determines the way that drag start behavior is handled.
finalinherited
- enableFeedback → bool?
-
Whether detected gestures should provide acoustic and/or haptic feedback.
finalinherited
- focusNode → FocusNode?
-
An optional focus node to use as the focus node for this widget.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- horizontalTitleGap → double?
-
The horizontal gap between the titles and the leading/trailing widgets.
finalinherited
- hoverColor → Color?
-
The color for the tile's Material when a pointer is hovering over it.
finalinherited
- inactiveThumbColor → Color?
-
The color to use on the thumb when this switch is off.
finalinherited
-
inactiveThumbImage
→ ImageProvider<
Object> ? -
An image to use on the thumb of this switch when the switch is off.
finalinherited
- inactiveTrackColor → Color?
-
The color to use on the track when this switch is off.
finalinherited
- internalAddSemanticForOnTap → bool
-
Whether to add button:true to the semantics if onTap is provided.
This is a temporary flag to help changing the behavior of ListTile onTap semantics.
finalinherited
- isThreeLine → bool?
-
Whether this list tile is intended to display three lines of text.
finalinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- materialTapTargetSize → MaterialTapTargetSize?
-
Configures the minimum size of the tap target.
finalinherited
- minLeadingWidth → double?
-
The minimum width allocated for the ListTile.leading widget.
finalinherited
- minTileHeight → double?
-
The minimum height allocated for the ListTile widget.
finalinherited
- minVerticalPadding → double?
-
The minimum padding on the top and bottom of the title and subtitle widgets.
finalinherited
- mouseCursor → MouseCursor?
-
The cursor for a mouse pointer when it enters or is hovering over the
widget.
finalinherited
- onActiveThumbImageError → ImageErrorListener?
-
An optional error callback for errors emitted when loading
activeThumbImage.
finalinherited
-
onChanged
→ ValueChanged<
bool> ? -
Called when the user toggles the switch on or off.
finalinherited
-
onFocusChange
→ ValueChanged<
bool> ? -
Handler called when the focus changes.
finalinherited
- onInactiveThumbImageError → ImageErrorListener?
-
An optional error callback for errors emitted when loading
inactiveThumbImage.
finalinherited
-
overlayColor
→ WidgetStateProperty<
Color?> ? -
The color for the switch's Material.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondary → Widget?
-
A widget to display on the opposite side of the tile from the switch.
finalinherited
- selected → bool
-
Whether to render icons and text in the activeThumbColor.
finalinherited
- selectedTileColor → Color?
-
If non-null, defines the background color when SwitchListTile.selected is true.
finalinherited
- shape → ShapeBorder?
-
Defines the tile's InkWell.customBorder and Ink.decoration shape.
finalinherited
- splashRadius → double?
-
The splash radius of the circular Material ink response.
finalinherited
- statesController → WidgetStatesController?
-
Controls the interactive states of the backing ListTile.
finalinherited
- subtitle → Widget?
-
Additional content displayed below the title.
finalinherited
-
thumbColor
→ WidgetStateProperty<
Color?> ? -
The color of this switch's thumb.
finalinherited
-
thumbIcon
→ WidgetStateProperty<
Icon?> ? -
The icon to use on the thumb of this switch
finalinherited
- tileColor → Color?
-
Defines the background color of
ListTilewhen selected is false.finalinherited - title → Widget?
-
The primary content of the list tile.
finalinherited
-
trackColor
→ WidgetStateProperty<
Color?> ? -
The color of this switch's track.
finalinherited
-
trackOutlineColor
→ WidgetStateProperty<
Color?> ? -
The outline color of this Switch's track.
finalinherited
- value → bool
-
Whether this switch is checked.
finalinherited
- visualDensity → VisualDensity?
-
Defines how compact the list tile's layout will be.
finalinherited
Methods
-
applyDisabledEffect(
bool isDisabled, [double disabledOpacity = 0.5, bool? ignoringPointer]) → Widget -
Available on Widget, provided by the ApplyDisabledEffect extension
Wraps the current widget with anAnimatedOpacityto visually indicate whether the widget is enabled or disabled. -
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
inherited
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
margeWith(
Widget? child, [double? space = 4.0, Axis direction = Axis.horizontal]) → Widget -
Available on Widget, provided by the MergeToChild extension
Merges the current widget withchild, separated by a SizedBox. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited