Search packages, repositories and app categories

Package detailsv4.0.3

freezed

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

AndroidiOSmacOSWindowsLinux
30-day downloads
2.9M
Likes
4.5K
Pub points
160

Install package

flutter pub add freezed

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Freezed is a Flutter/Dart package that simplifies the creation of immutable data classes through code generation. It offers a clean, intuitive syntax for defining classes with built-in support for equality, hashing, copying, and JSON serialization. By leveraging annotations, Freezed reduces boilerplate and enhances type safety, making it ideal for managing state in apps using patterns like Redux or Bloc. The generated code is efficient and fully compatible across platforms.

Use cases

  • State management in Flutter apps
  • Immutable data modeling
  • JSON serialization
  • Type-safe configuration objects
  • Reducing boilerplate in domain models

Key features

  • Automatic immutable class generation
  • Built-in equality and hash support
  • CopyWith method generation
  • JSON serialization via `fromJson`/`toJson`
  • Simple annotation-based API

Suitable for

  • Developers seeking clean state management
  • Teams prioritizing code maintainability
  • Projects requiring robust data models
  • Flutter apps using functional programming patterns
  • Apps needing efficient JSON handling

Considerations

  • Requires code generation (build_runner)
  • Learning curve for new users
  • Dependency on build_runner and associated tools
  • Limited runtime flexibility compared to mutable classes
  • Potential for larger build times with many classes

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

packages/freezed/README.md

Categories

Dependencies

Dependency list 11 items

Source repository

Projects using this package

Rankings