mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-29 07:34:13 +01:00
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:
1 parent
8ed4465776
commit
afb5bee33c
2 files changed
+18
-1
No files matched your search
@@ -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(
|
||||
|
||||
@@ -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', () {
|
||||
|
||||
Reference in new issue
Block a user