Created
October 13, 2018 04:20
-
-
Save kwmt/6d48e7bc264ae588d1b083cf6ca3c61a to your computer and use it in GitHub Desktop.
JSON serialize Map<String, bool>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
// サンプルデータ | |
Map<String, bool> members = Map<String, bool>() | |
..putIfAbsent("userID1", () => true) | |
..putIfAbsent("userID2", () => true); | |
print(members); | |
var transMember = members.entries.map((member) { | |
return <String, dynamic>{member.key: member.value}; | |
}); | |
print(transMember); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment