fix:图片使用图片缓存组件

This commit is contained in:
2026-01-20 18:01:43 +08:00
parent 740af2a459
commit 019850148f
8 changed files with 417 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
@@ -97,6 +98,27 @@ class CustomerImagesNetworking extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CachedNetworkImage(
imageUrl: imageUrl,
width: width,
height: height,
fit: fit,
errorWidget: (_, object, s) {
return Container(
width: width,
height: height,
padding: EdgeInsets.all((width ?? 0) / 2),
child: Center(
child: Image.asset(
'assets/images/noContainer.png',
// width: width /2,
// height: width /2,
fit: fit ?? BoxFit.contain,
),
),
);
},
);
return Image.network(
key: Key(imageUrl),
imageUrl,