Dart 颤振导航流中的第二页不是全尺寸
我正在尝试做一个基本的“新活动”在颤振 我已按照并制作了一个按钮,可通过以下内容导航到下一页:Dart 颤振导航流中的第二页不是全尺寸,dart,flutter,Dart,Flutter,我正在尝试做一个基本的“新活动”在颤振 我已按照并制作了一个按钮,可通过以下内容导航到下一页: Navigator.push(context, new MaterialPageRoute(builder: (context)=> new HomePage(title: title,))); 这是第二页/活动(HomePage.dart)的构建方法 @覆盖 小部件构建(构建上下文){ 归还新脚手架( appBar:新的appBar( 标题:新文本(“主页”), textTheme:orbi
Navigator.push(context, new MaterialPageRoute(builder: (context)=> new HomePage(title: title,)));
这是第二页/活动(HomePage.dart)的构建方法
@覆盖
小部件构建(构建上下文){
归还新脚手架(
appBar:新的appBar(
标题:新文本(“主页”),
textTheme:orbitTextTheme),
正文:新中心(
子容器:新容器(
颜色:颜色,橙色,
高度:150.0,
宽度:150.0,
子:新列(
儿童:[
新文本字段(
控制器:_textController,
装饰:新的输入装饰(
hintText:“是否尝试键入?”
),
)
],
),
),
),
floatingActionButton:新的floatingActionButton(
onPressed:_newReg,
工具提示:“新建注册表”,//外部化
背景颜色:Color.orange,
子:新图标(Icons.add),
),//此尾随逗号使生成方法的自动格式设置更方便。
);
}
但是,第二页不是完整的:(注意缺少浮动操作按钮)
谁能告诉我我做错了什么
更新
正在调用
Navigator.push(
在googleSignIn的回调中(显示模式)。因此,稍加延迟就修复了该错误。谢谢!每当您在推新路径之前弹出最后一条可见路径时,就会出现此图形错误
请考虑改用
pushReplacement
或pushReplacementNamed
。只要在推送新路径之前弹出最后一条可见路径,就会出现此图形错误
考虑改用
pushReplacement
或pushReplacementNamed
。您的问题不在您提供的代码中。每当您弹出最后一条可见路线,然后推送新路线时,图形错误就会发生one@R埃米,这就是我在做的吗?在我看来,我只是在推视图堆栈?@RémiRousselet你说得对!我在做登录到google的方法中的推送。这导致在我的推送之前弹出一个与您的评论相关的弹出窗口。请随意将其作为答案提交,我会接受。您提供的代码中没有您的问题。每当您弹出最后一个可见的路由,然后推送新的路由时,就会发生图形错误one@R埃米,这就是我在做的吗?就像我说的那样e it,我只是推到视图堆栈?@RémiRousselet你说得对!我是在一个登录到谷歌的方法中推的。这在推之前引起了一个弹出,与你的评论相关。请随意提交它作为答案,我会接受它。
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Home"),
textTheme: orbitTextTheme),
body: new Center(
child: new Container(
color: Color.orange,
height: 150.0,
width: 150.0,
child:new Column(
children: <Widget>[
new TextField(
controller: _textController,
decoration: new InputDecoration(
hintText: "Try to type?"
),
)
],
),
),
),
floatingActionButton: new FloatingActionButton(
onPressed: _newReg,
tooltip: 'New reg', //externalize
backgroundColor: Color.orange,
child: new Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}