Skip to content

Typed Maps - like interfaces in TypeScript #48989

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

Closed
KoTTi97 opened this issue Jan 16, 2020 · 3 comments
Closed

Typed Maps - like interfaces in TypeScript #48989

KoTTi97 opened this issue Jan 16, 2020 · 3 comments

Comments

@KoTTi97
Copy link

KoTTi97 commented Jan 16, 2020

I would love to see typed Maps in Dart/Flutter like it is possible in TypeScript.

TypeScript example:

interface IPerson {
    name: string;
    age: number;
    height?: number;
}

const person: IPerson = {
    name: "Max",
    age: 26
}

I wish Dart/Flutter would support something like that so i do not have to create a class for it. It could look something like this:

interface IPerson {
  String name;
  int age;
  height? double;
}

Map<IPerson> person = {
  name: "Max",
  age: 26,
} 
@jonahwilliams
Copy link
Member

This sort of language level feature request would be better suited for github.com/dart-lang/language/issues

@KoTTi97
Copy link
Author

KoTTi97 commented Jan 16, 2020

Reposted as @jonahwilliams mentioned: dart-lang/language#783

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants