userLogOut method

Future<Response> userLogOut()

To logout current logged in user in whitelabel app user needs to use below API

Implementation

Future<http.Response> userLogOut() async {
  Uri url = Uri.parse("$_baseUrl/user/logout");

  http.Response response =
      await http.Client().get(url, headers: kAuthenticatedGetRequestHeader);

  if (response.statusCode == 200) {
    printMessage("USER LOG OUT RESPONSE = ${response.body}");
    SharedPreference.setIsLogin(false);
    SharedPreference.setUser();
    kAuthenticatedPostRequestHeader = {
      "Accept": "application/json",
      "Content-Type": "application/json",
      "Authorization": "Token "
    };
    kAuthenticatedGetRequestHeader = {
      "Accept": "application/json",
      "Authorization": "Token "
    };
    return response;
  } else {
    printMessage("USER LOG OUT RESPONSE = ${response.statusCode}");
    printMessage("USER LOG OUT RESPONSE = ${response.body}");
    return response;
  }
}