Skip to main content

Instantly parse JSON

You must know about the JSON  . Don't worry I am not here to teach this because I am not a good teacher 😉. If you are really interested to learn about it then just search on the Google or check   Parsing complex JSON in Flutter  (Personally recommended) because she covers almost all things. Now, do you have time to write such classes in such a digital age?? Great 👍 then just see  https://app.quicktype.io/ . Really a good job 👏 What you need to do  Copy JSON   Paste in JSON area Give the Model name Copy code Let me explain it to you. They have a text area in which you need to copy the JSON and then Copy the dart code. They also have other language support also.  Thanks.  Please comment below how I can improve this article

Use Flutter Dependencies as Local Package

 

Pub.dev is a very cool tool in the Flutter world and every flutterian must knows about it. You just need to write the package in pubspec.yaml file YAML Langauge and run pub get that's it. Wow so cool! The main benefit of this is that your project will always get sync with the mention version in the pubspec file. 

But sometimes we also want to use Dependency as a local code. Let me tell you a way

I am going to use  flutter_share: ^1.0.2+1


pubspec.yaml file with flutter share dependencies from pub.dev

Step 1. Find dependency in the Dart package folder of External Library

Step 2. Find the same folder in your Finder/File explorer  


Step 3. Move dependency to the root folder of the project


Step 4. Rename to something unique so that pubspec cache identifies that folder as unique. I like to replace "."(dot) with "_" (Underscore) 
Step 5. Change the path in pubspec.yaml file
Final Step. Run pub get... :)

Note: - 1.  Don't forget to set the unique name as this is important
            2. You can remove the useless folder like example




Popular posts from this blog