joinGroup method

Future joinGroup(
  1. Map<String, dynamic> params
)

Implementation

Future<dynamic> joinGroup(Map<String, dynamic> params) async {
  try {
    final formatedParams = V2TimGroupJoin.formatParams(params);
    final res =
        await wrappedPromiseToFuture(timeweb!.joinGroup(formatedParams));
    final code = res.code;
    final data = jsToMap(res.data);
    final result = data['status'] ?? data['groupID'];
    if (code == 0) {
      return CommonUtils.returnSuccessWithDesc(result);
    } else {
      return CommonUtils.returnSuccess("join group failed");
    }
  } catch (error) {
    return CommonUtils.returnError(error.toString());
  }
}