retrieveActivity method

  1. @override
Future<LRSResponse<Activity>> retrieveActivity(
  1. String id
)
override

Retrieve a full description of an Activity from the LRS

Implementation

@override
Future<LRSResponse<Activity>> retrieveActivity(String id) async {
  final params = {
    'activityId': id,
  };
  final response =
      await _makeRequest('activities', 'GET', queryParams: params);

  if (response?.statusCode == 200) {
    return LRSResponse<Activity>(
      success: true,
      data: Activity.fromJson(json.decode(response.body)),
    );
  } else {
    return LRSResponse(
      success: false,
      errMsg: response?.body,
    );
  }
}