您可以使用:
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;
要获得SafeArea的高度(对于iOS 11及更高版本):
var padding = MediaQuery.of(context).padding;
double newheight = height - padding.top - padding.bottom;

您可以使用:
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;
要获得SafeArea的高度(对于iOS 11及更高版本):
var padding = MediaQuery.of(context).padding;
double newheight = height - padding.top - padding.bottom;