mixin_super_class_constraint_non_interface
Only classes and mixins can be used as superclass constraints.
Description
#The analyzer produces this diagnostic when a type following the on
keyword in a mixin declaration is neither a class nor a mixin.
Example
#The following code produces this diagnostic because F
is neither a class nor a mixin:
typedef F = void Function();
mixin M on F {}
Common fixes
#If the type was intended to be a class but was mistyped, then replace the name.
Otherwise, remove the type from the on
clause.
Unless stated otherwise, the documentation on this site reflects Dart 3.7.3. Page last updated on 2025-05-08. View source or report an issue.