Photos are taken with the Flutter Package image_picker and saved as variables of type "File". These images can be viewed with Flutter. From a jSON string photos in BASE64 format should be formatted into this data type in order to be able to display them. Does anyone know how this works?
It is possible to directly display BASE64 images with Flutter. The problem is that there is a "flickering" effect when rendering because the photos are reloaded each time a user types in. The framework does not seem to notice in BASE64 images that it's always the same photo. For photos in the file type, this problem does not occur.
Therefore I can not recommend rendering BASE64 strings directly. So I want to apply the conversion.
Does anyone have a solution how to convert the BASE64 string into a variable of type "File"?
var picturesTaken = <File>[];
Widget _showFoto(int currentFoto) {
return Padding(
padding: const EdgeInsets.only(bottom: 10.0),
child: Container(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Center(
child: Column(
children: <Widget>[
Image.file(picturesTaken[currentFoto])
],
),
),
),
)
);
}