使用此代码片段获取底部导航栏的高度
MediaQuery.of(context).viewInsets.bottom
final double navigationBarHeight = MediaQuery.of(context).padding.bottom
如果
final double navigationBarHeight = MediaQuery.of(context).padding.bottom
如果不起作用,请检查是否在内部调用此函数。
SafeArea是一个小部件,它使用Padding小部件消耗此填充,并自动从其子MediaQuery中删除它。