/*normal class u can create constructors create objects from it
and all that good jazz*/
class Foo {
final int a;
Foo(this.a);
void someMethod() {}
}
/*mixin is like a container than hold some
functionalities that you want to mix with an existing class*/
mixin Bar {
void add() {}
}
/* this class extends Foo to inherent some goodness but i need a
functionality that is not directly related to parent child
relationship so i mix it with Bar */
class Baz extends Foo with Bar {
Baz(super.a);
void myMethod() {
// i have access to add function here
add();
}
}
// mixin class act like both
mixin class AnotherClass {
AnotherClass();
}