如何以抖动方式通过编程获取Android导航栏的高度和宽度?

时间:2020-02-11 11:32:42

标签: flutter flutter-layout

如何获取此UI元素的高度和宽度(以像素为单位)?

How do I get the height and width of this UI element in pixel?

2 个答案:

答案 0 :(得分:3)

使用它来获取底部导航栏的高度

MediaQuery.of(context).viewInsets.bottom

答案 1 :(得分:0)

对我有用

最后的double navigationBarHeight = MediaQuery.of(context).padding.bottom