DeepSource has joined Harness. Learn more
Dart Analyze logoDart Analyze/
DRT-W1504

Missing concrete implementation of abstract member(s)DRT-W1504

Major severityMajor
Bug Risk categoryBug Risk

The analyzer produces this diagnostic when a concrete class inherits one or more abstract members, and doesn't provide or inherit an implementation for at least one of those abstract members.

Example

The following code produces this diagnostic because the class B doesn't have a concrete implementation of m:

abstract class A {
  void m();
}

class B extends A {}

Common fixes

If the subclass can provide a concrete implementation for some or all of the abstract inherited members, then add the concrete implementations:

abstract class A {
  void m();
}

class B extends A {
  void m() {}
}

If there is a mixin that provides an implementation of the inherited methods, then apply the mixin to the subclass:

abstract class A {
  void m();
}

class B extends A with M {}

mixin M {
  void m() {}
}

If the subclass can't provide a concrete implementation for all of the abstract inherited members, then mark the subclass as being abstract:

abstract class A {
  void m();
}

abstract class B extends A {}