Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add tuple2 to map #18

Closed
ride4sun opened this issue Oct 23, 2019 · 1 comment
Closed

Please add tuple2 to map #18

ride4sun opened this issue Oct 23, 2019 · 1 comment

Comments

@ride4sun
Copy link

ride4sun commented Oct 23, 2019

It would be nice to have the convenience method toMap based on the types. Thanks

I think that is way too complicated.... I wish Dart would have Extension Methods like C# and I can add a library of static converters.
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods

      Map<String, String> result = Map<String, String>.fromEntries(
          tuple2object.map((f) => MapEntry(f.item1, f.item2)));
@devoncarew
Copy link
Collaborator

I believe this can now be supported by Dart's extension methods (released as part of Dart 2.7).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants