build method

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

Implementation

@override
Widget build(BuildContext context, WidgetRef ref) {
  final attachmentsLoader = ref.watch(attachmentsProvider(attachmentManager));
  return attachmentsLoader.when(
    data: (attachments) => attachmentData(attachments, context, ref),
    error: (e, s) {
      _log.severe('Failed to load attachments', e, s);
      return Text(L10n.of(context).errorLoadingAttachments(e));
    },
    loading: () => const Skeletonizer(
      child: Wrap(
        spacing: 5.0,
        runSpacing: 10.0,
        children: [],
      ),
    ),
  );
}