freezed_annotation
Annotations for the freezed code-generator. This package does nothing without freezed too.
3.1.0
3.6M downloads/mo
#174 most downloaded on pub.dev
rrousselGit/freezed
What this package is like to depend on
Last release 1 years ago
02 Jul 2025
Release timing varies
gaps range from 2 weeks to 12 months
Nearly every release is documented
notes for 25 of 26 stable releases
1 version withdrawn
withdrawn after publishing
7 years old
29 releases · first in 2020
0 releases in the last 12 months
see the full history below
Release timeline
29 releases · Feb 2020 to Jul 2025Releases
latest 29-
3.1.002 Jul 2025 -
3.0.025 Feb 2025 -
2.4.415 Jul 2024 -
2.4.309 Jul 2024 withdrawnRelease notes
Open source →- Stop using
JsonKey(ignore: true)in favour ofJsonKey(includeFromJson: false, includeToJson: false)(thanks to @lrsvmb)
- Stop using
-
2.4.202 Jul 2024 -
2.4.112 Jul 2023Release notes
Open source →- The generic type of
@With/@Implementsnow defaults toObject?instead ofdynamic - Allow enabling/disabling all
when/mapvariants at once (thanks to @gaetschwartz)
- The generic type of
-
2.2.014 Oct 2022Release notes
Open source →- Re-introduced
@With.fromStringand@Implements.fromStringto allow unions to implement generic types. (thanks to @rorystephenson)
- Re-introduced
-
2.1.015 Jul 2022Release notes
Open source →- Add support for de/serializing generic Freezed classes (Thanks to @TimWhiting)
-
2.0.306 May 2022 -
2.0.120 Apr 2022Release notes
Open source →- Fixed a bug where the generated when/map methods were potentially invalid when using default values
- Fixed a bug where when/map methods were generated even when not necessary
-
2.0.019 Apr 2022Release notes
Open source →-
Breaking: freezed_annotation no-longer exports the entire package:collection
-
Breaking Removed
@Freezed(maybeMap: )&@Freezed(maybeWhen: )in favor of a separate:@Freezed(map: FreezedMap(...), when: FreezedWhenOptions(...)) -
Feat: Add screaming snake union case type (#617) (thanks to @zbarbuto)
-
Added
@unfreezedas a variant to@freezed, for mutable classes
-
-
1.1.011 Dec 2021Release notes
Open source →Added support for disabling the generation of
maybeMap/maybeWhen(thanks to @Lyokone) -
1.0.016 Nov 2021 -
0.15.008 Oct 2021Release notes
Open source →-
Breaking Changed the syntax for
@Withand@Implementsto use a generic annotation. Before:@With(MyClass) @With.fromString('Generic<int>')After:
@With<MyClass>() @With<Generic<int>>()
-
-
0.14.317 Jul 2021 -
0.14.213 May 2021Release notes
Open source →- Added the ability to specify a fallback constructor when deserializing unions (thanks to @Brazol)
-
0.14.114 Mar 2021Release notes
Open source →- Added the ability to customise the JSON value of a union. See https://github.com/rrousselGit/freezed#fromjson---classes-with-multiple-constructors for more information (Thanks to @ookami-kb)
-
0.14.004 Mar 2021Release notes
Open source →-
Stable null safety release
-
removed
@nullable. Instead of:factory Example({@nullable int a}) = _Example;Do:
factory Example({int? a}) = _Example; -
removed
@late. Instead of:abstract class Person with _$Person { factory Person({ required String firstName, required String lastName, }) = _Person; @late String get fullName => '$firstName $lastName'; }Do:
abstract class Person with _$Person { Person._(); factory Person({ required String firstName, required String lastName, }) = _Person; late final fullName = '$firstName $lastName'; }
-
-
0.13.0-nullsafety.023 Jan 2021 pre-releaseRelease notes
Open source →-
Migrated to null safety
-
removed
@nullable. Instead of:factory Example({@nullable int a}) = _Example;Do:
factory Example({int? a}) = _Example; -
removed
@late. Instead of:abstract class Person with _$Person { factory Person({ required String firstName, required String lastName, }) = _Person; @late String get fullName => '$firstName $lastName'; }Do:
abstract class Person with _$Person { Person._(); factory Person({ required String firstName, required String lastName, }) = _Person; late final fullName = '$firstName $lastName'; }
-
-
0.12.019 Sep 2020Release notes
Open source →-
Added
Assertdecorator to generateassert(...)statements on Freezed classes:abstract class Person with _$Person { @Assert('name.trim().isNotEmpty', 'name cannot be empty') @Assert('age >= 0') factory Person({ String name, int age, }) = _Person; } -
Added a way to customize the de/serialization of union types using the
@Freezed(unionKey: 'my-key')decorator.See also https://github.com/rrousselGit/freezed#fromjson---classes-with-multiple-constructors
-
-
0.11.013 Jun 2020Release notes
Open source →-
Added
@Withand@Implementsdecorators to allow only a specific constructor of a union type to implement an interface:@freezed abstract class Example with _$Example { const factory Example.person(String name, int age) = Person; @Implements(GeographicArea) const factory Example.city(String name, int population) = City; }Thanks to @long1eu~
-
-
0.11.0+102 Aug 2020Nothing published for this version
-
0.11.0-dev01 Jun 2020 pre-releaseNothing published for this version
-
0.7.124 Feb 2020 -
0.7.021 Feb 2020 -
0.6.015 Feb 2020 -
0.4.013 Feb 2020 -
0.3.113 Feb 2020 -
0.3.013 Feb 2020