getZendeskSections method

Future<List<HelpdeskSection>> getZendeskSections(
  1. num categoryId, {
  2. bool includeArticles = false,
})

Implementation

Future<List<HelpdeskSection>> getZendeskSections(num categoryId,
    {bool includeArticles = false}) async {
  List apiSections = await _platform
      .invokeMethod("getZendeskSections", {"categoryId": categoryId});
  List<HelpdeskSection> sections =
      apiSections.map((e) => HelpdeskSection.fromMap(e)).toList();
  if (includeArticles) {
    for (int i = 0; i < sections.length; i++) {
      HelpdeskSection section = sections[i];
      section.articles = await getZendeskArticles(section.id);
    }
  }
  return sections;
}