feat(app): short motion for collapsibles, badges, new runs and the action bar; none under reduced motion

This commit is contained in:
2026-10-23 22:05:30 +01:00
parent c467872ee3
commit ae43182a2b
9 changed files with 313 additions and 44 deletions
+40
View File
@@ -0,0 +1,40 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/ui/motion/motion.dart';
Widget _list(List<String> ids, {bool reduce = false}) => Directionality(
textDirection: TextDirection.ltr,
child: MediaQuery(
data: MediaQueryData(disableAnimations: reduce),
child: ArrivalScope(
ids: ids,
child: Column(
children: [
for (final id in ids)
Arrival(key: ValueKey(id), id: id, child: Text(id)),
],
),
),
),
);
Finder _fadeOf(String id) =>
find.ancestor(of: find.text(id), matching: find.byType(FadeTransition));
void main() {
testWidgets('only items after the first load fade in', (tester) async {
await tester.pumpWidget(_list(['a', 'b']));
expect(_fadeOf('a'), findsNothing);
await tester.pumpWidget(_list(['c', 'a', 'b']));
expect(_fadeOf('c'), findsOneWidget);
expect(_fadeOf('a'), findsNothing);
await tester.pumpAndSettle();
});
testWidgets('reduced motion shows arrivals at once', (tester) async {
await tester.pumpWidget(_list(['a'], reduce: true));
await tester.pumpWidget(_list(['b', 'a'], reduce: true));
expect(_fadeOf('b'), findsNothing);
});
}