Restored custom time. Added $styles.times to cloud animation.

This commit is contained in:
Alex Garneau
2025-03-28 10:41:47 -06:00
parent a737b5e275
commit f6fbfa55c8
2 changed files with 10 additions and 1 deletions

View File

@ -43,6 +43,9 @@ class AppStyle {
/// Animation Durations
late final _Times times = _Times(disableAnimations);
// Custom durations / delays
late final _CustomTime customTime = _CustomTime(disableAnimations);
/// Shared sizes
late final _Sizes sizes = _Sizes();
}
@ -143,6 +146,12 @@ class _Times {
late final Duration pageTransition = Duration(milliseconds: disabled ? 1 : 200);
}
class _CustomTime {
_CustomTime(this.disabled);
final bool disabled;
Duration ms(int ms) => Duration(milliseconds: disabled ? 1 : ms);
}
@immutable
class _Corners {
late final double sm = 4;

View File

@ -21,7 +21,7 @@ class AnimatedClouds extends StatefulWidget with GetItStatefulWidgetMixin {
class _AnimatedCloudsState extends State<AnimatedClouds> with SingleTickerProviderStateMixin, GetItStateMixin {
late List<_Cloud> _clouds = [];
List<_Cloud> _oldClouds = [];
late final AnimationController _anim = AnimationController(vsync: this, duration: 1500.ms);
late final AnimationController _anim = AnimationController(vsync: this, duration: $styles.customTime.ms(1500));
@override
void initState() {