gpt4 book ai didi

fullscreen - Flutter如何进入全屏模式

转载 作者:IT王子 更新时间:2023-10-29 06:41:37 29 4
gpt4 key购买 nike

我使用 setEnabledSystemUIOverlays 来隐藏状态栏和虚拟按钮栏。

但是屏幕顶部和底部有空白(如图所示):

Screen Photo

有人知道怎么解决吗?

这是我的代码:

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
SystemChrome.setEnabledSystemUIOverlays([]);
runApp(new MyApp());
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: "Test",
home: new MyHomePage(title: "Test"),
);
}
}

class MyHomePage extends StatelessWidget {
final String title;

MyHomePage({Key key, this.title}) : super(key: key);

@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(title),
),
body: new Container(
color: Colors.red,
),
);
}
}

最佳答案

将 resizeToAvoidBottomPadding: false 设置为脚手架。

   return Scaffold(
resizeToAvoidBottomPadding: false,
);

关于fullscreen - Flutter如何进入全屏模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50444233/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com