Skip to content
This repository was archived by the owner on Nov 24, 2022. It is now read-only.

Conversation

hacker1024
Copy link
Contributor

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.

@hacker1024
Copy link
Contributor Author

Any thoughts on this?

@AdamJonsson
Copy link
Owner

@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,

@hacker1024
Copy link
Contributor Author

I'm not too familiar with the new horizontal features. What needs to change?

@hacker1024
Copy link
Contributor Author

@AdamJonsson?

@Junama
Copy link

Junama commented Dec 9, 2021

I solve this with the positionFactor. this is the code
SnappingPosition.factor(
positionFactor: 0.95,
grabbingContentOffset: GrabbingContentOffset.top),

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants