Unverified Commit 28907c79 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Make LicensePage respect the notch (#25799)

parent 9d477f30
...@@ -472,10 +472,13 @@ class _LicensePageState extends State<LicensePage> { ...@@ -472,10 +472,13 @@ class _LicensePageState extends State<LicensePage> {
context: context, context: context,
child: DefaultTextStyle( child: DefaultTextStyle(
style: Theme.of(context).textTheme.caption, style: Theme.of(context).textTheme.caption,
child: Scrollbar( child: SafeArea(
child: ListView( bottom: false,
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0), child: Scrollbar(
children: contents, child: ListView(
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0),
children: contents,
),
), ),
), ),
), ),
......
...@@ -108,4 +108,29 @@ void main() { ...@@ -108,4 +108,29 @@ void main() {
expect(find.text('Another package'), findsOneWidget); expect(find.text('Another package'), findsOneWidget);
expect(find.text('Another license'), findsOneWidget); expect(find.text('Another license'), findsOneWidget);
}); });
testWidgets('LicensePage respects the notch', (WidgetTester tester) async {
const double safeareaPadding = 27.0;
LicenseRegistry.addLicense(() {
return Stream<LicenseEntry>.fromIterable(<LicenseEntry>[
const LicenseEntryWithLineBreaks(<String>['ABC'], 'DEF')
]);
});
await tester.pumpWidget(
const MaterialApp(
home: MediaQuery(
data: MediaQueryData(
padding: EdgeInsets.all(safeareaPadding),
),
child: LicensePage(),
),
),
);
await tester.pumpAndSettle();
expect(tester.getTopLeft(find.text('DEF')), const Offset(8.0 + safeareaPadding, 527.0));
});
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment