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

102 views Asked by At

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?

2

There are 2 answers

0
Luc Wollants On BEST ANSWER

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.

0
Günter Zöchbauer On

Here it shows a warning DartPad maybe the analyzer doesn't run or isn't finished yet.