我想创建一个包含按钮的定制Scaffold,这样我就可以重用这个CustomScaffold.了目前,我需要将Scaffold的构造函数中的每个参数指定为我的输入参数。是否有更好的方法来扩展小部件?
class CustomScaffold {
// if I want to have fully customized Scaffold, I need to have the following (duplicate) parameters exactly the same what Scaffold defined
// Key key,
// this.appBar,
/
我试图为我的颤音应用程序构建一个简单的登录页面。我已经成功地构建了TextFields和登录/登录按钮。我想添加一个水平的ListView。当我运行代码时,我的元素就会消失,如果我不使用ListView就可以了。我怎么才能正确地做这件事?
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text("Login / Signup"),
),
body: new Container(
错误是:
The body might complete normally, causing 'null' to be returned, but the return type, 'FutureOr<List<Map<dynamic, dynamic>>>', is a potentially non-nullable type.
Try adding either a return or a throw statement at the end.
我试着添加了一个其他函数,但是我不知道该在哪里添加它。更别提了,我不知道这是