UCapturedPhoto.fromMap constructor
Implementation
factory UCapturedPhoto.fromMap(Map<Object?, Object?> map) {
final Object? rawMetadata = map["metadata"];
return UCapturedPhoto(
width: ((map["width"] as num?) ?? 0).toInt(),
height: ((map["height"] as num?) ?? 0).toInt(),
path: map["path"] as String?,
bytes: map["bytes"] as Uint8List?,
format: UPhotoFormat.values.firstWhere((UPhotoFormat f) => f.name == map["format"], orElse: () => UPhotoFormat.jpeg),
orientation: ((map["orientation"] as num?) ?? 0).toInt(),
mirrored: map["mirrored"] == true,
sizeInBytes: ((map["sizeInBytes"] as num?) ?? 0).toInt(),
thumbnail: map["thumbnail"] as Uint8List?,
metadata: rawMetadata is Map<Object?, Object?> ? rawMetadata.map((Object? k, Object? v) => MapEntry<String, Object?>(k.toString(), v)) : const <String, Object?>{},
);
}