gpt4 book ai didi

flutter - 我应用了debugshowcheckedmodebanner:false,但仍然在每个屏幕上显示调试标记

转载 作者:行者123 更新时间:2023-12-03 02:47:34 26 4
gpt4 key购买 nike

我有多个屏幕。所有屏幕都显示调试标记。我正在将debugshowcheckedmodebanner: false实现到我的主文件的 Material 应用中,但是debug标签显示在每个屏幕的右上方。我不确定我在哪里犯错。

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'dart:async';a
import 'home.dart';

void main() {
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: splash(),
));
}

class splash extends StatefulWidget {
@override
_splashState createState() => _splashState();
}

class _splashState extends State<splash> {

void initState() {
super.initState();
Timer(
Duration(seconds: 3),
() => Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => MyApp(),
),
));
}

@override
Widget build(BuildContext context) {
SystemChrome.setEnabledSystemUIOverlays([]);
Future<bool> _onBackPressed() {
return showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text("Do you want to exit?"),
actions: <Widget>[
FlatButton(
onPressed: () {
Navigator.pop(context, false);
},
child: Text("No")),
FlatButton(
onPressed: () {
Navigator.pop(context, true);
},
child: Text("yes"))
],
));
}

Orientatoin();
return WillPopScope(
child: Scaffold(
body: Stack(
fit: StackFit.expand,
children: <Widget>[
Container(
decoration: BoxDecoration(
color: Colors.transparent,
),
child: Image.asset('imges/splash.png'),
),

],
),
),
onWillPop: _onBackPressed,
);
}
}

void Orientatoin() {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]);
}

最佳答案

确保您没有从开发工具或android studio / Intellij屏幕右侧的flutter检查器面板中切换横幅。

在您拥有的代码中,它们是第3行中的额外a。请检查您的代码是否已编译,并且未运行旧版本的代码库。

关于flutter - 我应用了debugshowcheckedmodebanner:false,但仍然在每个屏幕上显示调试标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57925755/

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