getBanInfo method

Future<BanInfo?> getBanInfo()

Returns reason and expiration of the ban of the current user

Implementation

Future<BanInfo?> getBanInfo() async {
  return await NativeBridge.sync('CurrentUser.getBanInfo', '').then((value) {
    if (jsonDecode(value) == null) {
      return null;
    }
    Map<String, dynamic> decoded = jsonDecode(value);
    if (decoded['result'] != null && decoded['result'].isEmpty) {
      return null;
    }
    return BanInfo.fromJSON(decoded);
  });
}