Files
SpotiFLAC-Mobile/test/scroll_edge_fade_test.dart
zarzet 962e582acc chore(flutter): move to Flutter 3.50.0 and the material_ui packages
Flutter 3.50 deprecates its built-in Material and Cupertino libraries in
favour of the material_ui and cupertino_ui packages. The imports move
with the official fix (dart fix, migrate_design_widgets); the app's old
two-library theme bridge collapses into one Theme type.

- MaterialExpressiveScope keeps the complete host theme nearest its
  child. The reduced copy made for the expressive widgets now shares the
  app's Theme type and would hide component themes and extensions.
- LegacyThemeBrightness hands the brightness to the glass package, which
  still reads Flutter's built-in theme.
- appLocalizationsDelegates lists the material_ui localization delegates;
  the generated list still names the built-in ones.
- Tests: findByTooltip and pageBack replace the flutter_test helpers that
  only know the built-in widgets, and several tests that had gone stale
  against earlier app changes are repaired.
2026-11-15 23:33:29 +07:00

44 lines
1.3 KiB
Dart

import 'package:material_ui/material_ui.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mornye/widgets/scroll_edge_fade.dart';
void main() {
Future<void> pumpFade(WidgetTester tester, {required bool fadeContent}) =>
tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: SizedBox(
height: 200,
child: ScrollEdgeFade(
fadeContent: fadeContent,
size: 48,
child: ListView(
children: [
for (var i = 0; i < 30; i++)
SizedBox(height: 40, child: Text('Line $i')),
],
),
),
),
),
),
);
testWidgets('fadeContent masks the content instead of overlaying it', (
tester,
) async {
await pumpFade(tester, fadeContent: true);
await tester.pumpAndSettle();
expect(find.byType(ShaderMask), findsOneWidget);
expect(find.byType(DecoratedBox), findsNothing);
});
testWidgets('the default fade paints the background over the edge', (
tester,
) async {
await pumpFade(tester, fadeContent: false);
await tester.pumpAndSettle();
expect(find.byType(ShaderMask), findsNothing);
});
}