I'm converting images saved in my Firebase database to Base64 and would like to decode and encode. I've researched similar questions, but am still getting errors. Here is what I have so far?
var image1 = String;
var pic = event.snapshot.value['image'];
var photo = BASE64.decode(pic);
image1 = photo;
I'm getting the following error...
A value of type "List<int>" cannot be assigned to a variable of type "Type"
If you could please provide a reverse process for encoding an image into Base64 so they may be saved back to Firebase, that would be appreciated.
*** UPDATE
Here is my updated code that's still throwing an error.
image1 = event.snapshot.value['image'];
var image = BASE64.decode(image1.toString());
new Image.memory(image),
The error is...
FormatException: Invalid Length must be a multiple of 4
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…