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 MaterialState of the Switch, providing a different outline width when it is MaterialState.disabled.
link
Switch(
  value: true,
  onChanged: (bool value) { },
  trackOutlineWidth: MaterialStateProperty.resolveWith<double?>((Set<MaterialState> states) {
    if (states.contains(MaterialState.disabled)) {
      return 5.0;
    }
    return null; // Use the default width.
  }),
)

Defaults to 2.0.

Implementation

final MaterialStateProperty<double?>? trackOutlineWidth;