【发布时间】:2021-03-24 15:31:45
【问题描述】:
void main() {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
OrientationSingleton.left = true;
SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft])
.then((_) {
runApp(new MyApp());
});
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
这是我的应用程序。我找到了一些关于如何删除它的教程:flutter remove back button on appbar 但它适用于 AppBar。我尝试让我的应用在 AppBar 上运行,但我得到了
MediaQuery.of() called with a context that does not contain a MediaQuery.
因为我在我的应用程序中依赖MediaQuery.of()。
那么,对于MaterialApp,如何在 Flutter 上移除 Android 的返回、主页和方形按钮?
【问题讨论】: