Dart: How to implement a similar situation like “when hashcode() is overridden, ==() should also be overridden”?
问题 When either hashCode() or == operator is overridden in a class, the dart analyzer warns, saying that the other method should also be overridden. Can I implement a similar case on other methods? Or is this feature a special case provided by Dart Analyzer? For exmaple, class A { void method1() {} void method2() {} } class B extends A { @override void method1() {} } At this point I want to produce a warning that class B should also override method2(). Is that possible? 回答1: What you are seeing