tagCollections property

Future<Map<String, List<String>>> tagCollections

Read the saved tag collections. Reading is asynchronous so as not to interfere with saving operations.

Implementation

Future<Map<String, List<String>>> get tagCollections async {
  Map<String, List<dynamic>>? rawTagCollections =
      await _channel.invokeMapMethod("user.fetch.tags");

  if (rawTagCollections == null) {
    throw BatchUserInternalError(code: 4);
  }

  Map<String, List<String>> castedTagCollections = {};
  rawTagCollections.forEach((key, value) {
    List<String> tags = List.castFrom(value);
    castedTagCollections[key] = tags;
  });
  return castedTagCollections;
}