Files
SpotiFLAC-Mobile/test/scroll_edge_fade_test.dart
T
zarzet 01d766402c fix(metadata): enlarge the desktop cover and show the lyrics box scrolls
On desktop the track header takes more of the window height and the
cover grows to 260, close to the album header, instead of shrinking to
about 150 in a short window. The lyrics box fades at its cut while more
text follows and shows its scrollbar on desktop; ScrollEdgeFade can now
fade the content itself for cards and translucent surfaces.
2026-10-21 11:34:57 +07:00

44 lines
1.3 KiB
Dart

import 'package:flutter/material.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);
});
}