Skip to content

Commit

Permalink
fix: the keyboard blocked the content of bottom sheet (AppFlowy-IO#4706)
Browse files Browse the repository at this point in the history
* fix: the keyboard blocked the content of bottom sheet

* chore: apply suggestion

Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com>

---------

Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com>
  • Loading branch information
LucasXu0 and Xazin authored Feb 22, 2024
1 parent c06a034 commit ef83688
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
);
Expand All @@ -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),
);
Expand Down

0 comments on commit ef83688

Please sign in to comment.