-
project目录下新建文件夹,并导入图片,如下images
-
在project目录下找到文件pubspec.yaml
pubspec.yaml -
pubspec.yaml文件中找到 # assets:行,按照示例在下面配置asset路径
配置asset路径 在代码中使用
return Container(
child: Image.asset('images/testImg.png'),
);
在project目录下找到文件pubspec.yaml
pubspec.yaml文件中找到 # assets:行,按照示例在下面配置asset路径
在代码中使用
return Container(
child: Image.asset('images/testImg.png'),
);