super_ in_ enum_ constructor
The enum constructor can't have a 'super' initializer.
Description
#The analyzer produces this diagnostic when the initializer list in a constructor in an enum contains an invocation of a super constructor.
Example
#
The following code produces this diagnostic because the constructor in
the enum
E
has a super constructor invocation in the initializer list:
enum E {
e;
const E() : super();
}
Common fixes
#Remove the super constructor invocation:
enum E {
e;
const E();
}
Unless stated otherwise, the documentation on this site reflects Dart 3.9.2. Page last updated on 2025-9-1. View source or report an issue.