UStorageEntry.fromJson constructor
UStorageEntry.fromJson(
- Map<
String, dynamic> json, - UStorageBucket bucket
Implementation
factory UStorageEntry.fromJson(Map<String, dynamic> json, UStorageBucket bucket) => UStorageEntry(
key: json["k"] as String,
bucket: bucket,
file: json["f"] as String,
size: (json["s"] as num).toInt(),
created: DateTime.fromMillisecondsSinceEpoch((json["c"] as num).toInt()),
accessed: DateTime.fromMillisecondsSinceEpoch((json["a"] as num).toInt()),
expires: json["e"] == null ? null : DateTime.fromMillisecondsSinceEpoch((json["e"] as num).toInt()),
mimeType: json["m"] as String?,
sha256: json["h"] as String?,
tags: (json["t"] as Map<String, dynamic>?)?.map((String k, dynamic v) => MapEntry<String, String>(k, "$v")) ?? const <String, String>{},
);