postSurveyQuestions static method

Future postSurveyQuestions(
  1. dynamic body,
  2. String url,
  3. Map<String, String> urlHeaders
)

Implementation

static Future<dynamic> postSurveyQuestions(
    dynamic body, String url, Map<String, String> urlHeaders) async {
  NetworkResponseData? response;
  try {
    response = await ApiHandler.postRequest(
      url: url,
      customHeaders: urlHeaders,
      apiFailureMessage: 'Unable to get tips',
      body: body,
    );
  } catch (apiRequestError) {
    PatientToast.showToast(message: 'Unable to post QUESTIONS (API)');
    return null;
  }

  if (response.hasError) {
    return null;
  }

  return response.status;
}