There are different object-oriented programming (OOP) languages and Dart is one of them, basically, keeping code clean and dry is one of the characteristics of OOP. In OOP you have regular classes, abstract classes, and interfaces but in the dart, there is another hidden feature which is called mixins and this gives you that wow! which sometimes every developer looks for but the question is how?

Basically, the concept of mixins comes into effect when you want to inherit multiple classes at the same time but as you know dart does not allow multiple inheritances (which is a good thing ) and there you stand with two options either create a duplicate method or create mixins, wait….mixins?

What are mixins?

Mixins are simple classes that are instantiated by using mixin to avoid multiple class hierarchies. if we go by definitions there are some quotes here

A mixin declaration introduces a mixin and an interface, but not a class. The mixin introduced by a mixin declaration contains all the non-static members declared by the mixin, just as the mixin derived from a class declaration currently does.

#flutter #mixin #dart

Mixins in Dart: How to use it
3.05 GEEK