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,
}) {
return switch (state.extendedImageLoadState) {
LoadState.completed => hasLoaded
? state.completedWidget
: FadeImageBuilder(child: state.completedWidget),
LoadState.failed => failedItemBuilder(context),
LoadState.loading => const SizedBox.shrink(),
};
}