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
Dart currently does not support intersection types — types that must simultaneously conform to multiple protocols.
For example:
abstract class A {} abstract class B {} mixin MyMixin<T extends A & B> {}
Or:
typedef AB = A & B;
Allow the use of intersection types in:
mixin MyMixin<T extends A & B> {}
In Flutter, mixins often rely on both StatefulWidget and another interface or capability:
mixin
StatefulWidget
mixin MyBehavior<T extends StatefulWidget & MyInterface> on State<T> {}
The text was updated successfully, but these errors were encountered:
See #2709.
Sorry, something went wrong.
No branches or pull requests
Problem
Dart currently does not support intersection types — types that must simultaneously conform to multiple protocols.
For example:
Or:
Proposed Feature
Allow the use of intersection types in:
Generic constraints:
Flutter Use Case
In Flutter,
mixin
s often rely on bothStatefulWidget
and another interface or capability:Type aliases
The text was updated successfully, but these errors were encountered: