getFriendList method

Implementation

Future<V2TimValueCallback<List<V2TimFriendInfo>>> getFriendList() async {
  try {
    final res = await wrappedPromiseToFuture(timeWeb!.getFriendList());

    final code = res.code;
    final friendList = res.data as List;
    if (code == 0) {
      final formateList = FriendList.formatedFriendListRes(friendList);
      return CommonUtils.returnSuccess<List<V2TimFriendInfo>>(formateList);
    } else {
      return CommonUtils.returnErrorForValueCb('get friend list failed');
    }
  } catch (error) {
    return CommonUtils.returnErrorForValueCb(error);
  }
}