renderFurther function

dynamic renderFurther(
  1. dynamic context,
  2. dynamic ref,
  3. String spaceId,
  4. int? maxItems,
)

Implementation

Widget renderFurther(
  BuildContext context,
  WidgetRef ref,
  String spaceId,
  int? maxItems,
) {
  final relatedChatsLoader = ref.watch(remoteChatRelationsProvider(spaceId));
  return relatedChatsLoader.when(
    data: (chats) => renderRemoteChats(context, ref, spaceId, chats, maxItems),
    error: (e, s) {
      _log.severe('Failed to load the related chats', e, s);
      return Card(
        child: Text(L10n.of(context).errorLoadingRelatedChats(e)),
      );
    },
    loading: () => Skeletonizer(
      child: Card(
        child: Text(L10n.of(context).loadingOtherChats),
      ),
    ),
  );
}