Hi,Welcome to come to see me! What I do is generate dart beans based on json, as well as generics parameters and json build instances
- Search 'FlutterJsonBeanFactory' in Intellij Idea Plugin Repositroy Or AndroidStudio Plugin Repository And Install it.
File --> Settings --> Plugins --> Browse Repositories -->Search FlutterJsonBean - Restart your Develop tools
- Press shortcut key
alt
+j
for mac , right click on package ->New
->Dart bean clas file from JSON
And Then you will know how to use - If you change the fields in the class, just press the shortcut alt + j to regenerate the tojson and fromjson methods. The generated method regenerates all helper classes and JsonConvert classes (the same as the shortcut alt + j) each time an entity file is created in the generated/json directory.
- If you need generic conversions in your network requests, use the jsonconvert.fromjsonast method directly.
- If you don't want to use the FlutterJsonBeanFactory in your project, you can add flutter-json: enable: false to the pubspec.yaml file
- If no helper files are generated, you can delete the .idea directory and restart your idea
- 如果你有任何问题,添加QQGroup(963752388)随时提问 中文移步
- Welcome anyone to raise new issue.
- Welcome anyone to push a pull request to improve me.
- Thank @wuseal
- Thank @javiercbk/
- Thanks to JetBrains for helping the open source people by licensing me
- Support me by clicking the ⭐ button on the upper right of this page. ✌️
- Spread to others to let more people have a better develope expierience ❤️