As mentioned at the start of this book, a Mixin is a class that contains methods for use by other classes without it having to be the parent class of those other classes.
So, a Mixin is a class you can use code from without having to inherit from. It enables developers to piecemeal classes together without having to get involved with inheritance, abstract classes etc.
Serialization & Deserialization
Mixins are often used to merge generated code into your code. Code generators are often used to generate code to serialize and deserialize data. You run the code generator when you do the build and it creates abstract classes containing code to serialize and deserialize your data. Your code then uses the ‘with’ + the abstract class name to include that code in your class as a mixin.
Mixins are often used with Explicit animation code, where some animation has been coded into a StatefulWidget.
SingleTickerProviderStateMixin contains ticker animation code which you combine into your class to add ticker functionality to animate every tick.