mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-28 23:25:52 +01:00
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.
44 lines
1.3 KiB
Dart
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);
|
|
});
|
|
}
|