|
|
|
@ -157,13 +157,8 @@ class _MxcImageState extends State<MxcImage> {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final data = _imageData;
|
|
|
|
|
|
|
|
|
|
return AnimatedCrossFade(
|
|
|
|
|
duration: widget.animationDuration,
|
|
|
|
|
crossFadeState:
|
|
|
|
|
data == null ? CrossFadeState.showFirst : CrossFadeState.showSecond,
|
|
|
|
|
firstChild: placeholder(context),
|
|
|
|
|
secondChild: data == null || data.isEmpty
|
|
|
|
|
? const SizedBox.shrink()
|
|
|
|
|
return data == null || data.isEmpty
|
|
|
|
|
? placeholder(context)
|
|
|
|
|
: Image.memory(
|
|
|
|
|
data,
|
|
|
|
|
width: widget.width,
|
|
|
|
@ -176,7 +171,6 @@ class _MxcImageState extends State<MxcImage> {
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback(_tryLoad);
|
|
|
|
|
return placeholder(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|