buildChatsSectionUI method

dynamic buildChatsSectionUI(
  1. dynamic context,
  2. dynamic ref,
  3. List<String> chats
)

Implementation

Widget buildChatsSectionUI(
  BuildContext context,
  WidgetRef ref,
  List<String> chats,
) {
  final relatedChats =
      ref.watch(remoteChatRelationsProvider(spaceId)).valueOrNull ?? [];
  final config = calculateSectionConfig(
    localListLen: chats.length,
    limit: limit,
    remoteListLen: relatedChats.length,
  );
  return Column(
    mainAxisAlignment: MainAxisAlignment.start,
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
      SectionHeader(
        title: L10n.of(context).chats,
        isShowSeeAllButton: config.isShowSeeAllButton,
        onTapSeeAll: () => context.pushNamed(
          Routes.spaceChats.name,
          pathParameters: {'spaceId': spaceId},
        ),
      ),
      chatsListUI(
        ref,
        spaceId,
        chats,
        config.listingLimit,
        showOptions: false,
      ),
      if (config.renderRemote)
        renderFurther(
          context,
          ref,
          spaceId,
          config.remoteCount,
        ),
    ],
  );
}