getAnalyticByVcodeId method
Implementation
@override
Future<Analytics> getAnalyticByVcodeId(String vcode, String id) async {
try {
return await dio
.get(ApiEndpoints.ANALYTICS,
queryParameters: {'vcode': vcode, 'analytic_id': id},
options: Options(
validateStatus: (status) => status == 200 || status == 404))
.then((value) {
try {
return Analytics.fromJson(value.data);
} catch (e) {
logger.error(TAG, e.toString(), {'method': 'getAnalyticByVcodeId'});
}
return Analytics(list: []);
});
} on Exception catch (e) {
throw HttpHelper.decodeErrorResponse(e,
tag: TAG,
logger: logger,
defaultErrorMessage: 'Failed to get widget by vcode id',
meta: {
'widget': id,
'vcode': vcode,
'method': 'getAnalyticByVcodeId'
});
}
}