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;
Unless stated otherwise, the documentation on this site reflects Dart 3.11.0. Report an issue.