I have a 'get' rest response as the picture, it returns in 64-bits value array. How can I convert these data to an image in Flutter?
The content-type is ‘application/octet-stream’ and 64 bits has to be converted to 8 bits to display the grayscale image.
I have tried base64.decode(response) but it throws me FormatException (FormatException: Invalid base64 data (at character 2)
[Postman response for 'get' request]: [1]: https://i.stack.imgur.com/FoxKR.png
Thank you
[Edit]: This is the request I make:
final response = await dio.get(
Consts.baseUrl + endPointUrl,
queryParameters: {
'_id': '5f6c5a7e8934b52296b957c5',
'type': 'contamination'
},
options: Options(
headers: {'Authorization': Consts.apiKey},
contentType: 'application/octet-stream'),
);