get method

Future<DataPoint> get(
  1. int id
)

Get a DataPoint based on its id from the CARP backend.

Implementation

Future<DataPoint> get(int id) async {
  final url = "$dataEndpointUri/$id";
  final response = await service._get(url);

  // we expect a map with the data point in the response
  Map<String, dynamic> responseJson =
      service._handleResponse(response) as Map<String, dynamic>;
  return DataPoint.fromJson(responseJson);
}