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.
  }),
)

Defaults to 2.0.

Implementation

final MaterialStateProperty<double?>? trackOutlineWidth;