Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix: the keyboard blocked the content of bottom sheet (#4706)

Lucas.Xuef8368890736
diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.dart b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.dart
index ba3a003c7e..de9a87925f 100644
--- a/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.dart
+++ b/frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.dart
@@ -120,9 +120,12 @@ Future<T?> showMobileBottomSheet<T>(
}
// ----- content area -----
+ // make sure the keyboard won't cover the content
children.add(
Padding(
- padding: padding,
+ padding: padding.copyWith(
+ bottom: padding.bottom + MediaQuery.of(context).viewInsets.bottom,
+ ),
child: child,
),
);
@@ -133,6 +136,8 @@ Future<T?> showMobileBottomSheet<T>(
}
// add default padding
+ // for full screen bottom sheet, the padding should be 16.0
+ // for non full screen bottom sheet, the padding should be 28.0
children.add(
VSpace(MediaQuery.of(context).padding.bottom == 0 ? 28.0 : 16.0),
);