tincan 1.0.6 tincan: ^1.0.6 copied to clipboard
TincanDart in an implmentation of the Tin Can API for the Dart language
import 'package:tincan/tincan.dart';
main() async {
final lrs = RemoteLRS(
endpoint: '',
username: '',
password: '',
);
final statements = await lrs.queryStatements(StatementsQuery(limit: 10));
print('Statement count : ${statements.data?.statements?.length}');
_printStatements(statements?.data?.statements);
print('more at ${statements.data?.moreUrl}');
String more = statements.data?.moreUrl;
while (more != null) {
_printStatements(statements?.data?.statements);
final moreStatements = await lrs.moreStatements(more);
print('more at ${moreStatements.data?.moreUrl}');
more = moreStatements.data?.moreUrl;
}
}
void _printStatements(List<Statement> statements) {
statements?.forEach((statement) {
print(' Statement - ${statement.id}');
});
}