isFollowing static method

Future<Map<String, bool>> isFollowing(
  1. UserId id,
  2. FollowQuery query
)

Check if a user follows a community entity, like topic or user.

id User id. query Query parameter.

Implementation

static Future<Map<String, bool>> isFollowing(UserId id, FollowQuery query) {
  Map<String, dynamic> isFollowingBody = {
    'userId': id.toJSON(),
    'query': query.toJSON()
  };
  return NativeBridge.async(
          'Communities.isFollowing', jsonEncode(isFollowingBody))
      .then((result) {
    Map<String, dynamic> jsonMap = jsonDecode(result);
    return jsonMap.map((key, value) => MapEntry(key, value));
  });
}