From 6056b2aaef7d8a186990137f9121620a4ec3bd6a Mon Sep 17 00:00:00 2001 From: halilyaman Date: Tue, 8 Feb 2022 16:13:19 +0300 Subject: [PATCH] Set bottomPanelOffset to zero when keyboard appears on screen to avoid unnecessary padding below the text field. --- device_preview/lib/src/device_preview.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/device_preview/lib/src/device_preview.dart b/device_preview/lib/src/device_preview.dart index b3ce3017..e0d4fc93 100644 --- a/device_preview/lib/src/device_preview.dart +++ b/device_preview/lib/src/device_preview.dart @@ -536,7 +536,11 @@ class _DevicePreviewState extends State { : BorderRadius.zero; final double rightPanelOffset = !isSmall ? (isEnabled ? ToolPanel.panelWidth - 10 : (64 + mediaQuery.padding.right)) : 0; - final double bottomPanelOffset = isSmall ? mediaQuery.padding.bottom + 52 : 0; + final double bottomPanelOffset = isSmall + ? mediaQuery.viewInsets.bottom > 0 + ? 0 + : mediaQuery.padding.bottom + 52 + : 0; return Stack( children: [ if (isToolbarVisible && isSmall)