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
  • НаукаНаука

Комментарии • 20

  • @JakBeat
    @JakBeat Год назад

    Wonderful! Thank you so much for your hard work!

  • @amitmaurya3633
    @amitmaurya3633 3 года назад +3

    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 .😊

    • @FlutterExplained
      @FlutterExplained  3 года назад

      Amazing, its great to hear that you could learn something from it! :)

  • @kevmoo
    @kevmoo 4 года назад

    Good notes on updating the docs to point to the example project! Will do!

    • @FlutterExplained
      @FlutterExplained  4 года назад

      Hi Kevin,
      thank you for letting us know :) I am looking forward to it!

    • @kevmoo
      @kevmoo 4 года назад

      @@FlutterExplained would you add an issue to github.com/dart-lang/json_serializable/ documenting what you'd want changed?

  • @TutorialesTemuco
    @TutorialesTemuco 3 года назад +1

    awesome, thank you!!!

  • @ashvaish
    @ashvaish 2 года назад +1

    Appreciate it!

  • @kamryy_75
    @kamryy_75 Год назад

    Thanks man!

  • @intuneknight9681
    @intuneknight9681 2 года назад

    is the Api logic connection should be write in those classes ? or how do you pass the connection logic to those models ?

  • @erkinkurt6799
    @erkinkurt6799 3 года назад

    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.

  • @johirislam2640
    @johirislam2640 3 года назад

    There is problem when auto made json serialize if u look native Android custom json serialize

  • @zakkyang6476
    @zakkyang6476 3 года назад

    a tricky question: what if a key pairs with a list of dictionary? for example, ingridients:[{"item": "ginger", "qty":1}, {"item": "chicken", "qty": 1}]

  • @value8035
    @value8035 3 года назад +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,

    • @FlutterExplained
      @FlutterExplained  3 года назад

      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.

  • @teoprayogakartika3513
    @teoprayogakartika3513 4 года назад +1

    not working on me. [WARNING] No actions completed for 15.0m, waiting on:
    - json_serializable:json_serializable on lib/models/users_model.dart

    • @FlutterExplained
      @FlutterExplained  4 года назад

      Could you try running the build runner with --delete-conflicting-output? Maybe could you give a little bit more insight?

  • @dave.demmel
    @dave.demmel 7 месяцев назад

    That helped a lot... But now I have a nested map... Not a serialized string...

  • @codingskills7448
    @codingskills7448 3 года назад +2

    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

    • @FlutterExplained
      @FlutterExplained  3 года назад

      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.