当前位置:网站首页>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
边栏推荐
- Japanese online notes for postgraduate entrance examination (9): composition template
- Remove the mosaic, there's a way, attached with the running tutorial
- Online notes on Mathematics for postgraduate entrance examination (9): a series of courses on probability theory and mathematical statistics
- Question B of the East China Cup: how to establish a population immune barrier against novel coronavirus?
- Solution to the problem of repeated startup of esp8266
- Notes on writing questions in C language -- monkeys eat peaches
- [zero foundation understanding innovation and entrepreneurship competition] overall cognition and introduction of mass entrepreneurship and innovation competition (including FAQs and integration of bl
- 股票在线开户安全吗?找谁可以办理?
- Is it safe to open a stock account through the account opening QR code of the account manager?
- Puzzle (019.2) hexagonal lock
猜你喜欢

瑞吉外卖项目(二)
![[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)
![[competition - Rural Revitalization] experience sharing of Zhejiang Rural Revitalization creative competition](/img/b4/84c30ed112c4dffd8d51697b2f4a4f.jpg)
[competition - Rural Revitalization] experience sharing of Zhejiang Rural Revitalization creative competition

Use Navicat to compare data differences and structure differences of multi environment databases, and automatic DML and DDL scripts

Lvs-dr mode single network segment case

Matplotlib plt Axis() usage

CYCA少儿形体礼仪 乐清市培训成果考核圆满落幕
![[MySQL learning notes 21] storage engine](/img/3a/a3cd573281efc689cafdb7d7562ce0.png)
[MySQL learning notes 21] storage engine

Why should the terminal retail industry choose the member management system

CyCa 2022 children's physical etiquette primary teacher class Shenzhen headquarters station successfully concluded
随机推荐
Oracle function trigger
8. Intelligent transportation project (1)
独步武林,架构选型手册(包含 PDF)
SQL advanced
Cassava tree disease recognition based on vgg16 image classification
2021mathorcupc topic optimal design of heat dissipation for submarine data center
How to make a self-made installer and package the program to generate an installer
请问在手机上开户股票,还是去证券公司开户安全?
Is it harder to find a job in 2020? Do a good job in these four aspects and find a good job with high salary
Benefits and types of cloud network technology
STM32 receives data by using idle interrupt of serial port
[MySQL learning notes 21] storage engine
Data-driven anomaly detection and early warning of item C in the May 1st mathematical modeling competition in 2021
A game WP
Simple waterfall effect
富时A50开户什么地方安全
Huipay international permet au commerce électronique transfrontalier de devenir une plate - forme de paiement transfrontalière conforme!
Voiceprint Technology (I): the past and present life of voiceprint Technology
Fcpx quickly add subtitles | Final Cut Pro import fcpxml subtitle file does not match the video time? I got it in code
[design completion - opening report] zufeinfo 2018 software engineering major (including FAQ)