提交 5f38264a authored 作者: shixiaochen's avatar shixiaochen

1、优化列表空省图-StateLayout控价,加载包资源图片;

上级 b5abef3b
...@@ -55,6 +55,7 @@ class ImageWidget { ...@@ -55,6 +55,7 @@ class ImageWidget {
BoxFit? fit, BoxFit? fit,
String format = 'png', String format = 'png',
Color? color, Color? color,
String? package,
}) { }) {
return Image.asset( return Image.asset(
ImageUtils.getImgPath(image, format: format), ImageUtils.getImgPath(image, format: format),
...@@ -64,6 +65,7 @@ class ImageWidget { ...@@ -64,6 +65,7 @@ class ImageWidget {
cacheHeight: cacheHeight, cacheHeight: cacheHeight,
fit: fit, fit: fit,
color: color, color: color,
package: package,
/// 忽略图片语义 /// 忽略图片语义
excludeFromSemantics: true, excludeFromSemantics: true,
......
...@@ -77,6 +77,7 @@ class _StateLayoutState extends State<StateLayout> { ...@@ -77,6 +77,7 @@ class _StateLayoutState extends State<StateLayout> {
img, img,
width: 133.5 * 2, width: 133.5 * 2,
height: 95 * 2, height: 95 * 2,
package: "flutter_clx_base",
) )
: const SizedBox(), : const SizedBox(),
Text( Text(
......
...@@ -87,6 +87,8 @@ flutter: ...@@ -87,6 +87,8 @@ flutter:
# adding or updating assets for this project. # adding or updating assets for this project.
# To add assets to your plugin package, add an assets section, like this: # To add assets to your plugin package, add an assets section, like this:
assets:
- assets/images/
# assets: # assets:
# - images/a_dot_burr.jpeg # - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg # - images/a_dot_ham.jpeg
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论