编写你的第一个 Flutter App [1/2]
将 build() 方法添加到 RandomWordState 中,如下所示:
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Startup Name Generator',
home: new RandomWords(),
);
}
不是 RandomWordState 类,应该是 MyApp 类:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Startup Name Generator',
home: new RandomWords(),
);
}
}