addToBlackList static method

Future<void> addToBlackList(
  1. String userId,
  2. dynamic finished(
    1. int? code
    )?
)

将用户加入黑名单,黑名单针对用户 id 生效,即使换设备也依然生效。

userId 需要加入黑名单的用户 id

finished 回调结果,code 为 0 代表操作成功,其他值代表失败

Implementation

static Future<void> addToBlackList(String userId, Function(int? code)? finished) async {
  Map map = {"userId": userId};
  int? code = await _channel.invokeMethod(RCMethodKey.AddToBlackList, map);
  if (finished != null) {
    finished(code);
  }
}