proper way to get widget height in SafeArea

后端 未结 4 1956
轮回少年
轮回少年 2021-02-07 02:01

I\'m trying to get the height of widget but it prints the same values

I/flutter (19253): full height: 976.0
I/flutter (19253): safe height: 976.0
         


        
4条回答
  •  太阳男子
    2021-02-07 02:34

    I know that there is right answer, but maybe someone is looking for safe area height, not height of safe area widget child, but only safe area top padding:

    var safePadding = MediaQuery.of(context).padding.top;
    

提交回复
热议问题