buildLoadStateChanged static method

LoadStateChanged buildLoadStateChanged({
  1. Widget? failed,
  2. Widget? loading,
})

Implementation

static LoadStateChanged buildLoadStateChanged(
        {Widget? failed, Widget? loading}) =>
    (ExtendedImageState state) {
      switch (state.extendedImageLoadState) {
        case LoadState.loading:
          return loading ?? const ImageLoading(size: 16);
        case LoadState.completed:
          return null;
        case LoadState.failed:
          _logFailed(state);
          return failed ?? const ImageFailed(alignment: Alignment.center);
      }
    };