dartanalyzer doesn't give a warning for missing implementation from interface

Issue

Currently I’m experimenting and learning the Dart language.

I’m creating an abstract class with two abstract methods called IAnimal like this:

abstract class IAnimal
{
  String Walk(int distance);

  String Eat(String food);
}

Next I create a Dog class that should implement the 2 methods.

class Dog implements IAnimal
{
  Dog(String name) {
    this._name = name;
  }

  String _name;
}

But the dart analyser does complain about the 2 missing methods, is this intended behaviour or not supported?

Solution

This should indeed give a warning, the Dart Analyzer from the command line does the trick. This was an issue with WebStorm and Sublime Text not triggering the Dart Analyzer.

Answered By – Luc Wollants

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *