constraints property Null safety

BoxConstraints? constraints

Defines minimum and maximum sizes for a BottomSheet.

Typically a bottom sheet will cover the entire width of its parent. However for large screens you may want to limit the width to something smaller and this property provides a way to specify a maximum width.

If null, then the ambient ThemeData.bottomSheetTheme's BottomSheetThemeData.constraints will be used. If that is null then the bottom sheet's size will be constrained by its parent (usually a Scaffold).

If constraints are specified (either in this property or in the theme), the bottom sheet will be aligned to the bottom-center of the available space. Otherwise, no alignment is applied.


final BoxConstraints? constraints;