map method
Implementation
Future<Map?> map(Picture pic) async {
if (pic.file != null) {
ImageFile file = pic.file!;
return upload(await file.bytes, file.mimeType!);
} else if (pic.url != null) {
// empty is the signal of unchaned in this project.
return {};
}
return null;
}