build method

  1. @override
dynamic build(
  1. dynamic context,
  2. dynamic ref
)

Implementation

@override
Widget build(BuildContext context, WidgetRef ref) {
  final mediaState = ref.watch(attachmentMediaStateProvider(attachment));
  if (mediaState.mediaLoadingState.isLoading || mediaState.isDownloading) {
    return loadingIndication(context);
  } else if (mediaState.mediaFile == null) {
    return imagePlaceholder(context, attachment, mediaState, ref);
  } else {
    return imageUI(context, mediaState);
  }
}