ImageModel.fromMap constructor
Creates an ImageModel from a map returned by the native platform.
Implementation
factory ImageModel.fromMap(Map<String, dynamic> map) {
return ImageModel(
id: map['id'] as int? ?? 0,
name: map['name'] as String? ?? 'Unknown',
path: map['path'] as String?,
uri: map['uri'] as String? ?? '',
size: map['size'] as int? ?? 0,
dateAdded: map['dateAdded'] as int? ?? 0,
dateModified: map['dateModified'] as int? ?? 0,
width: map['width'] as int? ?? 0,
height: map['height'] as int? ?? 0,
mimeType: map['mimeType'] as String? ?? 'image/*',
fileExtension: map['fileExtension'] as String?,
);
}