flutter:
assets:
- assets/my_icon.png
- assets/background.png
如果要添加的资源太多,也可以添加文件夹,例如:
flutter:
assets:
- assets/
在本demo中,要添加一个背景图,我们在工程的根目录下创建images
目录,将背景图放在images
目录下,然后在pubspec.yaml
中添加:
flutter:
The following line ensures that the Material Icons font is
included with your application, so that you can use the icons in
the material Icons class.
uses-material-design: true
assets:
- images/
4.4 写WeatherWidget的UI布局
在Scaffold
中添加body
的属性,来写UI的布局,如下:
class WeatherState exten