This repository was archived by the owner on Nov 24, 2022. It is now read-only.
Allow constraining sheet content to the maximum expanded sheet size#46
Open
hacker1024 wants to merge 2 commits intoAdamJonsson:mainfrom
Open
Allow constraining sheet content to the maximum expanded sheet size#46hacker1024 wants to merge 2 commits intoAdamJonsson:mainfrom
hacker1024 wants to merge 2 commits intoAdamJonsson:mainfrom
Conversation
Contributor
Author
|
Any thoughts on this? |
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, |
Contributor
Author
|
I'm not too familiar with the new horizontal features. What needs to change? |
Contributor
Author
|
I solve this with the positionFactor. this is the code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a
constrainToVisibleAreafield toSheetSizeFill. When this field is set tofalse, theSnappingSheetContentwith 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.