Flutter: Auto Create Models from JSON | Serializable

Поділитися
Вставка
  • Опубліковано 19 жов 2024
  • In this video, I will explain how to make model classes automatically from your json.
    #Trending #Flutter #JSON
    Please give stars for this project on git and like the video.
    Source Code - github.com/iam...
    Read my articles on medium - / imthepk
    My portfolio - pawan.live
    Flutter UI Kit - goo.gl/N2RxBf
    Flutter Example Apps - goo.gl/8hZQkq
    Instagram - / codepur_ka_superhero
    FB Group - / 425920117856409
    Slack Group - letsflutterwit...
    New Channel - / codepur
    Be sure to ask for help in the comments.
    Please Subscribe my channel to motivate me.
    Subscribe Our Channel: goo.gl/BlFui4
    Connect with us on social media:
    Facebook: / mtechviral
    Pawan Kumar - / imthepk
    Ask Pawan Kumar - / thepawankumaar
    Instagram - / codepur_ka_superhero
    Twitter: / imthepk
    LIKE | SHARE | SUBSCRIBE FOR MORE VIDEOS LIKE THIS
    THANKS FOR WATCHING!

КОМЕНТАРІ • 41

  • @abhalla
    @abhalla 5 років тому +5

    I have watched your videos for a long time now, and it's incredible seeing how the quality of your videos has simply skyrocketed. You have always been my go-to source, keep it up!

    • @HelloCodepur
      @HelloCodepur  5 років тому

      Thanks, Sam. Means a lot and keep supporting.

  • @atiabjobayer
    @atiabjobayer 4 роки тому

    I have been facing trouble with long ass json for a long time and this video just made my day. Thank you so much!!!

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

    I really enjoyed it.

  • @vishalmakam7291
    @vishalmakam7291 3 роки тому +1

    Most important topic is covered, thank you

  • @manecioputik7668
    @manecioputik7668 4 роки тому

    Currently, I'm also using the JsonPlaceholder but I've installed it locally on my localhost. Since JsonPlaceholder doesn't support JWT, I've installed a jwt library jsonServer_auth. I've created separate project for my FlutterApp and one for my JsonServer. In JsonServer, I've added db.json file which displays all the json files from placeholder. So whenever I work on my project, I first run my JsonServer using json-server --watch db.json:auth so it would include the JWT feature. Now, my question would be, If i'm going to use this automated json_serialization, should I stop using my local jsonServer and db.json? Because I found it on your example that you copy pasted a json object into Post.json under models folder. Should I get rid of running my localhost jsonServer if use this json_serialization? Thank you so much.

  • @Jason-eo7xo
    @Jason-eo7xo 5 років тому +1

    Awesome explanation thanks!

  • @rutvikphoto3318
    @rutvikphoto3318 3 роки тому

    Hello Pawan
    but now what if i am getting my JSON from API calls and then how can i generate this model?
    Your small guidance would be appreciated

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

    thanks a lot for this tip it was really helpful. can you also explain how to create for dynamic lists of jsons having dynamic lists again

  • @szarejas
    @szarejas 5 років тому +2

    Very good explanation. And there is no tutorial about full local json app with this metod. Maybe there is topic for You?

  • @raveeshdotme
    @raveeshdotme 4 роки тому

    Love it! Flutter china community is doing some really awesome stuff

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

    I understand how to make this model but I cant understand How to implement these methods from the model. especially when I have nested json. Can anyone help!

  • @its_me_mahmud
    @its_me_mahmud 5 років тому +1

    Great explanation!
    Can you please show that how to parse a nested array like below
    [
    "id": 1,
    "name": "John",
    "images": [
    {
    "imageId": 1,
    "imageName": "Blue Sea"
    },
    {
    "imageId": 5,
    "imageName": "Blue Sky"
    }
    ]
    ]
    Thanks!!!

  • @emfbiennialupw1046
    @emfbiennialupw1046 4 роки тому

    hi bro, After this process. My App is not running. it gives griddle error

  • @emreesen9419
    @emreesen9419 4 роки тому

    Thank you

  • @amruta210189
    @amruta210189 4 роки тому

    hello..tried with same method but my command flutter packages pub run json_model does'nt run getting below error:
    flutter : The term 'flutter' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
    spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + flutter packages pub run
    + ~~~~~~~
    + CategoryInfo : ObjectNotFound: (flutter:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
    flutter doctor
    flutter packages get runs successfully
    Please help me asap

    • @amruta210189
      @amruta210189 4 роки тому

      this error resolved now getting below error
      Unhandled exception:
      FileSystemException: Directory listing failed, path = './jsons\*' (OS Error: The system cannot find the path specified.
      , errno = 3)
      #0 _Directory._fillWithDirectoryListing (dart:io-patch/directory_patch.dart:39:68)
      #1 _Directory.listSync (dart:io/directory_impl.dart:251:5)
      #2 walk (file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/json_model-0.0.2/bin/json_model.dart:28:18)
      #3 main (file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/json_model-0.0.2/bin/json_model.dart:18:6)
      #4 _startIsolate. (dart:isolate-patch/isolate_patch.dart:305:32)
      #5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
      pub finished with exit code 255

  • @DeprecatedAPI
    @DeprecatedAPI 5 років тому

    Somehow my build_runner script always ends up generating 0 outputs. It even happened when I was using MobX

  • @praharsh_bhatt
    @praharsh_bhatt 5 років тому

    Very informative video! Keep on churning 🔥

  • @moviesu-no4eo
    @moviesu-no4eo 5 років тому

    Hi bro,
    Pls make a video on Paytm integration with flutter with the capabilities of payment accept and refund amount with no order like mpl game or any other game that ask to pay first for quiz, when you pass or win the game, then pay the double or the listed amount, hope you reply soon or come with a video. I searched on internet but couldn't find a single video in flutter about paytm

  • @RaviKumar-uy9ij
    @RaviKumar-uy9ij 5 років тому +3

    Hi nice tutorial, but without dealing with any packages you get it done by app.quicktype.io, thanks

  • @blackclover2427
    @blackclover2427 5 років тому

    cool :-)
    i have do same thing a few month ago,
    it's based on Javascript.
    but i lost my script :(
    aaa
    It will be good, if's also can generate model from Postman,
    and also http request example

  • @mawulijo
    @mawulijo 5 років тому

    Amazing package

  • @kendalltau9419
    @kendalltau9419 5 років тому

    Hey,
    thanks for the good video.
    How can I push the code generator if the json data should be stored in a folder that is not called "jsons"?

  • @JAICHANGPARK
    @JAICHANGPARK 5 років тому

    👍🏿👍🏿👍🏿👍🏿👍🏿👍🏿

  • @shahidwani6445
    @shahidwani6445 4 роки тому

    I miss Newtonsoft.json in flutter

  • @ThEGeEeK
    @ThEGeEeK 5 років тому

    There are some nice sites just paste it and will genarate a model for it.

    • @keent
      @keent 4 роки тому

      app.quicktype.io? just found this one from other comments and this is 99% perfect. 1% being i can't specify that i don't want the toJson, only just the fromJson haha

  • @rushikeshkulkarni1784
    @rushikeshkulkarni1784 5 років тому

    Nice vdo sir please suggest me any course or blog to learn flutter

  • @MameMedouneDiopXpert
    @MameMedouneDiopXpert 5 років тому

    Hello, *awesome explanation*!
    How can we use json_model with a structure like this:
    [
    {
    "id": 1,
    "name": "John"
    },
    {
    "id": 2,
    "name": "Doe"
    }
    ]

  • @ThEGeEeK
    @ThEGeEeK 4 роки тому

    I guess quicktype.io/ does the same thing..

  • @arifikhsanudin9724
    @arifikhsanudin9724 4 роки тому

    Please zoom