我是不熟悉Flutter的人,我在运行代码时创建了一个没有应用栏和状态栏的屏幕,它的底部显示了空白。如果我尝试使用screenheight将其分为两部分,那么我的第二个容器就会出现ovrflowing。
但是该代码在iPhone屏幕上运行正常,
注意:我已从脚手架中删除了应用程序栏,并在main.dart中删除了通知栏
返回脚手架(// appBar:AppBar(title:Text('Screen Height')),正文:列(儿童:[展开(子代:容器(颜色:Colors.white),),展开(子代:容器(颜色:Colors.red),)],));
以main
方法获得全屏应用程序:
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await SystemChrome.setEnabledSystemUIOverlays([]);
runApp(MyApp());
}
要添加到@LoVe的答案中,您可能还想将extendBody:true
和extendBodyBehindAppBar: true
添加到支架中。