Adaptive Switch (#130425)

Currently, `Switch.factory` delegates to `CupertinoSwitch` when platform
is iOS or macOS. This PR is to:
* have the factory configure the Material `Switch` for the expected look
and feel.
* introduce `Adaptation` class to customize themes for the adaptive
components.
This commit is contained in:
Qun Cheng
2023-11-07 10:26:23 -08:00
committed by GitHub
parent a76720e9f6
commit ed70f4e248
9 changed files with 1470 additions and 273 deletions

View File

@@ -126,6 +126,12 @@ class _${blockName}DefaultsM3 extends SwitchThemeData {
});
}
@override
MaterialStateProperty<MouseCursor> get mouseCursor {
return MaterialStateProperty.resolveWith((Set<MaterialState> states)
=> MaterialStateMouseCursor.clickable.resolve(states));
}
@override
MaterialStatePropertyAll<double> get trackOutlineWidth => const MaterialStatePropertyAll<double>(${getToken('md.comp.switch.track.outline.width')});