JSON Serializer in Flutter for better network requests
HTML-код
- Опубликовано: 5 авг 2024
- JSON #Serializer is a very handy package in the pub.dev and everyone should be aware that there is something like this. In this video, I explain how you implement the JSON serializer and how you can find all the information that you need.
⭐️⭐️ Helpful Ressources ⭐️⭐️
SourceCode: github.com/md-weber/network_r...
Previous Video: • Network Request - Flut...
Flutter Tutorial: flutter.dev/docs/development/...
Package Link: pub.dev/packages/json_seriali...
Blog Entry: myracledesign.de/blog/flutter...
⭐️⭐️ Follow me ⭐️⭐️
Twitter - / max_myracle
Github - github.com/md-weber
Medium - myracledesign.de/blog
⭐️⭐️ Support ⭐️⭐️
If you read this so far, thank you once more. If you like to support me, here are some links that could help me a lot.
Buy me a coffee - You are free to donate me a coffee so I can keep up my work.
www.buymeacoffee.com/MyracleD...
Amazon Affiliate Link - You buy for the same price and I get a small amount of it.
This leads to an amazing Flutter book that I can recommend to every beginner of flutter
amzn.to/2uOJXON
For every developer, a must-have and better said a must-read is the Clean Code book from Uncle Bob.
amzn.to/2u5yXMP Наука
Wonderful! Thank you so much for your hard work!
Thank you for an awesome videos .This help me a lot .Your videos save my time and I m able to learn faster .And I like the way You teach .😊
Amazing, its great to hear that you could learn something from it! :)
Good notes on updating the docs to point to the example project! Will do!
Hi Kevin,
thank you for letting us know :) I am looking forward to it!
@@FlutterExplained would you add an issue to github.com/dart-lang/json_serializable/ documenting what you'd want changed?
awesome, thank you!!!
Appreciate it!
Thanks man!
is the Api logic connection should be write in those classes ? or how do you pass the connection logic to those models ?
Thanks for the awesome content. However there is a question that I might find an answer from you, since I couldn't figure it out by googling around and check github issues.
Consider we have base models and there are bunch of other models that are inherited from base class. In that case, for all child constructors I need to pass parent's properties. Which is bad. If you can direct me to any point I'd be appreciated. Thanks.
There is problem when auto made json serialize if u look native Android custom json serialize
a tricky question: what if a key pairs with a list of dictionary? for example, ingridients:[{"item": "ginger", "qty":1}, {"item": "chicken", "qty": 1}]
Thank you this is cool.
Lets say I have multiple phone numbers for a single user, which comes as a list in side the person jason.
I want to add another phone number to the database.
How can I manage to do that.?
If I update the Person object, add the phone number to list and send the jason back to server?
Essentially, how to implement the one to many relation with this setting.
If you can do a tutorial video on that, it would be great!
Thanks again,
Thank you for the idea, I will take a look into it and try to find a way how to explain it in the best possible way :)
In short if you want to update something this is not the right video for you I guess, you would need a Fullstack backend and you would need to send a post request with the information. The server would take this request and save it to the database.
not working on me. [WARNING] No actions completed for 15.0m, waiting on:
- json_serializable:json_serializable on lib/models/users_model.dart
Could you try running the build runner with --delete-conflicting-output? Maybe could you give a little bit more insight?
That helped a lot... But now I have a nested map... Not a serialized string...
its not a proper way for complex data what if json consist a large number of data type which means we have to create whole variable in the class theirs sub class this is too messy
I would say that you should properly structure your data also on the API side, if this is not possible you could use isolates to handle your Json mapping but still you will get in a lot of trouble. But in general to have objects that matches your JSON is a very good idea.