Hello!
I'm struggling with getActivityStreams which is returning an empty list whatever I try.
Here is my code:
List<StreamSet> listFromStrava = await stravaClient.streams.getActivityStreams(myActivityId, ['time']);
When I try to catch data received, I have strange results:
` @OverRide
Future<List> getActivityStreams(
int activityId, List<String> keys) {
return ApiClient.getRequest(
endPoint: "/v3/activities/$activityId/streams",
queryParameters: {"keys": keys, "key_by_type": true},
dataConstructor: (data) {
log("Here is the data: $data"); <--- see output of log under the code
if (data is List) { <---- in fact data is not a List
return data
.map((e) => StreamSet.fromJson(Map<String, dynamic>.from(e)))
.toList();
}
return [];
});
}`
Log: Here is the data: {distance: {data: [0.0, 2.4, 4.3, 5.4, 6.2, 11.1, 19.1, 22.4, 23.5], series_type: distance, original_size: 1643, resolution: high}}
I should receive data regarding time, but I get distance. And data is not a List which explains why it always returns an empty List
When I try these keys ['latlng', 'altitude']
Here is the data: {
latlng: {data: [[49.269971, 0.202247], [49.269971, 0.202247], [49.269986, 0.202261], [49.269976, 0.20226], [49.26998, 0.20227], [49.269985, 0.20235], [49.270057, 0.202362], [49.27008, 0.202399], [49.270084, 0.202408], [49.270091, 0.2024], [49.270064, 0.202393]], series_type: distance, original_size: 1643, resolution: high},
distance: {data: [ 100.9, 100.9, 102.4, 103.9, 104.6, 104.6, 104.6, 105.8, 107.2, 112.1, 123.3, 129.8, 130.4, 130.4, 131.8, 132.6, 133.4, 135.1, 135.9, 137.8, 138.7, 140.2, 141.7, 144.6, 149.1, 155.3, 158.1, 164.2, 165.4, 168.5, 169.4, 170.1, 171.0, ], series_type: distance, original_size: 1643, resolution: high}
}
Again, distance is showing up
Am I doing something wrong? Could you help me?
Thanks!
Hello!
I'm struggling with getActivityStreams which is returning an empty list whatever I try.
Here is my code:
List<StreamSet> listFromStrava = await stravaClient.streams.getActivityStreams(myActivityId, ['time']);When I try to catch data received, I have strange results:
` @OverRide
Future<List> getActivityStreams(
}`
Log: Here is the data: {distance: {data: [0.0, 2.4, 4.3, 5.4, 6.2, 11.1, 19.1, 22.4, 23.5], series_type: distance, original_size: 1643, resolution: high}}
I should receive data regarding time, but I get distance. And data is not a List which explains why it always returns an empty List
When I try these keys ['latlng', 'altitude']
Here is the data: {
latlng: {data: [[49.269971, 0.202247], [49.269971, 0.202247], [49.269986, 0.202261], [49.269976, 0.20226], [49.26998, 0.20227], [49.269985, 0.20235], [49.270057, 0.202362], [49.27008, 0.202399], [49.270084, 0.202408], [49.270091, 0.2024], [49.270064, 0.202393]], series_type: distance, original_size: 1643, resolution: high},
distance: {data: [ 100.9, 100.9, 102.4, 103.9, 104.6, 104.6, 104.6, 105.8, 107.2, 112.1, 123.3, 129.8, 130.4, 130.4, 131.8, 132.6, 133.4, 135.1, 135.9, 137.8, 138.7, 140.2, 141.7, 144.6, 149.1, 155.3, 158.1, 164.2, 165.4, 168.5, 169.4, 170.1, 171.0, ], series_type: distance, original_size: 1643, resolution: high}
}
Again, distance is showing up
Am I doing something wrong? Could you help me?
Thanks!