Skip to content
Videos
Video

Data classes, cloning, and (de)serialization with Freezed in Dart and/or Flutter

by Tyler Codes youtube.com

41 min 996 views

Let’s take a deep dive into the world of freezed, a powerful data class/serialization generator. We’ll cover the most common use cases I use in my daily app development. If you like this video, comment to request a follow-up video in which we can discuss generics and other advanced topics. Chapters 00:00 - What is Freezed? 01:24 - Sandbox Walkthrough 05:21 - Installing Dependencies 06:32 - Initial Car Model 10:05 - Generate (build) Code 12:52 - Serializing Data 14:21 - Running Our Code 15:25 - Printing Details 17:19 - Booleans & Nullable Data 19:40 - Defaults 21:15 - JsonKey(name: ...) 22:54 - Analysis Options for Annotation 24:32 - Enums with JsonKey(toJson/fromJson) 30:32 - Tyler makes a Typo 32:10 - JsonKey(name: ...) again 33:38: - Custom Getters 35:07: - Clientside Properties 36:42 - copyWith(...) 38:10 - copyWith(...) Utility Methods 40:24 - Closing Remarks & What's Next The Code: https://github.com/tylersavery/freezed-guide

Forum

Questions about this, or something to add?

Discuss on the forum

Topics Code generation

Report this · Wrote this? Claim it

Supported by