{"repo":"spkersten/dart_functional_data","free":true,"listed":false,"github":"https://github.com/spkersten/dart_functional_data","clone":"git clone https://github.com/spkersten/dart_functional_data.git","description":"Simple and non-intrusive code generator for lenses and boilerplate of data types","language":"Dart","stars":40,"topics":["dart","flutter-package","flutter","functional","lenses","code-generator","boilerplate"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"Functional Data 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 . Compare this with the alternative: This is much less readable and error prone. Imagine what happens when one of the classes gains a field. Full example: Code generation configuration Class level configuration To specify which features should be generated for the class, you can send arguments to @FunctionalData generator. Example: Project level configuration To specify which features should be ge","default_branch":null,"files":null,"tree":[],"storefront":"/r/spkersten","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spkersten/dart_functional_data/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}