DepartmentListFunction method
dynamic
DepartmentListFunction()
Implementation
DepartmentListFunction() async {
var decodedResponse;
try {
http.Response response =
await http.get(Uri.parse('${SDK_BASE_URL}home_api/index'), headers: {
"Authorization": SignUpController.currentUserToken,
});
decodedResponse = json.decode(response.body);
DepartmentList = decodedResponse['department_filter']['departments'];
DepartmentFilterList = decodedResponse['department']['departments'];
} catch (e) {
errorListner(
apiname: 'home_api/index',
responsed: "${decodedResponse}",
request: '',
app_error: '${e}');
}
}