trackOutlineWidth property
final
The outline width of this CupertinoSwitch's track.
Resolved in the following states:
This example resolves the trackOutlineWidth based on the current
WidgetState of the CupertinoSwitch, providing a different outline width when it is
WidgetState.disabled.
link
CupertinoSwitch(
value: true,
onChanged: (bool value) { },
trackOutlineWidth: WidgetStateProperty.resolveWith<double?>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return 5.0;
}
return null; // Use the default width.
}),
)
Since a CupertinoSwitch has no track outline by default, this parameter is set only if trackOutlineColor is provided.
Defaults to 2.0 if a trackOutlineColor is provided.
Implementation
final WidgetStateProperty<double?>? trackOutlineWidth;