当前位置:网站首页>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
边栏推荐
- [wechat applet full stack development course] course directory (mpvue+koa2+mysql)
- Mapping mode of cache
- 瑞吉外卖项目(二)
- 华泰证券在上面开户安全吗?靠谱吗?
- 测试开发工程师
- How to "transform" small and micro businesses (II)?
- 处理图片类库
- Match a mobile number from a large number of mobile numbers
- SQL advanced
- Register the jar package as a service to realize automatic startup after startup
猜你喜欢

瑞萨RA系列-开发环境搭建

Applet cloud development joint table data query and application in cloud function

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

Reza RA series - development environment construction

纳米数据世界杯数据接口,中超数据,体育数据比分,世界杯赛程api,足球比赛实时数据接口

Use Navicat to compare data differences and structure differences of multi environment databases, and automatic DML and DDL scripts
![[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集群安全配置

manhattan_ Slam environment configuration

Register the jar package as a service to realize automatic startup after startup
随机推荐
华泰证券在上面开户安全吗?靠谱吗?
2022 meisai question a idea sharing
22 mathematical modeling contest 22 contest C
Prediction of pumpkin price based on BP neural network
[Ruby on rails full stack course] course directory
51 SCM time stamp correlation function
[learn C from me and master the key to programming] insertion sort of eight sorts
广发证券靠谱吗?是否合法?开股票账户安全吗?
富时A50开户什么地方安全
Is the security account opening risky and safe?
The meshgrid() function in numpy
从海量手机号中匹配某一个手机号
2台三菱PLC走BCNetTCP协议,能否实现网口无线通讯?
Make a skylearn high-dimensional dataset_ Circles and make_ moons
[zufe school competition] difficulty classification and competition suggestions of common competitions in the school (taking Zhejiang University of Finance and economics as an example)
puzzle(019.2)六边锁
What functions should smart agriculture applet system design have
[MySQL learning notes 20] MySQL architecture
How much money have I made by sticking to fixed investment for 3 years?
CYCA少儿形体礼仪 乐清市培训成果考核圆满落幕