Це відео не доступне.
Перепрошуємо.

Flutter Convert JSON to Dart Model Classes

Поділитися
Вставка
  • Опубліковано 31 лип 2024
  • Hey Guys, in this Flutter video you will learn how to convert json to dart model classes and objects. You will learn how to parse json to dart models manually and automatically, by using a flutter json serializable library.
    You will learn how to deal and parse simple json objects to dart models and then how to parse complex json objects to dart models and objects as well.
    We will use json_serializable library to implement the automatic part.
    For more Flutter content be sure to subscribe to the channel and turn on your notifications.
    check out my Flutter tutorial to become Flutter hero: • Flutter Tutorial for B...
    Links:
    Don't click this: bit.ly/3dkJUNB
    Pub dev library: pub.dev/packages/json_seriali...
    Library example: github.com/google/json_serial...
    GitHub Source code: github.com/Coding-Orbit/flutt...
    -------- Content of this video --------
    00:00 Intro
    00:32 Manual JSON conversion
    04:43 Automatic JSON conversion
    #flutter #flutter_json #flutter_json_serializable #flutter_json_to_model

КОМЕНТАРІ • 31

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

    Awesome straight to the point

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

    As usual, great video

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

    Great Content. Keep going on!

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

    Very helpful thank you so much

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

    Nice tutorial, thanks for share, cheers from Brazil

  • @911christophe
    @911christophe 2 роки тому

    thanks mister

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

    congratulations, the video and info excellent for dummies, i not listen english only view all video, perfect the use tools for create automatic json to model class,
    the time speed. ufff
    You have how to, ?
    create automatic the folder and dowloand json url or api rest and save local folder,
    save data or update data to filejson
    and send file json to sample api

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

    ❤‍🔥❤‍🔥❤‍🔥

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

    👍🏾

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

    great topic, great explaination. why are these needed? and why factory only for "fromjson"?

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

      They are needed to convert your model from and to json format to make api calls but its not required to be generated you could type it yourself

  • @mawahebk
    @mawahebk 29 днів тому

    i m new to Flutter and i found that it is super super complex and inefficient to write all this code with so many repetition for the fields .... JSON import should be easy, apparently not in flutter!

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

    Please make a video on flutter package dio post form data to api. Its humble request. Thank you

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

    Good tutorial please can I do the same with frommap 🙏

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

      Sure thing it does that for frommap as from json

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

    Good video

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

      Thank you!

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

      @@codingorbit I have one questions have you ever use stacked architecture?

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

      No I haven’t

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

    Hello, can you please tell me what is the need of coverting json to dart objects rather than directly getting the data as a list of Maps or Maps directly and using it . Please answer

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

      Most APIs use json or xml formats so when you call an API you’re most likely expecting a json result and json actually looks like a map so you can use it as a map and if there is list so you can use a list of maps but that isn’t a good practice since relying on maps that much might cause errors and its hard to develop. Let’s say we got a result and we named it result and this result has another map called data and under data you have a name so you would write result[“data”][“name”] while if your using models with the same names you would type result.data.name knowing that if you have typing error using maps it wouldn’t appear unless you run the app but if your using models it would appear immediately if you wrote names instead of name so names isn’t recognised. Besides models are easy to use and handle

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

      @@codingorbit thankyou so much for explaining in detail. God bless you ❤

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

      My pleasure!