verifyOtp method

Future<Response> verifyOtp({
  1. required String otp,
  2. required int userId,
})

To verify user in whitelabel app user needs to use below API

Implementation

Future<http.Response> verifyOtp({
  required String otp,
  required int userId,
}) async {
  Uri url = Uri.parse("$_baseUrl/user/verify-otp");

  final body = jsonEncode({
    "otp": otp,
    "user": userId,
  });

  printMessage(body);

  http.Response response =
      await http.Client().post(url, body: body, headers: kPostRequestHeader);

  if (response.statusCode == 200) {
    printMessage("VERIFY OTP RESPONSE = ${response.body}");
    return response;
  } else {
    printMessage("VERIFY OTP RESPONSE = ${response.statusCode}");
    printMessage("VERIFY OTP RESPONSE = ${response.body}");
    return response;
  }
}