He explained this in the video, the server gives data, which the model converts into an object. Then you pass that model and map it to an entity. Then in the presentation layer you use the entity.
If i use freezed for modeling, how do i manage model , entity. And where should be that freezed model ? domain or data layer. My question is, how can we use freezed in clean architecture?
Freezed class and toEntity method/fromEntity factory must be placed in data layer in model only. Entity - this is a simple and clean class without any logic. Freezed is very useful for model generation, this package can save you from a boilerplated code, but build runner is very slow on the big projects. If you using any other generators like retrofit generator, hive generator or riverpod generator, building/watching in the project with a many of freezed model becomes painful.
I have a question when rendering in the UI layer do you used entities or models? or when setting up in the bloc state?
I think it makes more sense to use entities when it comes to the presentation layer
He explained this in the video, the server gives data, which the model converts into an object. Then you pass that model and map it to an entity. Then in the presentation layer you use the entity.
I would suggest to make notes or presentation lot of things said skips in mind better to go point by point .. great and useful video , thanks
I don't call my model, I call it Entities and DTOs
If i use freezed for modeling, how do i manage model , entity. And where should be that freezed model ? domain or data layer. My question is, how can we use freezed in clean architecture?
Freezed class and toEntity method/fromEntity factory must be placed in data layer in model only. Entity - this is a simple and clean class without any logic. Freezed is very useful for model generation, this package can save you from a boilerplated code, but build runner is very slow on the big projects. If you using any other generators like retrofit generator, hive generator or riverpod generator, building/watching in the project with a many of freezed model becomes painful.
❤❤❤