Closed skillkrio closed 2 years ago
An example would be:
mixin A {
String name = 'Hello';
}
mixin B {
String name = 'World';
}
class MyState extends State<MyWidget> with A, B {
// Both A and B define a "name" property, but they override each other.
}
Dart mixins can partially solve this issue, but they suffer from other problems:
A given mixin can only be used once per class. Mixins and the class share the same object. This means that if two mixins define a variable under the same name, the result may vary between compilation fails to unknown behavior.
can you provide any example for the above two points. i didn't get it.