Make LicensePage respect the notch (#25799)

This commit is contained in:
Michael Goderbauer
2019-01-02 10:01:39 -08:00
committed by GitHub
parent 9d477f3050
commit 28907c7950
2 changed files with 32 additions and 4 deletions

View File

@@ -472,10 +472,13 @@ class _LicensePageState extends State<LicensePage> {
context: context,
child: DefaultTextStyle(
style: Theme.of(context).textTheme.caption,
child: Scrollbar(
child: ListView(
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0),
children: contents,
child: SafeArea(
bottom: false,
child: Scrollbar(
child: ListView(
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0),
children: contents,
),
),
),
),

View File

@@ -108,4 +108,29 @@ void main() {
expect(find.text('Another package'), 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));
});
}