我有 64 进制图像字符串。
如何将该图像保存到用户的移动设备?这是我尝试过的:
var response = await http.post('${Utility.serverUrl}/', body: (body));
final encodedStr = data['result'];
Uint8List bytes = base64.decode(encodedStr);
String dir = (await getApplicationDocumentsDirectory()).path;
File file = File("$dir/" + 'myimage' + ".jpg");
await file.writeAsBytes(bytes);
print(file.path);
Run Code Online (Sandbox Code Playgroud)
并在用户的画廊中显示该图像?