TOC
The method with the same name from the last mixin will override the previous ones in dart
TestMixin file:
class MyObject{
init(){
print("draw object");
}
}
mixin Circle{
init(){
print("draw circle");
}
}
mixin Square{
init(){
print("draw Square");
}
}
class MyShape extends MyObject with Circle, Square{
init() {
super.init();
print("draw MyShape");
}
}
void main() {
MyShape shape = MyShape();
shape.init();
}
//Output:
draw Square
draw MyShape
「点个赞」
点个赞
使用微信扫描二维码完成支付
