-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add NonScrollingWoltModalSheetPage page type #127
Conversation
b7c9e31
to
bf188ed
Compare
final Widget child; | ||
|
||
/// Creates a page to be built within [WoltScrollableModalSheet]. | ||
FlexibleWoltModalSheetPage({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is flexible here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
07cf17b
to
a27a028
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
This PR introduces a new page type,
NonScrollingWoltModalSheetPage
, to theWoltModalSheet
package. The new page type extends the existingSliverWoltModalSheetPage
and is tailored for content that adapts to available vertical space without the necessity for scrolling. This enhancement is made to support the use cases where the content is flexible in height but does not exceed the modal sheet's maximum height.This addition came from the need to have a modal sheet page type that better suits content that is unlikely to require scrolling. This is particularly useful for modal content that dynamically sizes itself to the remaining space but remains within the viewport constraints, such as dynamic forms, confirmation dialogs, or any content with adaptive height requirements.
If content has a risk of exceeding the modal sheet's height, it is advisable to use SliverWoltModalSheetPage or WoltModalSheetPage for their scrolling capabilities.
Key Features
Flex Layout Compatibility: The new page type utilizes a Column with Flexible widgets, allowing content to stretch or compress based on the modal's height.
No Scroll Requirement: It's optimized for scenarios where the content fits within the viewport, making it an efficient choice for fixed or intrinsic sized content.
Simplified Content Specification: Developers can pass a single Widget as the main content, making the API cleaner and more intuitive.
Implementation Notes
FlexibleWoltModalSheetPage passes a SliverFillViewport with a single child to mainContentSlivers, ensuring that the content is laid out correctly within the modal sheet.
Default values and behavior are inherited from SliverWoltModalSheetPage, maintaining consistency within the package.
Usage Example
The code snippet below produces the screenshots attached in bottomsheet type. The dialog example shows the configuration without top bar.
How to test
Use the playground app, and select

WoltFlexibleSheetPage example