add image urlwithHost params

pull/1/head
张萌 3 years ago
parent 08c84470a5
commit 1414a2590f

@ -575,7 +575,7 @@ class _OrderCardState extends State<OrderCard> {
borderRadius: BorderRadius.circular(16.w),
),
child: BeeImageNetwork(
urls: [model.mainPhoto ?? ''],
urlsWithHost: [model.mainPhoto ?? ''],
height: 188.w,
width: 188.w,
),

@ -12,6 +12,7 @@ class BeeImageNetwork extends StatelessWidget {
final double? width;
final double? height;
final BoxFit? fit;
final List<String>? urlsWithHost;
const BeeImageNetwork(
{Key? key,
@ -19,17 +20,22 @@ class BeeImageNetwork extends StatelessWidget {
this.width,
this.height,
this.urls,
this.fit = BoxFit.cover})
: assert(imgs != null || urls != null),
this.fit = BoxFit.cover,
this.urlsWithHost})
: assert(imgs != null || urls != null || urlsWithHost != null),
super(key: key);
String get imgUrl => urlsWithHost == null
? imgs == null
? SAASAPI.image(urls!.isEmpty ? '' : urls!.first)
: SAASAPI.image(ImgModel.first(imgs))
: urlsWithHost!.first;
@override
Widget build(BuildContext context) {
return FadeInImage.assetNetwork(
placeholder: Assets.images.placeholder.path,
image: imgs == null
? SAASAPI.image(urls!.isEmpty ? '' : urls!.first)
: SAASAPI.image(ImgModel.first(imgs)),
image: imgUrl,
imageErrorBuilder: (context, obj, stackTrace) {
return Image.asset(
Assets.images.placeholder.path,

Loading…
Cancel
Save