Great video. Im not a huge fan of code generation because I lose control over the code but my coworkers loves it. Thank you for simple but helpful video
Great video! I've been wanting to get into code generation in flutter, especially with the Freezed package. This was a great intro! Great structure and length!
Me also use vs code extension, for generating “data class” and I generate just what I need. Freezed is great but he hide many unused code lines in the background and most begginers use it only for copywith 🤦♂️
Hey. I have a question about freezed (or json serializable) { "data": { this is a generic object and I cant parse with code generation }, "errorCode": "string", "errorMessage": "string", "exceptionMessage": "string", "isSuccess": true, } can you give an advice how to do it cleanly?
@@RobertBrunhage Thank you for your reply. I want something like that @freezed (or @JsonSerializable) BaseResponse{ T data; String errorCode; ... .... } T data represents other jsons. I want something to make calls like that -> Future userResponse
So happy to hear this. Gotten a lot of inspiration from him as well as tips! Feels nice to hear a genuine compliment about it as I can sometimes feel like I am being a copycat.. haha 😅 Working as hard as I can to make it more personal so thank you so much for the nice comment. It really made this week perfect!
@@RobertBrunhage i guess for me imitating/learning from someone's approach and getting all the useful stuff you can get to improve one's self and benefiting on it is not bad a thing 😁
In many cases (medium - big projects) code generation is recommended by the Google see here: flutter.dev/docs/development/data-and-backend/json So overkill for sure in smaller projects. Other then that you can go without code gen, these are just recommendations!
Great video. Im not a huge fan of code generation because I lose control over the code but my coworkers loves it. Thank you for simple but helpful video
Great video! I've been wanting to get into code generation in flutter, especially with the Freezed package. This was a great intro! Great structure and length!
Thanks Daniel. Very happy you found it helpful!
Also there is an extension in vs code, for generating “data class”. I used with equatable, and that’s it!!!
Yes it's great! Using it for a future video!
Me too. I don't have much time to generate like this. Extension is the best. 😁
@@sankoko3115 I only used with hive for typeAdapters classes. Hivedb is insane!
Me also use vs code extension, for generating “data class” and I generate just what I need. Freezed is great but he hide many unused code lines in the background and most begginers use it only for copywith 🤦♂️
@@RobertBrunhage where is the video
Always great !! Thanks a lot
Thanks a lot, so i don't have to use the Equatable packages for immutable classes?
Hey. I have a question about freezed (or json serializable)
{
"data": {
this is a generic object and I cant parse with code generation
},
"errorCode": "string",
"errorMessage": "string",
"exceptionMessage": "string",
"isSuccess": true,
}
can you give an advice how to do it cleanly?
What do you mean with generic object? If it is another object you create that one, and use it as a type in this class!
@@RobertBrunhage Thank you for your reply. I want something like that
@freezed (or @JsonSerializable)
BaseResponse{
T data;
String errorCode;
...
....
}
T data represents other jsons. I want something to make calls like that -> Future userResponse
@@OtarBediashvili have you found any references now?
Is that you liveoverflow?
Hey sir. Great vid! It's like a fireship style please take it as a compliment cause hey its effective. Gone are the boring days of code teaching 😁
So happy to hear this. Gotten a lot of inspiration from him as well as tips! Feels nice to hear a genuine compliment about it as I can sometimes feel like I am being a copycat.. haha 😅
Working as hard as I can to make it more personal so thank you so much for the nice comment. It really made this week perfect!
@@RobertBrunhage i guess for me imitating/learning from someone's approach and getting all the useful stuff you can get to improve one's self and benefiting on it is not bad a thing 😁
My favorit is built_value, which is a combination of freezed and json parser. Why did you choose freezed?
No particular reason what so ever. This was more to showcase how code generation can work, and some of the pros & cons!
yeah great :) I use the Dart Data Class Plugin for Code Generation :)
Trying it out now! It's great for sure!
I didn't know freezed, thanks for the tip !
Awesome, glad it helped!
Fireship 2?
He is a huge inspiration to me, so I am taking this as a compliment! 😅
wow ... thanks
Happy you enjoyed it! 😄
should use var keyword instead of typing out the whole class name for non-final declarations :)
duplicate*
Haha yeah noticed like 8h after upload 🤣
flutter is boilerplate.
It’s to complicated ...
Code generation is certainly not needed for everyone, but can be nice to know about!
Meh overkill, just install a plugin or something
In many cases (medium - big projects) code generation is recommended by the Google see here: flutter.dev/docs/development/data-and-backend/json
So overkill for sure in smaller projects. Other then that you can go without code gen, these are just recommendations!
The most redundant video on flutter, phew
Thanks for taking the time to write, was the topic redundant or the way it was presented?
Love to get feedback so I can improve for future videos! :)
I enjoy your videos but I find the squiggly lines very distracting.
Thank you, with squiggly lines what do you mean, could you link a timestamp?
You seem to have a Swedish accent.
I am swedish 😆
over engineering
I’ve never been able to get build_runner to work, always had a pub conflict when i tried