Closed
Description
Flutter has some classes (like ChangeNotifier and WidgetsBindingObserver) where we tell developers that those can be extended, implemented, or mixed-in. However, the prefer_mixin
lint is not happy when they are used as a mixin in a with
clause. Since those classes pre-date the introduction of actual mixins in Dart, it would be nice if they can be opted out from the lint, e.g. by annotating them with something like @legacyMixin
.
The Dart SDK also has some of these legacy mixins that would benefit from such an annotation (example: IterableMixin) to avoid the prefer_mixin
warning in the following code snippet:
/// info: Prefer using mixins. (prefer_mixin)
abstract class Foo with IterableMixin<int> {
// ...
}