buildSuggestedChatsSectionUI method

dynamic buildSuggestedChatsSectionUI(
  1. dynamic context,
  2. dynamic ref,
  3. List<String> suggestedLocalChats,
  4. List suggestedRemoteChats,
)

Implementation

Widget buildSuggestedChatsSectionUI(
  BuildContext context,
  WidgetRef ref,
  List<String> suggestedLocalChats,
  List<SpaceHierarchyRoomInfo> suggestedRemoteChats,
) {
  final config = calculateSectionConfig(
    localListLen: suggestedLocalChats.length,
    limit: limit,
    remoteListLen: suggestedRemoteChats.length,
  );
  return Column(
    mainAxisAlignment: MainAxisAlignment.start,
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
      SectionHeader(
        title: L10n.of(context).suggestedChats,
        isShowSeeAllButton: true,
        onTapSeeAll: () => context.pushNamed(
          Routes.spaceChats.name,
          pathParameters: {'spaceId': spaceId},
        ),
      ),
      chatsListUI(
        ref,
        spaceId,
        suggestedLocalChats,
        config.listingLimit,
        showOptions: false,
        showSuggestedMarkIfGiven: false,
      ),
      if (config.renderRemote)
        renderRemoteChats(
          context,
          ref,
          spaceId,
          suggestedRemoteChats,
          config.remoteCount,
          showSuggestedMarkIfGiven: false,
          renderMenu: false,
        ),
    ],
  );
}