fetchResource method
Implementation
@override
Future<FetchResourceResponse?> fetchResource(
FetchResourceFormData formData,
) async {
try {
final response = await _dio.post(_fetchResource, data: formData.toJson());
if (response.data != null) {
return FetchResourceResponse.fromJson(response.data);
} else {
if (kDebugMode) {
debugPrint("[MAYYA CORE ERROR ON RESPONSE]");
debugPrint("[MAYYA CORE ERROR ON FETCH RESOURCE]");
}
}
} on DioException {
if (kDebugMode) {
debugPrint("[MAYYA CORE DIO ERROR]");
debugPrint("[MAYYA CORE ERROR ON FETCH RESOURCE]");
}
} catch (e) {
if (kDebugMode) {
debugPrint("[MAYYA CORE ERROR]");
debugPrint("[MAYYA CORE ERROR ON FETCH RESOURCE]");
}
}
return null;
}