flutter?
because UI is highly customized and material style is not suitable, you need to build your own navigation bar (or title bar). The height of the status bar is unknown, and the content is at the top of the screen. How to deal with it? there is no suitable library on Pub ~
.although the open source library device_info can obtain some device information, it does not seem to include information such as screen size, status bar height, and so on.
-
material is just too little known to use ~
is actually very simple:
//
double _statusBarHeight = MediaQuery.of(context).padding.top;
//MediaQuery.of(context)
// appbar
double _kLeadingWidth = kToolbarHeight;