read method
Implementation
@override
Future<ProcessedData> read(
HealthResource resource, DateTime startDate, DateTime endDate) async {
try {
if (resource == HealthResource.caffeine ||
resource == HealthResource.mindfulSession) {
throw UnsupportedResourceException(
"Resource $resource is not supported on Android");
}
final result = await _channel.invokeMethod('read', <String, dynamic>{
"resource": resource.name,
"startDate": startDate.millisecondsSinceEpoch,
"endDate": endDate.millisecondsSinceEpoch,
});
return _mapJsonToProcessedData(resource, jsonDecode(result));
} on Exception catch (e) {
throw _mapException(e);
}
}