DepartmentListFunction method

dynamic DepartmentListFunction()

Implementation

DepartmentListFunction() async {
  var decodedResponse;
  try {
    http.Response response = await http
        .get(Uri.parse('${SDK_BASE_URL}api/home_index/index'), headers: {
      "Authorization": SignUpController.currentUserToken,
    });
    decodedResponse = json.decode(response.body);

    DepartmentList = decodedResponse['department_filter']['departments'];
    DepartmentFilterList = decodedResponse['department']['departments'];
  } catch (e) {
    ErrorListner(
        apiname: 'api/home_index/index',
        responsed: "${decodedResponse}",
        request: '',
        app_error: '${e}');
  }
}