202bef3539
- Replace all hardcoded Color literals outside lib/tema with theme tokens (new static brand palette in PluriWaveTokens); media notification uses the brand color instead of the Material default purple - Favorite button on station cards grows to a 48dp target and becomes an independent semantics node for screen readers (Semantics container fix) - All flutter_animate call sites route through the PluriAnimate reduced-motion gate (zero direct .animate() left) - Locale-aware short dates via intl DateFormat (new lib/l10n/formato_fechas.dart) replacing the hardcoded DD/MM/YYYY; proper plural messages for the favorites counter; example stream URL as a localized key - all 13 locales - Rounded shimmer placeholders matching card radii; shimmer loading state in search instead of a bare spinner; rounded icon variants unified in settings; bottom-sheet conventions on the custom station form - Fix latent debug crash: vacation editor read AppLocalizations in initState - 11 new tests (121 total green), flutter analyze clean
79 lines
2.2 KiB
Dart
79 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_animate/flutter_animate.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pluriwave/tema/pluri_animate.dart';
|
|
|
|
/// S5-R3: the central reduced-motion gate. When the OS reports
|
|
/// disableAnimations, the helpers must return the child UNANIMATED
|
|
/// (no [Animate] wrapper at all).
|
|
void main() {
|
|
Widget host({required bool reducedMotion, required WidgetBuilder builder}) {
|
|
return MediaQuery(
|
|
data: MediaQueryData(disableAnimations: reducedMotion),
|
|
child: Directionality(
|
|
textDirection: TextDirection.ltr,
|
|
child: Builder(builder: builder),
|
|
),
|
|
);
|
|
}
|
|
|
|
testWidgets('pluriFadeIn anima en modo normal', (tester) async {
|
|
await tester.pumpWidget(
|
|
host(
|
|
reducedMotion: false,
|
|
builder: (context) => const Text('hola').pluriFadeIn(context),
|
|
),
|
|
);
|
|
expect(find.byType(Animate), findsOneWidget);
|
|
await tester.pumpAndSettle();
|
|
});
|
|
|
|
testWidgets('pluriFadeIn devuelve el hijo intacto con reduced motion', (
|
|
tester,
|
|
) async {
|
|
await tester.pumpWidget(
|
|
host(
|
|
reducedMotion: true,
|
|
builder: (context) => const Text('hola').pluriFadeIn(context),
|
|
),
|
|
);
|
|
expect(find.byType(Animate), findsNothing);
|
|
expect(find.text('hola'), findsOneWidget);
|
|
});
|
|
|
|
testWidgets('pluriFadeSlideIn respeta el gate de reduced motion', (
|
|
tester,
|
|
) async {
|
|
await tester.pumpWidget(
|
|
host(
|
|
reducedMotion: true,
|
|
builder:
|
|
(context) =>
|
|
const Text('hola').pluriFadeSlideIn(context, beginY: 0.2),
|
|
),
|
|
);
|
|
expect(find.byType(Animate), findsNothing);
|
|
|
|
await tester.pumpWidget(
|
|
host(
|
|
reducedMotion: false,
|
|
builder:
|
|
(context) =>
|
|
const Text('hola').pluriFadeSlideIn(context, beginY: 0.2),
|
|
),
|
|
);
|
|
expect(find.byType(Animate), findsOneWidget);
|
|
await tester.pumpAndSettle();
|
|
});
|
|
|
|
testWidgets('pluriScaleIn respeta el gate de reduced motion', (tester) async {
|
|
await tester.pumpWidget(
|
|
host(
|
|
reducedMotion: true,
|
|
builder: (context) => const Text('hola').pluriScaleIn(context),
|
|
),
|
|
);
|
|
expect(find.byType(Animate), findsNothing);
|
|
});
|
|
}
|