viewer: fixed bottom overlay layout when keyboard is up
This commit is contained in:
parent
0dbb46d9bb
commit
62f0453665
2 changed files with 31 additions and 2 deletions
|
@ -4,7 +4,9 @@ import 'package:flutter/widgets.dart';
|
|||
|
||||
extension ExtraMediaQueryData on MediaQueryData {
|
||||
/*
|
||||
examples of MediaQuery props in practice, as of Flutter v1.22.5
|
||||
examples of MediaQuery props in practice
|
||||
|
||||
-- Flutter v1.22.5
|
||||
|
||||
S20, Android 11, portrait, notch top, button nav bar bottom
|
||||
padding EdgeInsets(0.0, 26.0, 0.0, 48.0)
|
||||
|
@ -35,6 +37,28 @@ extension ExtraMediaQueryData on MediaQueryData {
|
|||
padding EdgeInsets(0.0, 24.0, 0.0, 0.0)
|
||||
viewPadding EdgeInsets(0.0, 24.0, 0.0, 0.0)
|
||||
viewInsets EdgeInsets.zero
|
||||
|
||||
-- Flutter v2.2.1
|
||||
|
||||
S10e, Android 11, portrait, notch top, button nav bar bottom, keyboard off
|
||||
padding EdgeInsets(0.0, 39.0, 0.0, 48.0)
|
||||
viewPadding EdgeInsets(0.0, 39.0, 0.0, 48.0)
|
||||
viewInsets EdgeInsets.zero
|
||||
|
||||
S10e, Android 11, portrait, notch top, button nav bar bottom, keyboard on
|
||||
padding EdgeInsets(0.0, 39.0, 0.0, 0.0)
|
||||
viewPadding EdgeInsets(0.0, 39.0, 0.0, 48.0)
|
||||
viewInsets EdgeInsets(0.0, 0.0, 0.0, 338.0)
|
||||
|
||||
S10e, Android 11, portrait, notch top, gesture nav bar bottom, keyboard off
|
||||
padding EdgeInsets(0.0, 39.0, 0.0, 15.0)
|
||||
viewPadding EdgeInsets(0.0, 39.0, 0.0, 15.0)
|
||||
viewInsets EdgeInsets.zero
|
||||
|
||||
S10e, Android 11, portrait, notch top, gesture nav bar bottom, keyboard on
|
||||
padding EdgeInsets(0.0, 39.0, 0.0, 0.0)
|
||||
viewPadding EdgeInsets(0.0, 39.0, 0.0, 15.0)
|
||||
viewInsets EdgeInsets(0.0, 0.0, 0.0, 338.0)
|
||||
*/
|
||||
|
||||
double get effectiveBottomPadding => max(viewPadding.bottom, viewInsets.bottom);
|
||||
|
|
|
@ -92,7 +92,12 @@ class _ViewerBottomOverlayState extends State<ViewerBottomOverlay> {
|
|||
|
||||
return Container(
|
||||
color: hasEdgeContent ? kOverlayBackgroundColor : Colors.transparent,
|
||||
padding: viewInsets + viewPadding.copyWith(top: 0),
|
||||
padding: EdgeInsets.only(
|
||||
left: max(viewInsets.left, viewPadding.left),
|
||||
top: 0,
|
||||
right: max(viewInsets.right, viewPadding.right),
|
||||
bottom: max(viewInsets.bottom, viewPadding.bottom),
|
||||
),
|
||||
child: FutureBuilder<OverlayMetadata?>(
|
||||
future: _detailLoader,
|
||||
builder: (context, snapshot) {
|
||||
|
|
Loading…
Reference in a new issue