FileData.fromMap constructor
Factory constructor to map the data return from the method channel into a new FileData object
Implementation
factory FileData.fromMap(Map<String, dynamic>? data) {
var type = data?['fileType'];
FileType? fileType;
switch (type) {
case 'image':
fileType = FileType.image;
break;
case 'video':
fileType = FileType.video;
break;
default:
break;
}
return FileData(fileType: fileType, filePath: data?['path']);
}