JSON Serialization and Deserialization in Flutter | Convert to JSON | Flutter Tutorial | Hindi

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024
  • Sign up for 10,000 free minutes: bit.ly/3jyzOPl
    Find out more about ZEGOCLOUD: bit.ly/3VFR96F
    How to build video call app: bit.ly/3WLEbVO Instagram: / rohitsemriwal
    In this video we'll be taking a look at JSON serialization and de-serialization in Flutter. This video will help you find answers to questions like:
    1. What is JSON serialization?
    2. What is deserialization?
    3. How to serialize in Flutter?
    4. How to convert an object to JSON in Flutter?
    If you wanna learn 1 on 1 from me, DM me on Instagram: @rohitsemriwal / rohitsemriwal
    Don't forget to subscribe to the channel, so you don't miss out on any future updates.

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

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

    Forgot to zoom in the code😂, will fix it in the next one.

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

    Very nice explanation thankyou so much, everything is clear 🙏🏼🙏🏼🙏🏼

  • @UjjwalSingh-ru5we
    @UjjwalSingh-ru5we 7 месяцев назад

    Bhot bhot thank u apka jo apne ye explain Kiya wo b bhot acche way m

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

    You taught very well sir .
    Thank you very much sir 💓 ❤️❤️❤️

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

    Thanks you so much brother you are clearing all my doubts 😭😭😭👍👍

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

    Always good explanation and supportive attitude.
    Thankyou 👍

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

    Useful video

  • @amansingh.h716
    @amansingh.h716 2 года назад

    very helpfull bro i like these tutorial instead of ui building

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

      Thanks a lot! Glad I could help 😁

  • @syedalihussain6900
    @syedalihussain6900 5 месяцев назад

    Well explained

  • @abhayshandle
    @abhayshandle 5 месяцев назад

    well we can use dart:convert too, why make it so complicated? idk lemme know if m missing on something, just call on jsonDecode(jsonStr), and jsonEncode(jsonStr), and ig ur work is done?

    • @RohitSemriwal
      @RohitSemriwal  5 месяцев назад +1

      jsonDecode(jsonStr) takes the JSON string and converts it to a Map/Array in Dart/Flutter.
      jsonEncode(obj) takes the Map/Array and converts it to a JSON String (reverse of jsonDecode).
      But when using custom models(classes).. let's say a UserModel, it is required to convert it to a map first before encoding it to a JSON String.
      Same goes for the decoding, jsonDecode(str) will decode the String and give us a map.. but we'll have to assign the values from the map to the corresponding properties in your custom class.
      So basically, jsonEncode and jsonDecode work with Maps and Strings only.
      Adding custom classes introduces a new level of conversion to be done.
      Your statement is true only if you're using Maps for everything in your app, which is just not recommended at all.

    • @abhayshandle
      @abhayshandle 5 месяцев назад

      @@RohitSemriwal yeah, here's what gemini had to say, i mean yeah we shouldn't practice something like that, technically Flutter can understand and work with JSON data directly using objects. However, converting JSON to custom Dart objects offers several advantages over relying solely on maps:While directly using maps for JSON data is technically possible in Flutter, it's generally recommended to create custom objects for the reasons mentioned above. The extra step of conversion provides benefits in terms of type safety, code readability, maintainability, functionality, and library integration.

    • @RohitSemriwal
      @RohitSemriwal  5 месяцев назад

      @@abhayshandle Exactly!

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

    👍👍👌👌please one real world example...

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

    Thank you so much 👍

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

    Sir, dart stream, single subscription, Broadcast stream, why use explain in more detail हिंदी भाषा

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

    Please make video on retrofit chopper for flutter json fetch thank you

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

    Can you please make a video on crud operations using Bloc?

  • @ZahidAli-qd2cy
    @ZahidAli-qd2cy 2 года назад

    keep it up brow u are awsome

  • @ShahzaibKhan-wh5hh
    @ShahzaibKhan-wh5hh 2 года назад

    sir mere 3 Question hai
    1)vscode me flutter app bna ny k liye android studio ko install krna
    or android studio me uski sdk android version ko bi download krna zarori hota hai kia ya flutter ki sdk hi thk hai
    2) android studio k bagair apna mobile vscode me connect kr sakhty hai flutter app launch krny k liye
    3) flutter app ko pc coreDu2 windows 32 bit me bna sakhty hai

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

      1. Haan Android Studio install Krna zaroori h kyuki flutter code end me compile Android studio ke SDK se hi hota h.
      2. Baat sirf Android Studio ki nhi h, Android studio ke sath sath bohot saari aur cheezein jaise command line tools, platforms, SDKs aur sab aata h. Uski wajah se wo to use Krna hi padega. Uske bina ye sab alag se install krne me saalon jaaenge😂
      3. Nhi bana skte, aur agar bana skte h to bohot bura experience rahega.

    • @ShahzaibKhan-wh5hh
      @ShahzaibKhan-wh5hh 2 года назад

      @@RohitSemriwal thanks

    • @ShahzaibKhan-wh5hh
      @ShahzaibKhan-wh5hh 2 года назад

      @@RohitSemriwal java bi install krna hai

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

      @@ShahzaibKhan-wh5hh haan Java JDK bhi important h

    • @ShahzaibKhan-wh5hh
      @ShahzaibKhan-wh5hh 2 года назад

      @@RohitSemriwal thanks bro apky channel ko subscrieb kr dia hai

  • @user-ci5dc2tp5s
    @user-ci5dc2tp5s Год назад

    tq....

  • @rayanali9737
    @rayanali9737 5 месяцев назад

    👑

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

    When you are starting series of getX state management with flutter ?

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

      Got it on my list, will keep you updated 😁

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

    Thanks

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

    Thank-you

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

    Automated serialization using code generation

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

    api calling using json serialization video pls

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

    Amazing.

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

    Sir iam very confused how to fetch complex data from api like nested objects , fetch data from list of array. Can. U give me some hint or idea like how to deserialize nested objects clearly

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

      I'll make a video on that as soon as I'm done with the Chat App Series that's currently in progress on the channel. Thanks for watching 🙏

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

      @@RohitSemriwal please sir make on video on how to fetch complex data from api like nested objects , fetch data from list of array.