Flutter Tutorial - Convert JSON To Object & Object To JSON | JSON Serializable

Поделиться
HTML-код
  • Опубликовано: 5 авг 2024
  • Learn how to convert JSON to Dart and Object To JSON with the package JSON Serializable in Flutter.
    Click here to Subscribe to Johannes Milke: ruclips.net/user/JohannesMilke...
    👉 12 Week Flutter Training | heyflutter.com
    👉 Flutter Masterclass Courses | heyflutter.com/masterclass
    Source Code | github.com/JohannesMilke/json...
    My Courses | heyflutter.com
    Follow Newsletter | johannesmilke.com/#/newsletter
    SUBSCRIBE HERE
    bit.ly/JohannesMilke
    SUPPORT & SPONSOR ME
    github.com/sponsors/JohannesM...
    RESOURCES
    Generate Hashcode, Equals, ToString Tutorial: • Flutter Tutorial - Com...
    Shared Preferences & JSON Tutorial: • Flutter Tutorial - Sha...
    Load & Save JSON Complete GUIDE Tutorial: • Flutter Tutorial - Log...
    Load JSON From Network Tutorial: • Flutter Tutorial - Fut...
    Null Safety In 5 Minutes Tutorial: • Flutter Tutorial - Nul...
    Migrate App To Null Safety Tutorial: • Flutter Tutorial - Mig...
    Flutter Upgrade Tutorial: • Flutter Tutorial - Flu...
    Copy To Clipboard Tutorial: • Flutter Tutorial - Cop...
    Google Sheets API Tutorial: • Flutter Tutorial - Goo...
    Global Key Tutorial: • Flutter Tutorial - Flu...
    Value Key Tutorial: • Flutter Tutorial - Flu...
    Unique Key Tutorial: • Flutter Tutorial - Flu...
    Object Key Tutorial: • Flutter Tutorial - Flu...
    Page Storage Key Tutorial: • Flutter Tutorial - Flu...
    TIMELINE
    0:00 Introduction JSON Serializable
    0:21 Install JSON Serializable
    0:51 Generate JSON / Generate fromJSON & toJSON
    0:59 Step 1: Annotate Model Class
    1:43 Step 2: Add toJSON & fromJSON
    2:14 Run Generation Command
    3:09 Use In App toJSON & fromJSON
    3:38 Generate Nested Model Objects
    SHARE | SUBSCRIBE | LIKE FOR MORE VIDEOS LIKE THIS
    *********
    SOCIAL MEDIA: Follow Us :-)
    Twitter | / heyflutter_
    Linkedin | / heyflutter
    LEARN MORE
    SOURCE CODE | github.com/JohannesMilke
    ARTICLES | / johannesmilke
    PLAYLISTS
    All Flutter Videos | • Flutter Tutorial - Flu...
    Widgets - Flutter | • Flutter Tutorial - Flu...
    Plugins - Flutter | • Flutter Tutorial - Flu...
    Animations - Flutter | • Flutter Tutorial - Tra...
    Designs - Flutter | • Flutter Tutorial - Flu...
    Firebase - Flutter | • Flutter Tutorial - Pag...
    State Management - Flutter | • Flutter Tutorial - Riv...
    CREDITS
    Copyright song "Corporate Technology" by scottholmesmusic.com
    #Flutter #Tutorial #JohannesMilke
    LIKE & SHARE & ACTIVATE THE BELL
    Thanks For Watching :-)
    bit.ly/JohannesMilke
  • НаукаНаука

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

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

    This might help you :)
    👉 12 Week Flutter Training from Newbie to Expert: heyflutter.com
    Source Code: github.com/JohannesMilke/json_serializable_example
    Generate Hashcode, Equals, ToString Tutorial: ruclips.net/video/KRupSlqAMqs/видео.html
    Shared Preferences & JSON Tutorial: ruclips.net/video/szOllHT1S7Y/видео.html
    Load & Save JSON Complete GUIDE Tutorial: ruclips.net/video/-32HIsRf26o/видео.html
    Load JSON From Network Tutorial: ruclips.net/video/Rlf5q2EGHzc/видео.html
    Null Safety In 5 Minutes Tutorial: ruclips.net/video/Q_WloMNKOkU/видео.html
    Migrate App To Null Safety Tutorial: ruclips.net/video/GLnQphHi1BY/видео.html
    Flutter Upgrade Tutorial: ruclips.net/video/0QC7S1nUmpY/видео.html
    Copy To Clipboard Tutorial: ruclips.net/video/whVnZnSsU3o/видео.html
    Google Sheets API Tutorial: ruclips.net/video/3UJ6RnWTGIY/видео.html
    Global Key Tutorial: ruclips.net/video/jlZ8GV_3nnk/видео.html
    Value Key Tutorial: ruclips.net/video/-F_5yHm_Zso/видео.html
    Unique Key Tutorial: ruclips.net/video/WhnB_5yjyWQ/видео.html
    Object Key Tutorial: ruclips.net/video/WQpPMYxxTfg/видео.html
    Page Storage Key Tutorial: ruclips.net/video/sMD4Qxn9q_E/видео.html

  • @ShuaibShahzan
    @ShuaibShahzan 3 года назад +4

    As always wonderful tutorial. Thank you so much @JohannesMilke for coming up with such great tutorials. Can you please make a tutorial on how to persist the theme changes in Shared Preferences?

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

    Amazing, thank you for all you are doing for us

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

    Thank you, sir. I really appreciate this video. I hope you will upload more videos like this.

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

    Thanks you for all bro, you are incredible ❤

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

    Thanks for this video. Now I know how to make automatically json from my model.

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

    Thanks 😍🤘

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

    Amazing video. Saved my life!

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

      Glad to hear that, Thank you Lofi Coder! 😊

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

    Amazing info I wish you make video for json patch in flutter

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

    Appreciate your work. Awesome voice and quality of lesson delivery. Thank you so much!

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

    great tutorial dude thanks

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

      Glad you liked it, Mitra 😀

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

    Cool video ... Again a request ... Could you plz make a full tutorial on glassmorphism ui in flutter, could be very helpful .. thank you 🙏

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

    It will get more complicated when we work with multiple nested classes, colors and date time.. Would be great to have a video for that!

  • @md.ruhulamin7963
    @md.ruhulamin7963 3 года назад

    Thank you sir. Is it possible to create fromMap(), and toMap() method for store and retrieve data from SqLITE database, by using this package?

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

      Thanks, Md.Ruhul Amin! 🙂 it doesn't matter simple name it fromJson and toJson which are more common. Learn more about using SQFlite here: ruclips.net/video/UpKrhZ0Hppk/видео.html

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

    Because every version of flutter_test from sdk depends on meta 1.3.0 and json_annotation >=4.1.0 depends on meta ^1.4.0, flutter_test from sdk is incompatible with json_annotation >=4.1.0.
    i receive this kind of error, how to solve this?

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

      Thank you, Wahyu A! 🙂 you can use override dependencies and in it you can place lower version of dependency which is causing issue

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

    Can you make a tutorial on how to add a search option for the long list of cards?
    Like we have search option in contacts app to search the names.

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

      Thanks, LORD GULSHAN! 🙂 Learn more about search here:
      1) Search & Filter: ruclips.net/video/oFZIwBudIj0/видео.html
      2) Search App Bar: ruclips.net/video/RaACAwvZ61E/видео.html
      3) Autocomplete Search: ruclips.net/video/ybV1aIyKFE0/видео.html

  • @RajA-me9cl
    @RajA-me9cl 3 года назад

    Greetings Johan,
    May you please share the link to in-app purchase tutorial?
    Thank you.

    • @RajA-me9cl
      @RajA-me9cl 3 года назад

      @@HeyFlutter You can add Firestore data modeling as well. 😬

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

    Should we care to merge those g part files into class? or it's fine that way?

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

      Thank you, Hardik! 🙂. It is fine.

  • @dhararabadiya2581
    @dhararabadiya2581 11 месяцев назад

    How can we store custom model object into local database in flutter using flutter secure storage??

    • @HeyFlutter
      @HeyFlutter  11 месяцев назад

      Hey, @dhararabadiya2581 🙂 model object can't be stored directly you'll have to convert it to json first and any model can be converted to json

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

    Harika :)

  • @alhaidarai
    @alhaidarai Месяц назад

    Wonderful tutorial as always but what is the difference if i did it manuanly it seems just an extra files for the project

    • @HeyFlutter
      @HeyFlutter  Месяц назад

      Thank you, @alhaidarai! 🙂. Please try to provide enough details with your question.

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

    Please also make array data to json and vice-versa

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

    It prints -> Instance of 'Person' instead of Person(name: Jack)
    Could you please tell me how to print data like as you shown

    • @HeyFlutter
      @HeyFlutter  Год назад +1

      Thank you Deepak shah, make sure to follow the tutorial step by step 🙂

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

      @@HeyFlutter Today I got the solution actually I forgot to add toString() method in model class.

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

    what about complex JSON structure?

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

      Thanks, Mg Myo! 🙂 How do you define complex?
      Learn more about complex JSON here:
      1) ruclips.net/video/szOllHT1S7Y/видео.html
      2) ruclips.net/video/-32HIsRf26o/видео.html

  • @akmaljorakhulov9816
    @akmaljorakhulov9816 Год назад +1

    👍👍👍

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

      Thank you, Akmal Jorakhulov! 🙂

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

    I think generate with extension “Json to dart” better

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

      Is that a VSCode extension?

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

      @@StarBattle08 yeap

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

      Thanks, Name Lastname! 🙂 Of course there are many ways to do this, I wanted to show only a global way without extensions, since extensions are commonly supported only for one specific IDE.

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

    Need to pay for the source code ??? 😦😦😦

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

      Thank You Dev Software!. I showed the main functionality, which is important for this package. Learn more about it here: github.com/JohannesMilke/sponsorware

  • @MohammadAli-vj4sr
    @MohammadAli-vj4sr 3 года назад +1

    👎👎