当前位置:网站首页>Shuttle JSON, list, map inter transfer
Shuttle JSON, list, map inter transfer
2022-06-25 09:43:00 【Moon Spring】
Flutter Json turn List、Map It's simple , We can go through dart:convert The built-in JSON decoder json.decode() To achieve
Json turn List
// One JSON Format string
String jsonStr = ‘[{“name”:“ Zhang San ”},{“name”:“ Li Si ”}]’;
// take JSON String to List
List list = json.decode(jsonStr);
// Output the name of the first user
print(list[0][“name”]);
List turn Json
String jsonStringA = json.encode(list);
print(jsonStringA);
Json turn Map
// One JSON Format string
String jsonStr = ‘{“name”: “ Wang Wu ”,“address”: “ Dongcheng District ”}’;
// take JSON String to List
Map<String, dynamic> map = json.decode(jsonStr);
// Output
print(‘ full name : ${map[‘name’]}’);
print(‘ Address : ${map[‘address’]}’);
Map turn Json
String jsonStringB = json.encode(map);
print(jsonStringB);
Reprint . This article is the original article of blogger mazhiwu ,
Link to the original text :https://blog.csdn.net/ruoshui_t/article/details/103793190
边栏推荐
- Data-driven anomaly detection and early warning of 21 May Day C
- Register the jar package as a service to realize automatic startup after startup
- Notes on writing questions in C language -- monkeys eat peaches
- Is it safe to open a stock account through the account opening QR code of the account manager?
- 2021mathorcupc topic optimal design of heat dissipation for submarine data center
- 如何自制一个安装程序,将程序打包生成安装程序的办法
- Work of the 15th week
- Remove the mosaic, there's a way, attached with the running tutorial
- CYCA 2022少儿形体礼仪初级师资班 深圳总部站圆满结束
- 将jar包注册为服务,实现开机自动启动
猜你喜欢
![[wechat applet full stack development course] course directory (mpvue+koa2+mysql)](/img/1c/ab39cf0a69d90a85665a099f5dbd26.jpg)
[wechat applet full stack development course] course directory (mpvue+koa2+mysql)

Remittance international empowers cross-border e-commerce: to be a compliant cross-border payment platform!

2台三菱PLC走BCNetTCP协议,能否实现网口无线通讯?

Pytorch_Geometric(PyG)使用DataLoader报错RuntimeError: Sizes of tensors must match except in dimension 0.

Neo4jdesktop (neo4j desktop version) configures auto start (boot auto start)

A game WP

Wallys/MULTI-FUNCTION IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL

Prediction of pumpkin price based on BP neural network
![[competition -kab micro entrepreneurship competition] KAB National College Students' micro entrepreneurship action participation experience sharing (including the idea of writing the application form)](/img/f3/a8414635ad39ad405864f5fcf66d6d.jpg)
[competition -kab micro entrepreneurship competition] KAB National College Students' micro entrepreneurship action participation experience sharing (including the idea of writing the application form)

Etcd教程 — 第四章 Etcd集群安全配置
随机推荐
Is it safe to open an account with Great Wall Securities by mobile phone?
Why should the terminal retail industry choose the member management system
CYCA 2022少儿形体礼仪初级师资班 深圳总部站圆满结束
manhattan_ Slam environment configuration
使用Navicat对比多环境数据库数据差异和结构差异,以及自动DML和DDL脚本
Wallys/MULTI-FUNCTION IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL
Creo makes a mobius belt in the simplest way
广发证券靠谱吗?是否合法?开股票账户安全吗?
Cubemx stm32f105rb USB flash drive reading and writing detailed tutorial
puzzle(019.2)六边锁
匯付國際為跨境電商賦能:做合規的跨境支付平臺!
将jar包注册为服务,实现开机自动启动
Voiceprint Technology (III): voiceprint recognition technology
Is the client that gets the scanning code wechat or Alipay
Make a skylearn high-dimensional dataset_ Circles and make_ moons
Online notes on Mathematics for postgraduate entrance examination (8): Kego equations, eigenvalues and eigenvectors, similarity matrix, quadratic series courses
Armbian version name comparison
oracle 函数 触发器
[Ruby on rails full stack course] course directory
SQL高级