//mixin_object_type.dart文件 //類A class A { //同名方法A String getMessage() => 'A'; } //類B class B { //同名方法 返回B String getMessage() => 'B'; } //類P class P { //同名方法 返回P String getMessage() => 'P'; } //類AB 繼承P 先混入A類後混入B類 class AB extends P with A, B { } //類BA 繼承P 先混入B類後混入A類 class BA extends P with B, A { } void main() { //實例化AB類 AB ab = AB(); print(ab is P); //true print(ab is A); //true print(ab is B); //true //實例化BA類 BA ba = BA(); print(ba is P); //true print(ba is A); //true print(ba is B); //true }'