当前位置:网站首页>Shutter - how to copy certain elements from a map to a new map in dart/shutter?
Shutter - how to copy certain elements from a map to a new map in dart/shutter?
2022-06-24 04:55:00 【nuts】
flutter - How to be in Dart/Flutter Remove some elements from a Map Copy to new Map in ?
How to be in Dart / Flutter Remove some elements from a Map Copy to new Map in ?
Old_Map = {
'A' : {Big : 'A', Small : 'a' },
'B' : {Big : 'B', Small : 'b' },
'C' : {Big : 'C', Small : 'c' },
'D' : {Big : 'D', Small : 'd' },
}
Old_Map => New_MapI just want to
'B' : {Big : 'B', Small : 'b' },
'C' : {Big : 'C', Small : 'c' },The best answer
You can do this
final oldMap = {
'A': {'Big': 'A', 'Small': 'a'},
'B': {'Big': 'B', 'Small': 'b'},
'C': {'Big': 'C', 'Small': 'c'},
'D': {'Big': 'D', 'Small': 'd'},
};
final newMap =
Map.fromIterable(oldMap.keys.where((k) => k == 'B' || k =='C'),
key: (k) => k, value: (v) => oldMap[v]); because keys return map Keyed Iterable<String>, So you can use where Method to check the required keys , Then it can be based on the old map Value filling value .
边栏推荐
- Customer disaster recovery case - a MySQL database migration scheme
- Are you ready for the exam preparation strategy of level II cost engineer in 2022?
- Apipost interface assertion details
- Introduction to gradient descent method - black horse programmer machine learning handout
- Elfk service setup
- SAP mts/ato/mto/eto topic 8: ATO mode 2 d+ empty mode strategy 85
- Jimureport building block report - expression introduction
- Here's all you want to know about takin data (1) startup command
- The trunk warehouse can also be tob, and Tencent cloud microenterprises do not leave quality behind
- How to enlarge the ECS page? How to select ECS instance specifications?
猜你喜欢

MySQL - SQL execution process

Abnova membrane protein lipoprotein solution

SAP MTS/ATO/MTO/ETO专题之七:ATO模式1 M+M模式策略用82(6892)

一款支持内网脱机分享文档的接口测试软件

C语言自定义类型的介绍(结构体,枚举,联合体,位段)

SAP MTS/ATO/MTO/ETO专题之八:ATO模式2 D+空模式策略用85

Facebook internal announcement: instant messaging will be re integrated

Introduction à la méthode de descente par Gradient - document d'apprentissage automatique pour les programmeurs de chevaux noirs

Popularization of children's programming education in specific scenarios

Final summary of freshman semester (supplement knowledge loopholes)
随机推荐
How are ECS leased? Can the ECS use VPN?
How to create an FTP server on the ECS? Is it safe to create an FTP server on the ECS?
Worthington弹性蛋白酶的应用和相关研究
The conference assistant hidden in wechat is the best way to work efficiently!
Analysis on the subjective enthusiasm of post-90s makers' Education
After purchasing Tencent ECs, how to solve packet loss in Internet access?
Locating memory leaks with poolmon
Digital transformation practice of Zheshang Bank
SAP MTS/ATO/MTO/ETO专题之十:ETO模式 Q+空模式 未估价库存 策略自定义
Here's all you want to know about takin data (1) startup command
一款支持内网脱机分享文档的接口测试软件
Are you ready for the exam preparation strategy of level II cost engineer in 2022?
Ext4 file system jam caused by MEM CGroup OOM
Introduction to C language custom types (structure, enumeration, union, bit segment)
一文简述:供应链攻击知多少
Verifying data models in golang
How to use and apply for ECS? What parameters can be configured
What does IIS mean and what is its function? How does IIS set the size of the web site space on the server?
Confluence data center version is nearing its lifecycle
Jimureport building block report - what problems does the layout design solve?