当前位置:网站首页>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 .
边栏推荐
- Are you ready for the exam preparation strategy of level II cost engineer in 2022?
- Summary of Android interview questions in 2020 (elementary)
- How to build an ECS and how to control the server through the local host
- Specificity and correlation of Worthington deoxyribonuclease I
- Black horse programmer machine learning handout: preliminary use of linear regression API
- Spirit breath development log (16)
- 线性回归的损失和优化,机器学习预测房价
- How to enlarge the ECS page? How to select ECS instance specifications?
- Precautions for online education and training industry filing
- 外网访问svn服务器(外网访问部署在云上的svn服务器)
猜你喜欢

阿里云新一代云计算体系架构 CIPU 到底是啥?

『渗透基础』Cobalt Strike基础使用入门_Cobalt Strike联动msfconsole

什么是数据中台

Zhang Xiaodan, chief architect of Alibaba cloud hybrid cloud: evolution and development of government enterprise hybrid cloud technology architecture

An interface testing software that supports offline document sharing in the Intranet
Advanced authentication of uni app [Day12]

What is the new generation cloud computing architecture cipu of Alibaba cloud?

Abnova fluorescence in situ hybridization (FISH) probe solution

Final summary of freshman semester (supplement knowledge loopholes)

外网访问svn服务器(外网访问部署在云上的svn服务器)
随机推荐
The trunk warehouse can also be tob, and Tencent cloud microenterprises do not leave quality behind
2020年Android面试题汇总(中级)
Advanced authentication of uni app [Day12]
事件
ribbon
胶原蛋白酶——Worthington四种类型的粗胶原酶
How to operate ECs and what types of system configuration schemes can be supported
What are the functions of ASP files on ECs? What if the ECS cannot run ASP with a low version?
C语言自定义类型的介绍(结构体,枚举,联合体,位段)
Bi-sql basic cognition
Real time monitoring: system and application level real-time monitoring based on flow computing Oceanus (Flink)
Oracle database prompts no operation permission
What is Ping? How can the server disable Ping?
Specificity and correlation of Worthington deoxyribonuclease I
Before creating an image, it is recommended to execute the following code to purify the image as an administrator
Introduction à la méthode de descente par Gradient - document d'apprentissage automatique pour les programmeurs de chevaux noirs
Facebook internal announcement: instant messaging will be re integrated
Analyze the actual user groups and demand positioning of distributed database products from the market and demand
There are many ways to confirm and modify the remote port number
Application practice of helium decentralized lorawan network in Tencent cloud IOT development platform