8000 Dart lang improvements · Issue #40325 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Dart lang improvements #40325

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
pouloghost opened this issue Sep 12, 2019 · 5 comments
Closed

Dart lang improvements #40325

pouloghost opened this issue Sep 12, 2019 · 5 comments

Comments

@pouloghost
Copy link

I'm new to flutter/dart from android. Dart seems to be more java than kotlin, which makes dart quite outdated. Some great kotlin language features are missing, and will you consider adding them into new versions of dart?

  • immutable at language level ( data class in kotlin)
  • property delegation ( by KProperty in kotlin)
  • inheritance limitation ( default not inheritable)
  • more declarative generic (where clause in C#)
@BondarenkoStas
Copy link

@pouloghost Thank you for the proposal! But it seems not to be related with flutter. Please file it to https://github.com/dart-lang/sdk/issues/new as I believe it's related to dart:io core library, which is just used by flutter.
Closing the issue, if you disagree, feel free to comment and I will reopen it.

@zoeyfan
Copy link
zoeyfan commented Sep 18, 2019

@pouloghost have you created another issue in dart:io? Please link it here.

@mraleph
Copy link
Member
mraleph commented Sep 23, 2019

This was filed in dart-lang/sdk#38446 and moved to dart-lang/language#582.

I think to really make this actionable for Dart Language team you need to present a better motivation, showcasing expressive power of a requested feature and providing good motivation for including this feature into the language.

You also need to consider that some language features are breaking - and thus unlikely to ever be included into the language (e.g. making classes not extendable by default breaks all Dart code in existence).

@pouloghost
Copy link
Author
  • Immutable and inheritance limitation is really important in slightly larger project, because we can make interfaces between modules more expressive. This comes from guava and effective java, I think this needs no explaining.

  • property delegation can be a very elegant way in cases like object-xxx-mapping, for example ORM.

class User {
   String name by DbCol<String>("name");
}

Currently our SharedPreferences is using something like the code above.

  • more declarative generic. I don't really know how generic in dart works, but constructing an object using a generic type is often needed, where clause is the only thing I know that can achieve this.
T con<T>() {
  return T();
}

@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 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants
0