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

Поділитися
Вставка
  • Опубліковано 30 сер 2021
  • 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  2 роки тому +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 🙏🏼🙏🏼🙏🏼

  • @apnachannelnitp1833
    @apnachannelnitp1833 Рік тому

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

  • @UjjwalSingh-ru5we
    @UjjwalSingh-ru5we 6 місяців тому

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

  • @syedalihussain6900
    @syedalihussain6900 4 місяці тому

    Well explained

  • @nayabtahir8454
    @nayabtahir8454 Рік тому

    Always good explanation and supportive attitude.
    Thankyou 👍

  • @thazeroword646
    @thazeroword646 2 роки тому +1

    Useful video

  • @vivekprasad2703
    @vivekprasad2703 2 роки тому +1

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

  • @user-ci5dc2tp5s
    @user-ci5dc2tp5s 11 місяців тому

    tq....

  • @amansingh.h716
    @amansingh.h716 2 роки тому

    very helpfull bro i like these tutorial instead of ui building

  • @ajoybiswas754
    @ajoybiswas754 2 роки тому

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

  • @ZahidAli-qd2cy
    @ZahidAli-qd2cy 2 роки тому

    keep it up brow u are awsome

  • @rayanali9737
    @rayanali9737 4 місяці тому

    👑

  • @atharvkhamkar8217
    @atharvkhamkar8217 Рік тому

    Thank you so much 👍

  • @abdullahkhalid8618
    @abdullahkhalid8618 Рік тому

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

  • @supercopsvssupervillian6472
    @supercopsvssupervillian6472 2 роки тому

    Thank-you

  • @khansawidhani9899
    @khansawidhani9899 2 роки тому

    Amazing.

  • @JK92007
    @JK92007 2 роки тому

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

  • @flutterpath9234
    @flutterpath9234 2 роки тому

    Thanks

  • @kamalCode
    @kamalCode 2 роки тому +1

    Automated serialization using code generation

  • @amitjajoo9510
    @amitjajoo9510 2 роки тому

    api calling using json serialization video pls

  • @abhayshandle
    @abhayshandle 4 місяці тому

    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  4 місяці тому +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 4 місяці тому

      @@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  4 місяці тому

      @@abhayshandle Exactly!

  • @kamalCode
    @kamalCode 2 роки тому +1

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

  • @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 😁

  • @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 Рік тому

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

  • @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