Skip to content

Commit 80136c4

Browse files
chrisbobbeMairramer
authored andcommitted
bottom_sheet: Clarify doc about behavior when useSafeArea is false (flutter#134793)
As discussed at flutter#122225 (comment), this is a docs change meant to help people in the absence of a fix for flutter#121752, which is being closed as WONTFIX.
1 parent c445896 commit 80136c4

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

packages/flutter/lib/src/material/bottom_sheet.dart

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,10 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> {
792792
/// dragged up and down and dismissed by swiping downwards.
793793
///
794794
/// The [useSafeArea] parameter specifies whether the sheet will avoid system
795-
/// intrusions on the top, left, and right. If false, no SafeArea is added
796-
/// and the top padding is consumed using [MediaQuery.removePadding].
795+
/// intrusions on the top, left, and right. If false, no [SafeArea] is added;
796+
/// and [MediaQuery.removePadding] is applied to the top,
797+
/// so that system intrusions at the top will not be avoided by a [SafeArea]
798+
/// inside the bottom sheet either.
797799
/// Defaults to false.
798800
///
799801
/// The optional [backgroundColor], [elevation], [shape], [clipBehavior],
@@ -979,8 +981,14 @@ class ModalBottomSheetRoute<T> extends PopupRoute<T> {
979981
/// If true, a [SafeArea] is inserted to keep the bottom sheet away from
980982
/// system intrusions at the top, left, and right sides of the screen.
981983
///
982-
/// If false, the bottom sheet isn't exposed to the top padding of the
983-
/// MediaQuery.
984+
/// If false, the bottom sheet will extend through any system intrusions
985+
/// at the top, left, and right.
986+
///
987+
/// If false, then moreover [MediaQuery.removePadding] will be used
988+
/// to remove top padding, so that a [SafeArea] widget inside the bottom
989+
/// sheet will have no effect at the top edge. If this is undesired, consider
990+
/// setting [useSafeArea] to true. Alternatively, wrap the [SafeArea] in a
991+
/// [MediaQuery] that restates an ambient [MediaQueryData] from outside [builder].
984992
///
985993
/// In either case, the bottom sheet extends all the way to the bottom of
986994
/// the screen, including any system intrusions.

0 commit comments

Comments
 (0)