gpt4 book ai didi

dart - flutter 导航流程中的第二页不是全尺寸

转载 作者:IT王子 更新时间:2023-10-29 07:14:08 26 4
gpt4 key购买 nike

我正在尝试在 flutter 中创建一个基本的“新事件”

我已经关注了 flutters docs并制作了一个导航到下一页的按钮:

Navigator.push(context, new MaterialPageRoute(builder: (context)=> new HomePage(title: title,)));

这是第二个页面/事件(HomePage.dart)的构建方法

@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.
);
}

但是,第二页不是全尺寸:(注意缺少 float 操作按钮) flutter screenshot谁能告诉我哪里做错了?

更新在来自 googleSignIn 的回调中调用 Navigator.push((呈现模态)。所以稍微延迟一下就修复了这个错误。谢谢!

最佳答案

每当您在插入新路线之前弹出最后可见路线时,就会发生此图形错误。

考虑改用 pushReplacementpushReplacementNamed

关于dart - flutter 导航流程中的第二页不是全尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49878854/

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