Added Switch Animation for Material 3 (#113090)

This commit is contained in:
Qun Cheng
2022-10-12 11:02:08 -04:00
committed by GitHub
parent a5ee67ef86
commit 91d88336dd
5 changed files with 466 additions and 183 deletions

View File

@@ -202,6 +202,18 @@ class _SwitchConfigM3 with _SwitchConfig {
@override
double get trackWidth => ${tokens['md.comp.switch.track.width']};
// The thumb size at the middle of the track. Hand coded default based on the animation specs.
@override
Size get transitionalThumbSize => const Size(34, 22);
// Hand coded default based on the animation specs.
@override
int get toggleDuration => 300;
// Hand coded default based on the animation specs.
@override
double? get thumbOffset => null;
}
''';