sealed top-level constant
_Sealed
const sealed
Annotation marking a class as not allowed as a super-type outside of the current package.
Classes in the same package as the marked class may extend, implement or mix-in the annotated class.
Tools, such as the analyzer, can provide feedback if
- the annotation is associated with anything other than a class,
- the annotation is associated with a class
C
, and there is a class or mixinD
, which extends, implements, mixes in, or constrains toC
, andC
andD
are declared in different packages.
Note: In Dart 3 and later, you can use built-in class modifiers to control what forms of subtyping are allowed outside the current library. To learn more about using class modifiers, check out the Class modifiers documentation.
Implementation
const _Sealed sealed = _Sealed();