mixin_application_not_implemented_interface
'{0}' can't be mixed onto '{1}' because '{1}' doesn't implement '{2}'.
Description
#The analyzer produces this diagnostic when a mixin that has a superclass constraint is used in a mixin application with a superclass that doesn't implement the required constraint.
Example
#The following code produces this diagnostic because the mixin M
requires
that the class to which it's applied be a subclass of A
, but Object
isn't a subclass of A
:
dart
class A {}
mixin M on A {}
class X = Object with M;
Common fixes
#If you need to use the mixin, then change the superclass to be either the same as or a subclass of the superclass constraint:
dart
class A {}
mixin M on A {}
class X = A with M;
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。