A Dart library for generating immutable value types, enum classes, and JSON serialization with minimal boilerplate.
Built Value is a Dart library that generates immutable value types, enum classes, and JSON serialization code to eliminate boilerplate. It solves the problem of manually writing and maintaining repetitive code for data classes, ensuring immutability, type safety, and seamless serialization across applications.
Dart and Flutter developers building data models for client-server applications, especially those requiring immutable data structures, JSON serialization, and maintainable object-oriented designs.
Developers choose Built Value for its robust code generation that reduces errors, supports complex object models with generics and interfaces, and provides modular serialization that evolves with the data model without breaking compatibility.
Immutable value types, enum classes, and serialization.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates hashCode, equals, toString, and copy methods automatically, eliminating repetitive coding and reducing bugs, as highlighted in the value types section.
Supports generics, interfaces, and modular serialization that allows data model evolution without breaking compatibility, crucial for client-server apps per the serialization features.
Ensures type safety with immutable values and provides BuiltValueHook for custom validation and field processing during instantiation, as detailed in the FAQ.
EnumClass allows enums to hold code, implement interfaces, and work in switch statements, enhancing design flexibility beyond basic Dart enums.
Requires integration with build_runner for code generation, adding setup steps and potential IDE issues, which can slow down development workflow.
Understanding annotations, builders, and serializers is challenging, especially for developers new to code generation in Dart, despite the provided tools and snippets.
Need to correctly handle .g.dart files in publishing (not checking in), which can lead to errors if mismanaged, as noted in the build_runner documentation.