SwitchThemeData class

Defines the visual properties of Switch.

Descendant widgets obtain the current SwitchThemeData object using SwitchTheme.of(context). Instances of SwitchThemeData can be customized with SwitchThemeData.copyWith or SwitchThemeData.merge.

Inheritance
Mixed in types
Implementers
Annotations

Constructors

SwitchThemeData({required Curve curve, required Duration duration, required SwitchStyle style})
Creates a theme data that can be used for SwitchTheme.
const
SwitchThemeData.defaults(BuildContext context)
A SwitchThemeData with default values.
factory
SwitchThemeData.from([SwitchThemeData? other])
Creates a SwitchThemeData from another one that probably null.
SwitchThemeData.ios(BuildContext context)
A SwitchThemeData with ios default values.
factory
SwitchThemeData.m2(BuildContext context)
A SwitchThemeData with material 2 default values.
factory
SwitchThemeData.m3(BuildContext context)
A SwitchThemeData with material 3 default values.
factory

Properties

curve Curve
The curve to apply when animating the parameters of Switch widget.
final
duration Duration
The duration over which to animate the parameters of Switch widget.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style SwitchStyle
The SwitchStyle to be applied to the Switch widget
final
type Object
The extension's type.
no setterinherited

Methods

copyWith({Curve? curve, Duration? duration, SwitchStyle? style}) SwitchThemeData
Creates a copy of this SwitchThemeData but with the given fields replaced with the new values.
override
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
lerp(covariant ThemeExtension<SwitchThemeData>? other, double t) SwitchThemeData
Linearly interpolate with another ThemeExtension object.
override
merge(SwitchThemeData? other) SwitchThemeData
Creates a copy of this SwitchThemeData but with the given fields replaced with the new values.
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
toMap() Map<String, dynamic>
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Constants

fallback → const SwitchThemeData
A SwitchThemeData with some reasonable default values.