How can I use Expanded()
hammamziadeh10 opened this issue · comments
I'm using a bottom sheet and I have a column. The bottom sheet is set to maxsize (the default 0.9). I'm trying to place some content on the top of the screen and some content on the bottom. How can I achieve that? Using Expanded results in an error. Note: I don't want to use stickyActionBar.
I'm using a bottom sheet and I have a column. The bottom sheet is set to maxsize (the default 0.9). I'm trying to place some content on the top of the screen and some content on the bottom. How can I achieve that? Using Expanded results in an error. Note: I don't want to use trailingNabBarWidget.
can you provide some more context? Like code or ss?
I meant without the stickyActionBar (just corrected it). Basically, I used the example given and tried to change page1 (bottom sheet) content to my own content. I set the page settings to forceMaxHeight = true. I want to place half the content on the top and half on the bottom.
Here is the problem: I'm using a column and tried to use Expanded() and even Spacer() to separate the content but I get an error. So I assumed that it doesn't work that way.
Please let me know if this is not clear and you need an image/code example.
@hammamziadeh10 I am aware of the issue. The WoltModalSheet package is designed to have scrollable content by design, and I am working on a PR to support your case. Meanwhile, can you try this:
- Use SliverModalSheetPage and provide slivers with mainContentSlivers
- The non-expanding items should be on top, and wrapped with
SliverToBoxAdapter(child: item.content)
- The last item can be Expanded. To achieve this behavior, wrap your child:
SliverFillRemaining(hasScrollBody: false, child: widget)
Please let me know if this workaround helps.
@hammamziadeh10 Please check this draft PR and let me know if it is useful for you:
#127
Works great, thanks!
Fix is merged, and will be released with 0.4.0 this week.