Make LicensePage respect the notch (#25799)
This commit is contained in:
committed by
GitHub
parent
9d477f3050
commit
28907c7950
@@ -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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user