DataItem.fromJson constructor

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

Implementation

factory DataItem.fromJson(Map<String, dynamic> json) {
  return DataItem(
      pathURI: Uri.tryParse(json["uri"]) ?? Uri(),
      data: json["data"] ?? Uint8List(0),
      mapData: (json["map"] as Map? ?? {})
          .map((key, value) => MapEntry(key.toString(), value)),
      files: (json["file_paths"] as Map? ?? {})
          .map((key, path) => MapEntry(key.toString(), File(path))));
}