fix:图片使用图片缓存组件
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user