mixin_of_non_class
Classes can only mix in mixins and classes.
Description
#The analyzer produces this diagnostic when a name in a with
clause is
defined to be something other than a mixin or a class.
Example
#The following code produces this diagnostic because F
is defined to be a
function type:
dart
typedef F = int Function(String);
class C with F {}
Common fixes
#Remove the invalid name from the list, possibly replacing it with the name of the intended mixin or class:
dart
typedef F = int Function(String);
class C {}
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。