isDownloaded property

bool get isDownloaded

Whether this model is downloaded and available locally

Implementation

bool get isDownloaded {
  final path = localPath;
  if (path == null) return false;

  // Built-in models are always available
  if (path.scheme == 'builtin') return true;

  // Check if file or directory exists
  final localFile = File(path.toFilePath());
  final localDir = Directory(path.toFilePath());

  if (localFile.existsSync()) return true;

  if (localDir.existsSync()) {
    final contents = localDir.listSync();
    return contents.isNotEmpty;
  }

  return false;
}