when the bottom sheet appears it does not has that much height. but when a checkbox clicked in the bottom sheet it is expanding to the top regardless the screen size. what I have been trying to do is to set max height for bottom sheet. can’t find proper solution for that so far. any helps are welcome!
ps: what I have been trying do is open bottom sheet dialog as wrap content initially. after the checkbox is checked its height should have max value. in other words I want to expand it regarding the max height of bottom sheet that will be given.
senario:
- bottom model should be opened as
wrap_content
- when an item in bottom sheet is clicked the height of the bottom sheet should change to specific a value.
2
Answers
For the bottom sheet, you need to set the height of the sheet.
and before you set the height set to enable this option
Updated:
What you want is to update the state of the bottomsheet using StatefulBuilder
Here’s the sample code
Take note on isScrollControlled property and set it to
true