From afb5bee33ccd8e736b230c036bc9b9637ecf819c Mon Sep 17 00:00:00 2001 From: zarzet <42882290+zarzet@users.noreply.github.com> Date: Sun, 22 Nov 2026 00:46:25 +0700 Subject: [PATCH] feat(motion): Mornye lists show rows at once The staggered row entrance is a Material pattern, so Mornye skips it. The stagger delay in Material follows Animation speed. --- lib/widgets/animation_utils.dart | 3 ++- test/loading_motion_test.dart | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/widgets/animation_utils.dart b/lib/widgets/animation_utils.dart index 0e8877a3a..a914f912f 100644 --- a/lib/widgets/animation_utils.dart +++ b/lib/widgets/animation_utils.dart @@ -52,6 +52,7 @@ class StaggeredListItem extends StatelessWidget { Widget build(BuildContext context) { if (!animate || index >= _maxAnimatedItems || + context.isMornye || MediaQuery.disableAnimationsOf(context)) { return child; } @@ -64,7 +65,7 @@ class StaggeredListItem extends StatelessWidget { return child; } final cappedIndex = index.clamp(0, _maxAnimatedItems - 1); - final delay = staggerDelay * cappedIndex; + final delay = MotionPace.duration(staggerDelay) * cappedIndex; // Expressive: each item springs up after its own delay and may // overshoot slightly, while its opacity follows the effects spring. final rise = AppMotion.spatial( diff --git a/test/loading_motion_test.dart b/test/loading_motion_test.dart index c1110165b..6feaf9eb3 100644 --- a/test/loading_motion_test.dart +++ b/test/loading_motion_test.dart @@ -1,6 +1,7 @@ import 'package:material_ui/material_ui.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mornye/theme/app_theme.dart'; +import 'package:mornye/theme/mornye_theme.dart'; import 'package:mornye/widgets/animation_utils.dart'; import 'package:mornye/widgets/decorative_phase.dart'; import 'package:mornye/widgets/loaded_sliver_fade_in.dart'; @@ -160,6 +161,21 @@ void main() { ); expect(itemOpacities(tester), isEmpty); }); + + testWidgets('Mornye skips list stagger and shows rows at once', ( + tester, + ) async { + await tester.pumpWidget( + MaterialApp( + theme: MornyeTheme.build(Brightness.light), + home: const Scaffold( + body: StaggeredListItem(index: 2, child: Text('row')), + ), + ), + ); + expect(itemOpacities(tester), isEmpty); + expect(find.text('row'), findsOneWidget); + }); }); group('ShimmerLoading', () {