Allow constraining sheet content to the maximum expanded sheet size
This PR adds a constrainToVisibleArea field to SheetSizeFill. When this field is set to false, the SnappingSheetContent with the behaviour will constrain its child to the constrains of the sheet in its completely expanded form.
This allows non-scrolling content to slide up, as the sheet will truly slide up instead of expand.
Any thoughts on this?
@hacker1024 Hi, sorry for the late reply. I usually use SheetSizeFill and the Stack widget as a child to make the sheet content behave as when constrainToVisibleArea is set to false in your PR. For example:
sheetBelow: SnappingSheetContent(
child: Stack(
alignment: Alignment.topCenter,
children: [
Container(
height: 200,
color: Colors.red,
)
],
),
),
However, your PR would make it easier for developers to create this behavior without needing to fiddle with the Stack Widget. If you feel up to it, could you add support for the new horizontal positions? I guess the only thing that needed to be edited is the following section:
alignment: location == SheetLocation.above
? Alignment.bottomCenter
: Alignment.topCenter,
I'm not too familiar with the new horizontal features. What needs to change?
@AdamJonsson?
I solve this with the positionFactor. this is the code
SnappingPosition.factor(
positionFactor: 0.95,
grabbingContentOffset: GrabbingContentOffset.top),