We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Does Dart allow to create a class like this?
class GenericBased<T extends Object> extends T { final bool myProperties; const GenericBased({required this.myProperties}) }
The text was updated successfully, but these errors were encountered:
No, Dart does not allow this.
Sorry, something went wrong.
The closest thing is a mixin, but mixins cannot have the constructor you need.
mixin MyProperty { bool property = false; } class FooWithProperty extends Foo with MyProperty { FooWithProperty(bool property) { this.property = property; } }
Without a constructor, it cannot add a final variable that is initialized to different values in different places.
Seems like this is a duplicate of #3552, although this one seems more like a question than a request.
No branches or pull requests
Does Dart allow to create a class like this?
The text was updated successfully, but these errors were encountered: