mixin_modifier_mixin_application_class_with_multiple_mixins
Details about the 'mixin_modifier_mixin_application_class_with_multiple_mixins' diagnostic produced by the Dart analyzer.
The mixin application class '{0}' can only have a single mixin.
Description
#
The analyzer produces this diagnostic when a mixin application class
with the mixin modifier has more than one mixin. A mixin class
application can only have a single mixin.
Example
#
The following code produces this diagnostic because the mixin class C
has multiple mixins:
mixin M1 {}
mixin M2 {}
mixin class C = Object with M1, M2;
Common fixes
#
If you need to use multiple mixins, remove the mixin modifier from the
mixin application class:
mixin M1 {}
mixin M2 {}
class C = Object with M1, M2;
If you need the class to be a mixin class, then only use a single mixin:
mixin M1 {}
mixin class C = Object with M1;
除非另有说明,文档之所提及适用于 Dart 3.11.0 版本报告页面问题.