getCategory method
Implementation
Future getCategory() async {
var decodedResponse;
try {
final response = await http.get(
Uri.parse('${medicine_API}api/medicine/medicine-category-details'),
headers: {'Authorization': currentUserToken},
);
decodedResponse = json.decode(response.body);
if (decodedResponse['success'] == true) {
getCategoryData = decodedResponse;
}
} catch (e) {
ErrorListner(
apiname: 'api/medicine/medicine-category-details',
responsed: "${decodedResponse}",
request: "",
app_error: '${e}');
}
}