The Cloud FireStore supports Bytes datatype, but failed to give an example of how to setting it, i am trying to upload a thumbnail image as bytes to the FireStore, in Flutter. Can someone give an example how to do it?
File imageFile;
final databaseReference = Firestore.instance;
await databaseReference
.collection("Users")
.document('${user.strId}')
.setData({'thumbnailPhoto': ???}); // how to convert imageFile to Bytes?
EDIT
I think both of the answers posted by Richard Heap and Jay Vasan work, using blob or base64Encode actually give the same value in FireStore under key thumbnailPhoto. I decide to give the bounty to Richard since it hides the details of the internal binary coding.