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

js/object dart/map sample added #32

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@tahaemin
Copy link

commented May 13, 2019

No description provided.

exampleMap['value'];
```

If you want to define and access Map like JS, you need to define a class

This comment has been minimized.

Copy link
@lesnitsky

lesnitsky May 13, 2019

Owner

that's not technically correct, class is a user defined type, but Map is a data structure, so I'd get rid of this piece of code


<Example flutter>

In Dart, there is Map like JS Objects but it is a little bit different

This comment has been minimized.

Copy link
@lesnitsky

lesnitsky May 13, 2019

Owner

Map like JS Objects is a bit confusing statement. JS objects are actual maps (if we're not speaking about shadow classes which are created under the hood), so I'd drop this comment completely


Defining Map
```dart
Map<String, dynamic> exampleMap = {

This comment has been minimized.

Copy link
@lesnitsky

lesnitsky May 13, 2019

Owner

You can just use final, dart is smart enough to figure out the type of this literal

@lesnitsky
Copy link
Owner

left a comment

Please address all comments I left

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.