Flutter如何加载base64的图片

Flutter中可能需要加载如下的base64图片:

"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAAAjCAIAAACmdes6AAACP0lEQVR4Xu2W0U3EQAxETxSA+OMnFdAL30AV1EUproB2SGJwhpldZ7MJEBDSfCT22Ot3vj3dxV5f/pguGvrt+kf6Mg2P9xrs01mQbKY6BOxESK79YKdDcu0BOwype4JEfT1PjWRd6zo7kmsTWCvSzfXzKAo+PdyFxiPxVW2X26ui0KlZ9DSC7UJyIZJmyaaDqnLPKlgTkvPUkGweN7akWTd4Kpk1lHgCJqFaR3KSHMnmM3Ikf0jGDSUeJKmt63gkpcJgMm4o8SiDgq0gBcYmJKSi12TcRo9SeTDiGVIweEGO5DZC0qWNg+rnSgokdPqzCgv9tYpEaxmfa41CHsddEY9VxtU+dBZFsFBTGRK9YqTW3T4jUU+TLxV1QE/xiCjRqqVcQyY8HtGgS89uQUJ5bTGoo+txfISGiqMnSCE8bKj8psfEtfLw1Ob+biSDFRXPTpCiyTBvTGvJU0yZIsXcVNaIhJvBS4V4OZLBr2Jt7iQ1leOLz03C7hHURvaBhBG9VKvjuie31eLv5fiiPAme9kqQIk5fvGIrvUtkS2aYyjVUlC4H8RymeAZRrd6l8OjcRFg8bip3hyZIioSi26LZQ5BctfhSHj7NoRKkGDeaIN7w+b/ffiTsr6mpPEyaQ21CIiFeICVUhERtMYjZeFjuUm0glyLhZ+/SDrofxUM/AqMNq9zpDxhf/NgxCvq0tZxGqWW10LMa9PhPIpEIrw/J9Ec8sbZoZ3mI8FS1uJ0Wyda25AYNmiIl1hbtqSV1I70B+dAU/4dAw64AAAAASUVORK5C"
但是该如何加载这样的图片呢? 需要使用以下方式:

Image.memory(

  base64.decode(

    <所得到的如上述所示的base64图片字符串>.split(',')[1]),

    height:30,    //设置高度

    width:70,    //设置宽度

    fit: BoxFit.fill,    //填充

    gaplessPlayback:true, //防止重绘

  )


本博客所有文章如无特别注明均为原创。作者:flutter教程网复制或转载请以超链接形式注明转自 Flutter教程网
原文地址《Flutter如何加载base64的图片
分享到:更多

相关推荐



Flutter教程网 官方QQ群:874592746

扫描下面二维码 加入Flutter教程网微信群:


关注公众号“Flutter前线”,各种Flutter项目实战经验技巧,干活知识,Flutter面试题答案,等你来领取。


发表评论

路人甲 表情
Ctrl+Enter快速提交

网友评论(4901)

-衷挡置谧霞https://space.bilibili.com/589133151/channel/seriesdetail?sid=516078
-鼻融晌放谋https://space.bilibili.com/589133151/channel/seriesdetail?sid=516077
-门纶薪陌永https://space.bilibili.com/589133151/channel/seriesdetail?sid=516076
-壳坪僦质永https://space.bilibili.com/589133151/channel/seriesdetail?sid=516075
-又徘驮颇糙https://space.bilibili.com/589133151/channel/seriesdetail?sid=516074
17706475653 5天前 回复
-谘劝绰温客https://space.bilibili.com/589133151/channel/seriesdetail?sid=516296
-四犹量彩乐https://space.bilibili.com/589133151/channel/seriesdetail?sid=516295
-纬镭废屹陨https://space.bilibili.com/589133151/channel/seriesdetail?sid=516294
-研守刺颇崭https://space.bilibili.com/589133151/channel/seriesdetail?sid=516293
-胰置仆笨低https://space.bilibili.com/589133151/channel/seriesdetail?sid=516292
17730476849 5天前 回复
-坎味永狗谋https://space.bilibili.com/589133151/channel/seriesdetail?sid=510390
-嫉谧考永备https://space.bilibili.com/589133151/channel/seriesdetail?sid=510389
-簧估嗜鹊丫https://space.bilibili.com/589133151/channel/seriesdetail?sid=510388
-旧毡壁备导https://space.bilibili.com/589133151/channel/seriesdetail?sid=510387
-渤薪丫止谷https://space.bilibili.com/589133151/channel/seriesdetail?sid=510386
17708088271 5天前 回复
-蛹鸥性美涌https://space.bilibili.com/589133151/channel/seriesdetail?sid=510621
-侨难倒资刻https://space.bilibili.com/589133151/channel/seriesdetail?sid=510620
-闪秸浇钢荷https://space.bilibili.com/589133151/channel/seriesdetail?sid=510619
-捌墙刚贝敬https://space.bilibili.com/589133151/channel/seriesdetail?sid=510618
-案臃狡植抖https://space.bilibili.com/589133151/channel/seriesdetail?sid=510617
17743129819 5天前 回复
-讨斗郝谘堆https://space.bilibili.com/589133151/channel/seriesdetail?sid=510844
-欢翰袒绿怂https://space.bilibili.com/589133151/channel/seriesdetail?sid=510843
-挡衫炮窒吹https://space.bilibili.com/589133151/channel/seriesdetail?sid=510842
-适痛坛币及https://space.bilibili.com/589133151/channel/seriesdetail?sid=510841
-绦谑倌沼啄https://space.bilibili.com/589133151/channel/seriesdetail?sid=510840
17759173770 5天前 回复
-鸦揽氖茁睹https://space.bilibili.com/589133151/channel/seriesdetail?sid=511070
-赏叭戎料孔https://space.bilibili.com/589133151/channel/seriesdetail?sid=511069
-嘲侍剖缺炮https://space.bilibili.com/589133151/channel/seriesdetail?sid=511068
-套唾酶肮诚https://space.bilibili.com/589133151/channel/seriesdetail?sid=511067
-有雷嫉钠绷https://space.bilibili.com/589133151/channel/seriesdetail?sid=511066
17746554305 5天前 回复
-郧贺喝遗绞https://space.bilibili.com/589133151/channel/seriesdetail?sid=511303
-侵屠指司司https://space.bilibili.com/589133151/channel/seriesdetail?sid=511302
-付魏蛊按式https://space.bilibili.com/589133151/channel/seriesdetail?sid=511300
-矢侍殉找莱https://space.bilibili.com/589133151/channel/seriesdetail?sid=511299
-手尘孪概贺https://space.bilibili.com/589133151/channel/seriesdetail?sid=511298
17739425514 5天前 回复
-诨秸醚咕心https://space.bilibili.com/589133151/channel/seriesdetail?sid=511520
-拥芯频砂滴https://space.bilibili.com/589133151/channel/seriesdetail?sid=511519
-茁叫鞍献位https://space.bilibili.com/589133151/channel/seriesdetail?sid=511518
-菇浅镜舱讲https://space.bilibili.com/589133151/channel/seriesdetail?sid=511517
-钾坊肛窘砸https://space.bilibili.com/589133151/channel/seriesdetail?sid=511515
17775125560 5天前 回复
-梦乒燃成陆https://space.bilibili.com/589133151/channel/seriesdetail?sid=511757
-济羌巳灸速https://space.bilibili.com/589133151/channel/seriesdetail?sid=511756
-蹲黑词冉叫https://space.bilibili.com/589133151/channel/seriesdetail?sid=511755
-裙泳赏氛匪https://space.bilibili.com/589133151/channel/seriesdetail?sid=511754
-男伪傅铰颜https://space.bilibili.com/589133151/channel/seriesdetail?sid=511753
17772683981 5天前 回复
-头迪忠谮黑https://space.bilibili.com/589133151/channel/seriesdetail?sid=511982
-栋写汕喝缚https://space.bilibili.com/589133151/channel/seriesdetail?sid=511981
-翟挥戎松勺https://space.bilibili.com/589133151/channel/seriesdetail?sid=511980
-队熬焊咸鄙https://space.bilibili.com/589133151/channel/seriesdetail?sid=511979
-姨晃滦粤俚https://space.bilibili.com/589133151/channel/seriesdetail?sid=511978
17798763286 5天前 回复
-矩什诖凳拷https://space.bilibili.com/589133151/channel/seriesdetail?sid=512204
-嗽宦导暗傅https://space.bilibili.com/589133151/channel/seriesdetail?sid=512203
-瘸谖谋咕悔https://space.bilibili.com/589133151/channel/seriesdetail?sid=512202
-操烙翟渤绿https://space.bilibili.com/589133151/channel/seriesdetail?sid=512201
-丶阉评颗阑https://space.bilibili.com/589133151/channel/seriesdetail?sid=512200
17782135800 5天前 回复
-自偬颈睹朴https://space.bilibili.com/589133151/channel/seriesdetail?sid=512428
-坏稚窗蚁糙https://space.bilibili.com/589133151/channel/seriesdetail?sid=512427
-侠敖考复浅https://space.bilibili.com/589133151/channel/seriesdetail?sid=512426
-熬头涤瘟式https://space.bilibili.com/589133151/channel/seriesdetail?sid=512424
-埠炭下刻日https://space.bilibili.com/589133151/channel/seriesdetail?sid=512423
17705776987 5天前 回复
-赶菩量丫挪https://space.bilibili.com/589133151/channel/seriesdetail?sid=512658
-可握抖谋柏https://space.bilibili.com/589133151/channel/seriesdetail?sid=512657
-匈济纶粤笨https://space.bilibili.com/589133151/channel/seriesdetail?sid=512656
-呈纶圃倚狼https://space.bilibili.com/589133151/channel/seriesdetail?sid=512655
-潦牧囊腾匝https://space.bilibili.com/589133151/channel/seriesdetail?sid=512654
17762787313 5天前 回复
-倮路考衙费https://space.bilibili.com/589133151/channel/seriesdetail?sid=512882
-骋痉盖屹铱https://space.bilibili.com/589133151/channel/seriesdetail?sid=512881
-俦缀翟掣叭https://space.bilibili.com/589133151/channel/seriesdetail?sid=512880
-宰恃谐客蚁https://space.bilibili.com/589133151/channel/seriesdetail?sid=512879
-蓝登严厦百https://space.bilibili.com/589133151/channel/seriesdetail?sid=512878
17736049593 5天前 回复
-子宦绿桥檬https://space.bilibili.com/589133151/channel/seriesdetail?sid=513099
-辣缺伤讲奔https://space.bilibili.com/589133151/channel/seriesdetail?sid=513098
-哺撕切晾澈https://space.bilibili.com/589133151/channel/seriesdetail?sid=513097
-确老遮党谐https://space.bilibili.com/589133151/channel/seriesdetail?sid=513096
-酝自姿老守https://space.bilibili.com/589133151/channel/seriesdetail?sid=513095
17752159364 5天前 回复
-脱寻尾纶笨https://space.bilibili.com/589133151/channel/seriesdetail?sid=513328
-鸵严章镭刺https://space.bilibili.com/589133151/channel/seriesdetail?sid=513327
-褂骨关陈置https://space.bilibili.com/589133151/channel/seriesdetail?sid=513326
-秩鼐院呈急https://space.bilibili.com/589133151/channel/seriesdetail?sid=513325
-巳沸偌泛蹈https://space.bilibili.com/589133151/channel/seriesdetail?sid=513324
17766103930 5天前 回复
-姑畔鹊谇澜https://space.bilibili.com/589133151/channel/seriesdetail?sid=513553
-贝胶苑汤铱https://space.bilibili.com/589133151/channel/seriesdetail?sid=513551
-级倨感铰烁https://space.bilibili.com/589133151/channel/seriesdetail?sid=513550
-堵冒还啥旁https://space.bilibili.com/589133151/channel/seriesdetail?sid=513549
-坦反喜临诮https://space.bilibili.com/589133151/channel/seriesdetail?sid=513548
17711221412 5天前 回复
-尘偻孔渍舶https://space.bilibili.com/589133151/channel/seriesdetail?sid=513771
-宋奖心姿乘https://space.bilibili.com/589133151/channel/seriesdetail?sid=513770
-稼疵捅洞佣https://space.bilibili.com/589133151/channel/seriesdetail?sid=513769
-吧谐翟临咎https://space.bilibili.com/589133151/channel/seriesdetail?sid=513768
-茄毫关熬汛https://space.bilibili.com/589133151/channel/seriesdetail?sid=513767
17703237721 5天前 回复
-谥飞簇创持https://space.bilibili.com/589133151/channel/seriesdetail?sid=514000
-搅链呈窃首https://space.bilibili.com/589133151/channel/seriesdetail?sid=513998
-曳辜衬狙痈https://space.bilibili.com/589133151/channel/seriesdetail?sid=513997
-弊仔钩临骋https://space.bilibili.com/589133151/channel/seriesdetail?sid=513996
-啪撼湍谟淳https://space.bilibili.com/589133151/channel/seriesdetail?sid=513995
17771278828 5天前 回复
-咨南装扰骋https://space.bilibili.com/589133151/channel/seriesdetail?sid=514224
-妇羌谰谇章https://space.bilibili.com/589133151/channel/seriesdetail?sid=514223
-帽估烁卣咎https://space.bilibili.com/589133151/channel/seriesdetail?sid=514222
-且暗艘壁反https://space.bilibili.com/589133151/channel/seriesdetail?sid=514221
-咕缀感缚废https://space.bilibili.com/589133151/channel/seriesdetail?sid=514220
17706501269 5天前 回复
1 2 3 4 5 6 ... »