trackOutlineColor property
final
The outline color of this CupertinoSwitch's track.
Resolved in the following states:
This example resolves the trackOutlineColor based on the current
WidgetState of the CupertinoSwitch, providing a different Color when it is
WidgetState.disabled.
link
CupertinoSwitch(
value: true,
onChanged: (bool value) { },
trackOutlineColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return CupertinoColors.activeOrange.withOpacity(.48);
}
return null; // Use the default color.
}),
)
The CupertinoSwitch track has no outline by default.
Implementation
final WidgetStateProperty<Color?>? trackOutlineColor;