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