在Flutter中将字节数组转换为图像? [英] Converting a byte array to image in Flutter?

查看:149
本文介绍了在Flutter中将字节数组转换为图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的REST API服务中获取图像,但是还没有找到任何有关如何解码响应主体(在Flutter中是图像的字节数组)的文档?有一些有用资源的人,请帮助...

I want to get a image from my REST API service however haven't found any documentation on how to decode the response body that would be a byte array to an image in Flutter? Anyone with some useful resources, please help...

推荐答案

将其用于图像小部件:Image.memory(bytes).您可以在此处找到更多文档: https://docs.flutter.io/flutter/widgets/Image/Image.memory.html

Use this for your image widget: Image.memory(bytes) . You can find more documentation here: https://docs.flutter.io/flutter/widgets/Image/Image.memory.html

这篇关于在Flutter中将字节数组转换为图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆