checkEmailExist method

Future<CheckEmailExistResponse> checkEmailExist(
  1. String email
)

Implementation

Future<CheckEmailExistResponse> checkEmailExist(String email) async {
  final url = Uri.parse('${_wepinBaseUrl}user/check-user?email=$email');
  final response = await http.get(url, headers: headers);

  if (response.statusCode >= 200 && response.statusCode < 300) {
    final responseBody = jsonDecode(response.body);
    return CheckEmailExistResponse.fromJson(responseBody);
  } else {
    throw WepinError(WepinErrorCode.apiRequestError, 'code: ${response.statusCode} , body: ${response.body}');
  }
}