-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScrollableSheet with maxPosition broken #265
Comments
Hi @Clon1998,
In what situations is this needed? I have always thought that exposing maxPosition was a flaw in the package’s API design during the early stages of development, as it is confusing and would be proportional(1) in almost all cases. I'm planning to remove that parameter from the sheet's constructor in a future release. |
It can be useful in cases where some of the content of the current page is useful to the user as reference. |
@Clon1998 Make sure ScrollableSheet(
maxPosition: const SheetAnchor.proportional(0.8),
minPosition: const SheetAnchor.proportional(0.8), // The default value is SheetAnchor.proportional(1.0)
initialPosition: const SheetAnchor.proportional(0.8),
); |
This solves some of the issues but still the last few items are unreachable: maxPosition: SheetAnchor.proportional(0.8),
initialPosition: SheetAnchor.proportional(0.8),
minPosition: SheetAnchor.proportional(0.8), Bildschirmaufnahme.2024-10-19.um.11.33.20.movHowever if I set different values for max, initial and min I can still observe the same issue as described in the initial reporting: maxPosition: SheetAnchor.proportional(0.8),
initialPosition: SheetAnchor.proportional(0.5),
minPosition: SheetAnchor.proportional(0.2), Bildschirmaufnahme.2024-10-19.um.11.36.19.mov |
That is the expected behavior when specifying If you want the sheet’s height to be 80% of the screen height, you can use LayoutBuilder like this: ScrollableSheet(
child: LayoutBuilder(
builder: (context, constraints) {
return SizedBox(
width: double.infinity,
height: constraints.maxHeight * 0.8,
child: ...,
);
},
),
); |
Mhhh. In that case, I don't understand why this property exists and why you intended to remove it, as there should be close to no use case in which a developer would want the content to be only 80% visible. |
Hey,
when using a
ScrollableSheet
withmaxPosition < proportional(1)
, there are a few problems:Example:
I am using GoRouter and this route definition:
Bildschirmaufnahme.2024-10-15.um.20.35.17.mov
The text was updated successfully, but these errors were encountered: