Dart Analyze logoDart Analyze/
DRT-W1258

Missing method body in non-abstract classDRT-W1258

Major severityMajor
Bug Risk categoryBug Risk

The analyzer produces this diagnostic when a member of a concrete class is found that doesn't have a concrete implementation. Concrete classes aren't allowed to contain abstract members.

Example

The following code produces this diagnostic because m is an abstract method but C isn't an abstract class:

class C {
  void m();
}

Common fixes

If it's valid to create instances of the class, provide an implementation for the member:

class C {
  void m() {}
}

If it isn't valid to create instances of the class, mark the class as being abstract:

abstract class C {
  void m();
}