// サンプルデータ
Map<String, bool> members = Map<String, bool>()
..putIfAbsent("userID1", () => true)
..putIfAbsent("userID2", () => true);
print(members);
// output:
// {userID1: true, userID2: true}
var transMember = members.entries.map((member) {
return <String, dynamic>{member.key: member.value};
});
print(transMember);
// output:
// ({userID1: true}, {userID2: true})
Dartpad
動かして確認するにはこちら
comments powered by Disqus