Issue
I have multiple screens. all the screens are showing debug tag. I am implementing debugshowcheckedmodebanner: false
, into material app of my main file but debug tag shows on right top of each of the screen. I am not sure where I am making mistake.
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]);
}
Solution
Make sure that you are not toggling the banner from dev tools or in the flutter inspector panel on the right hand side of the screen in android studio/Intellij.
In the code you have, their is an extra a
in line 3. check that your code compiles, and not running an older version of your code base.
Answered By - aligator
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.