subtype_ of_ base_ or_ final_ is_ not_ base_ final_ or_ sealed
The mixin '{0}' must be 'base' because the supertype '{1}' is 'base'.
The mixin '{0}' must be 'base' because the supertype '{1}' is 'final'.
The type '{0}' must be 'base', 'final' or 'sealed' because the supertype '{1}' is 'base'.
The type '{0}' must be 'base', 'final' or 'sealed' because the supertype '{1}' is 'final'.
Description
#
The analyzer produces this diagnostic when a class or mixin has a direct
or indirect supertype that is either base or final, but the class or
mixin itself isn't marked either base, final, or sealed.
Example
#
The following code produces this diagnostic because the class B is a
subtype of A, and A is a base class, but
B is neither base,
final or sealed:
base class A {}
class B extends A {}
Common fixes
#
Add either base, final or sealed to the class or mixin declaration:
base class A {}
final class B extends A {}
Unless stated otherwise, the documentation on this site reflects Dart 3.10.3. Page last updated on 2025-9-4. View source or report an issue.