Check the picture…I am actually trying to create a container whose height should be the whole height of the viewport without considering the top safe area and also subtracting the bottom tab bar/nav bar height.
in other words: the device screen height minus the navbar minus the thing bellow to the navbar (the black one very in the bottom of the screen , bellow to the grey nav bar that belongs to the OS where you can swipe up and invoke a feature accordin with the device version/model)
I made several attempts with no success…This is my last one…
void _calculateBottomPadding() {
WidgetsBinding.instance.addPostFrameCallback((_) {
final viewInsets = MediaQuery.of(context).viewInsets.bottom;
final viewPadding = MediaQuery.of(context).viewPadding.bottom;
setState(() {
_bottomPadding = viewInsets > 0 ? viewInsets : viewPadding;
});
});
}
Container(
color: Colors.red,
width: MediaQuery.of(context).size.width,
height: (MediaQuery.of(context).size.height) -
MediaQuery.of(context).padding.bottom -
_bottomPadding -
kBottomNavigationBarHeight,
Any help?
2