Loading topic
Intermediate · Mid: 15 chapters · 27 min read. States assumed prerequisites
Start readingfreezed is required yet.final fields, and null safety. This chapter uses those features to explain how objects compare in Dart and why immutable data classes need generated equality.freezed uses Dart code generation, so the source file and the generated file work together.freezed_annotation, freezed, and build_runner configured.freezed setup with build_runner. The examples use a generated file, so run the generator after changing the class declaration.freezed with build_runner. This chapter shows how to change an immutable object without modifying the original object.build_runner. The goal is to choose the right field declaration for values that may be omitted, may be null, or must satisfy a rule.freezed generates a second Dart file from your class declaration.freezed works with json_serializable to convert immutable objects to and from JSON.freezed unions. It also assumes Dart 3, including sealed classes, pattern matching, and switch expressions.freezed code generation.freezed classes. It also assumes that code generation is configured with build_runner.flutter test usage. It also assumes that Person is a freezed class and that its generated files are current.freezed, freezed_annotation, json_serializable, and build_runner.The learning path is unavailable right now
We could not load the prerequisites for this topic. The tutorials on this page are not affected. Reload in a little while to try again.