How to get information such as device screen size, status bar height and so on in flutter?

How to get information such as device screen size, status bar height and so on in

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 ~

< hr >

is actually very simple:

// 
   double _statusBarHeight = MediaQuery.of(context).padding.top;
//MediaQuery.of(context)

// appbar 
   double _kLeadingWidth = kToolbarHeight;
Mar.25,2021

MediaQuery.of (context). Size can get the screen size, and https://github.com/jzoom/flut. can get the system bar height


Import import dart:ui;
you can do this directly:
window.devicePixelRatio gets the device pixel ratio;
window.physicalSize gets the screen size;
and other .

Import import 'dart:io';

you can view platform information

via platform library .
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b9fd55-2f4a8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b9fd55-2f4a8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?