Can one declare a static method within an abstract class, in Dart?
问题 In an abstract class , I wish to define static methods, but I'm having problems. In this simple example abstract class Main { static String get name; bool use( Element el ); } class Sub extends Main { static String get name => 'testme'; bool use( Element el ) => (el is Element); } I receive the error: function body expected for method 'get:name' static String get name; Is there a typo in the declaration, or are static methods incompatible with abstract classes? 回答1: Dart doesn't inherit