getZendeskCategories method

Future<List<HelpdeskCategory>> getZendeskCategories({
  1. bool includeSections = false,
})

Implementation

Future<List<HelpdeskCategory>> getZendeskCategories(
    {bool includeSections = false}) async {
  List apiCats = await _platform.invokeMethod("getZendeskCategories");
  List<HelpdeskCategory> cats =
      apiCats.map((e) => HelpdeskCategory.fromMap(e)).toList();
  if (includeSections) {
    for (int i = 0; i < cats.length; i++) {
      HelpdeskCategory category = cats[i];
      category.sections = await getZendeskSectionsForCategory(category);
    }
  }
  return cats;
}