Task.fromJson constructor

Task.fromJson(
  1. Map<String, dynamic> json
)

Creates Task object from JsonMap

Only used by subclasses. Use createFromJsonMap to create a properly subclassed Task from the json

Implementation

Task.fromJson(super.json)
    : taskId = json['taskId'] ?? '',
      filename = json['filename'] ?? '',
      directory = json['directory'] ?? '',
      baseDirectory =
          BaseDirectory.values[(json['baseDirectory'] as num?)?.toInt() ?? 0],
      group = json['group'] ?? FileDownloader.defaultGroup,
      updates = Updates.values[(json['updates'] as num?)?.toInt() ?? 0],
      requiresWiFi = json['requiresWiFi'] ?? false,
      allowPause = json['allowPause'] ?? false,
      priority = (json['priority'] as num?)?.toInt() ?? 5,
      metaData = json['metaData'] ?? '',
      displayName = json['displayName'] ?? '',
      super.fromJson();