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