Simple and non-intrusive code generator for boilerplate of data types. The package generates a simple mixin with
operator==, hashCode, copyWith, toString, as well as lenses.
Boiler plate
Because the boiler plate is generated as a mixin, it is minimally intrusive on the interface of the class. You
only have to provide a constructor with named arguments for all fields and extend the generated mixin.
Because of this design, you have complete control over the class. You can, for example, add named constructors
or methods to the class like you're used to.
Lenses
For every class, lenses are generated for all fields which allow viewing a field or creating a new
instance of the classes with that field modified in some way. For example, the lens of Person's name is
Person$.name. To focus a lens on a specific instance use its of method:
This isn't very exciting yet. The power of lenses comes to light when you combine them. It allows you to easily
create a copy of a large nested data structure with one of the fields in a leaf modified. Two lenses can be chained
using then.
To specify which features should be generated for you whole project, create a file called functional_data_options.yaml
in the root of your project.
Class specific arguments will override the project level configuration.