getLatestData method
Retrieve the latest produced data for a specific data type.
Returns the most recently produced SenseData for type or null if no
data is available or an error occurred while retrieving it.
Parameters
type: The DataType to request.
Returns
- SenseData?: The latest data for the requested type, or null when none is available.
See also:
- PositionService.position - Get the latest position data.
Implementation
SenseData? getLatestData(final DataType type) {
final OperationResult resultString = objectMethod(
pointerId,
'DataSourceContainer',
'getLatestData',
args: type.id,
);
if (resultString['gemApiError'] != 0) {
return null;
}
final dynamic result = resultString['result'];
if (result != null) {
return senseFromJson(result);
} else {
return null;
}
}