Skip to content

Use private like super keyword #2614

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
marcoNonvanilla opened this issue Nov 8, 2022 · 1 comment
Closed

Use private like super keyword #2614

marcoNonvanilla opened this issue Nov 8, 2022 · 1 comment
Labels
feature Proposed language feature that solves one or more problems state-duplicate This issue or pull request already exists

Comments

@marcoNonvanilla
Copy link

The recently added super keyword is great to eliminate unnecessary boilerplate. I think the same could easily be done for private:

class ClassName {
   final int _myNum;
   final int _myPubNum;

  ClassName({required private.myNum, required this.myPubNum});
}
@marcoNonvanilla marcoNonvanilla added the feature Proposed language feature that solves one or more problems label Nov 8, 2022
@eernstg eernstg added the state-duplicate This issue or pull request already exists label Nov 8, 2022
@eernstg
Copy link
Member

eernstg commented Nov 8, 2022

I think this is covered by #2509 (search for 'super'). If you wish to recommend that we use a different syntax (such as private.myNum rather than _myNum, this._myNum, super._myNum) then it's probably better to comment on that issue than it is to create this new one.

@eernstg eernstg closed this as completed Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Proposed language feature that solves one or more problems state-duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants