open method

Future<LoadedCourse?> open(
  1. String id
)

Abre o curso de id (assinatura, cifra e conteúdo) ou null se não está instalado ou não abre mais.

Implementation

Future<LoadedCourse?> open(String id) async {
  final bytes = await _blobs.get(blobId(id));
  if (bytes == null) return null;
  try {
    final course = await _readCourse(bytes);
    return LoadedCourse(
      course: course,
      files: ZipCourseFiles(await openEnvelope(bytes)),
      origin: CourseOrigin.installed,
    );
  } on Object {
    return null;
  }
}