Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Dart
  3. Freezed

Freezed

Dart

Code generation for immutable classes in Dart/Flutter with a simple syntax and comprehensive features.

Visit WebsiteGitHubGitHub
2.2k stars305 forks0 contributors

What is Freezed?

Freezed is a code generation package for Dart and Flutter that automatically creates immutable classes with value equality, copyWith methods, and serialization support. It solves the problem of writing repetitive boilerplate code for data classes while providing advanced features like union types and pattern matching.

Target Audience

Dart and Flutter developers who need immutable data classes for state management, API responses, or domain models, particularly those working on applications requiring type safety and reduced boilerplate.

Value Proposition

Developers choose Freezed because it offers a simple syntax that dramatically reduces manual coding while providing comprehensive features like union types, JSON serialization, and pattern matching that are typically cumbersome to implement manually.

Overview

Code generation for immutable classes that has a simple syntax/API without compromising on the features.

Use Cases

Best For

  • Reducing boilerplate code for immutable data classes in Dart/Flutter
  • Implementing type-safe state management with union types
  • Creating models for API responses with JSON serialization
  • Building domain models with value equality and copy functionality
  • Managing complex application state with pattern matching
  • Developing Flutter apps that require immutable data structures

Not Ideal For

  • Projects that rely heavily on mutable state and find immutable patterns too restrictive
  • Teams avoiding code generation due to build process complexity or IDE integration issues
  • Small-scale applications with minimal data classes where manual coding is simpler than generator setup

Pros & Cons

Pros

Boilerplate Elimination

Automatically generates immutable classes with value equality and copyWith methods, reducing manual coding errors as emphasized in the README's focus on simplifying development.

Advanced Type Safety

Supports union types and pattern matching for type-safe state management, which is complex to implement manually without extensive code.

Built-in Serialization

Provides JSON serialization out of the box with minimal configuration, handling API responses efficiently as highlighted in the key features.

Null Safety Support

Fully compatible with Dart's null safety, ensuring modern code practices are adhered to without extra effort, as noted in the features.

Cons

Build Process Overhead

Requires integrating build_runner and managing generated files, which can complicate CI/CD pipelines and increase build times.

Debugging Complexity

Generated code can be hard to trace, making errors from annotations rather than user-written code more challenging to debug.

Vendor Lock-in Risk

Adopting Freezed ties the codebase to its ecosystem, with potential refactoring costs if migrating away due to breaking changes or abandonment.

Frequently Asked Questions

Quick Stats

Stars2,191
Forks305
Contributors0
Open Issues106
Last commit9 days ago
CreatedSince 2020

Tags

#dart#hacktoberfest#boilerplate-reduction#null-safety#code-generator#serialization#flutter#code-generation#union-types#state-management

Built With

D
Dart

Links & Resources

Website

Included in

Dart2.5k
Auto-fetched 10 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub