The WhiteCodel JSON to Dart Model Converter is a Visual Studio Code extension that allows you to quickly convert a JSON structure into a Dart model. This extension simplifies the process of generating Dart models from JSON, helping you streamline your Flutter development workflow.
Features
JSON to Dart Conversion: Converts any JSON input into a Dart model string.
Null Safety Support: Optional support for Dart's null safety feature.
Customization Options: Offers several customization options, including:
Put Encoder/Decoder in Class
Make All Required
Make All Final
Generate CopyWith Method
Use num for Number
Nested JSON Handling: Efficiently handles complex and nested JSON structures.
Single File Output: Saves all generated classes in the same file for ease of use.
Installation
Open Visual Studio Code.
Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window.
Search for "WhiteCodel JSON to Dart Model Converter".
Click Install.
Usage
Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).
Type WhiteCodel JSON to Dart and select the command.
Enter or paste your JSON structure into the input box.
Customize your options as needed.
The extension will generate a Dart model based on your JSON and selected options.
The output will appear in the designated output area or file.