Closed brizaldi closed 4 years ago
is it possible to set the MaxHeight of the panel the total available space that the panel can expand to. i.e. sliding panel as Expanded child
You can get height of your screen:
double height = MediaQuery.of(context).size.height
And use it as maxHeight
.
Remember that's possible get this code (double height = MediaQuery.of(context).size.height
) only from the Build
method of the Stateful/Stateless widget
I hope I have helped you
what if i want to use it inside tab bar with bottom navigation bar? because i want to set panel height to fill the space between appbar and bottom navigation bar
You can wrap all widgets into a Column
Scaffold(
appBar: null,
bottomNavigationBar: null
body: Column(
mainAxisSize: MainAxisSize.max,
children: [
TabBar,
Panel,
BottomNavBar,
]
)
)
honestly, I haven't tried if the code works, but it should do
@brizaldi There are flutter methods that allow you to get the preferred size of the bottom nav bars and app bars, so you can account for those using the method mentioned by @marchacio.
is it possible to set the MaxHeight of the panel the total available space that the panel can expand to. i.e. sliding panel as Expanded child