previewWidgetLoadStateChanged method
Widget
previewWidgetLoadStateChanged(
- BuildContext context,
- ExtendedImageState state, {
- bool hasLoaded = false,
Common image load state changed callback with Widget. 图片加载状态的部件回调
Implementation
Widget previewWidgetLoadStateChanged(
BuildContext context,
ExtendedImageState state, {
bool hasLoaded = false,
}) {
switch (state.extendedImageLoadState) {
case LoadState.completed:
if (hasLoaded) {
return state.completedWidget;
}
return FadeImageBuilder(child: state.completedWidget);
case LoadState.failed:
return failedItemBuilder(context);
case LoadState.loading:
return const SizedBox.shrink();
}
}