How can I create a new subclass extends a ButtonElement
问题 import dart:html , I can create a new subclass MyButton of ButtonElement with factory constructor ,and add some new function such as getButtonName(){} ... when it's running ,I get a instance MyButton btn=new MyButton() But the instance "btn" runtime type is still ButtonElement , and can't call the getButtonName() function. If I use btn as MyButton then I get this error Uncaught CastError: Casting value of type ButtonElement to incompatible type MyButton Here is the code class MyButton extends