【发布时间】:2018-11-19 12:18:12
【问题描述】:
我正在尝试将 AppBar 标题从 LoginWidget 级别更改为“登录”,但我不知道该怎么做。
它可能看起来像 IoC 模式,但我认为它应该仍然可以做到。
我现在正在尝试扩展一个 Scaffold 对象并为其添加一些方法,但它似乎不起作用。
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
backgroundColor: Colors.amber,
title: new Text("Application name")
),
body: new LoginWidget()
)
);
}
}
【问题讨论】: