DZ Dart Model Generator
A VS Code extension that generates Dart models from JSON input instantly.
Features
- Convert JSON to Dart model with a single command.
- Generates immutable models with
copyWith , fromJson , equals , hashCode and toJson methods.
- Supports nested JSON structures.
- Optional Equatable support for easier equality checks.
- Option to create pure Entities for Domain.
Installation
- Open VS Code.
- Go to Extensions (
Cmd + Shift + X or Ctrl + Shift + X ).
- Open terminal:
code --install-extension nishantkumarrai.nishant
Usage
- Open a Dart file.
- Press
Cmd + Shift + P (Mac) or Ctrl + Shift + P (Windows/Linux).
- Select "DZ JSON TO DART".
- Enter the model name and paste your JSON.
- Select
yes if you want to use Equatable package for equality checks.
- Select
yes if you want to generate Entity for your domain
Commands
Command |
Description |
extension.generateDartModel |
Converts JSON to a Dart model |
Requirements
- Dart & Flutter installed.
- VS Code v1.98.0 or later.
- Equatable package (Optional if you want to use, but recommended)
Release Notes
0.0.2
- Added support for Equatable package.
- Option to generate Entity for domain.
| |