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.
This commit is contained in:
zarzet committed 2026-11-22 00:46:25 +07:00
1 parent 8ed4465776
commit afb5bee33c
2 files changed
+18 -1

No files matched your search

+2 -1
View File
@@ -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(
+16
View File
@@ -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', () {