trackOutlineWidth property

MaterialStateProperty<double?>? trackOutlineWidth
final

The outline width of this Switch's track.

Resolved in the following states:

This example resolves the trackOutlineWidth based on the current WidgetState of the Switch, providing a different outline width when it is WidgetState.disabled.
link
Switch(
  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.
  }),
)

If specified, overrides the default value of Switch.trackOutlineWidth.

Implementation

final MaterialStateProperty<double?>? trackOutlineWidth;