Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>ModelizerNew to Visual Studio Code? Get it now.
Modelizer

Modelizer

Soham Kolhe

|
1 install
| (0) | Free
Intelligent Flutter & Dart Clean Architecture model generator and AST-aware updater for VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Modelizer

Modelizer Icon

Intelligent Flutter & Dart Clean Architecture Model Generator & AST-Aware Updater for VS Code

Version License: MIT Engine Dart


Overview

Modelizer is an intelligent, bidirectional VS Code companion engineered specifically for Flutter and Dart developers practicing Clean Architecture.

Unlike traditional "one-way" code generator scripts that destroy user modifications upon re-run, Modelizer embeds a syntax-aware Dart Lexer, AST Parser, and surgical source patcher. It not only generates pristine Domain Entities and Data Models from JSON, but also intelligently modifies existing files whenever you add, edit, rename, or remove fields—preserving all comments, annotations, and custom business logic.


Key Features

  • ⚡ Instant Clean Architecture Generation: Generate paired pure Domain Entities (UserEntity) and Data Models (UserModel) from JSON objects or arrays in seconds.
  • 🔄 Intelligent AST-Aware Field Modification: Add, rename, edit, or delete fields in existing Dart files. Modelizer updates the field declaration, generative constructor, fromJson, toJson, fromEntity, toEntity, copyWith, and equality methods simultaneously.
  • 🛡️ Custom Logic & Comment Preservation: AST token range mapping guarantees hand-crafted helper methods, getters, doc-comments (///), and annotations are never deleted or corrupted.
  • 🔒 Null-Safe copyWith Sentinel: Generates copyWith implementations that distinguish between an omitted parameter and explicitly passing null to clear a nullable field.
  • 🔁 Entity-Model Drift Synchronization: Compares an Entity and Model, highlights missing or mismatched fields, and applies bi-directional synchronization.
  • 🔍 Virtual Diff Previews: Review exact line-by-line diffs side-by-side using VS Code's native diff viewer before committing any file changes to disk.
  • 🌐 100% Offline & Zero External Process Prerequisites: Embedded pure-TypeScript Dart Lexer & AST Parser executes immediately on macOS, Linux, and Windows with zero network requests and no mandatory SDK dependencies.
  • 🎯 Native Dart Tooling Bridge: Automatically runs canonical dart format and dart analyze when a local Dart SDK is detected.

Supported Workflows

┌────────────────────────────────────────────────────────┐
│                      MODELIZER                         │
├──────────────────────────┬─────────────────────────────┤
│ 1. New Code Generation   │ 2. Existing File Evolution  │
├──────────────────────────┼─────────────────────────────┤
│ • Generate from JSON     │ • Add Field                 │
│ • Generate Model Only    │ • Edit Field                │
│ • Generate Entity Only   │ • Rename Field              │
│ • Nested Models & Lists  │ • Remove Field              │
│ • Clean Architecture Pair│ • Sync Entity & Model       │
│ • Type Inference Engine  │ • Regenerate Members        │
└──────────────────────────┴─────────────────────────────┘

1. Generate from JSON (Workflow A)

  1. Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P).
  2. Run Modelizer: Generate From JSON.
  3. Paste a JSON object or array.
  4. Enter base class name (e.g. User).
  5. Choose target:
    • Entity & Model Pair (Clean Architecture)
    • Data Model Only
    • Domain Entity Only
  6. Preview the proposed files in the side-by-side Diff Viewer.
  7. Click Apply Changes.

2. Add Field to Existing Model / Entity (Workflow B)

  1. Open any existing Dart entity or model file.
  2. Run Modelizer: Add Field (or right-click in editor).
  3. Enter field name (e.g., phoneNumber), type (String?), and JSON key (phone_number).
  4. If a counterpart file exists (e.g., user_entity.dart for user_model.dart), choose Update both Model and Entity.
  5. Modelizer surgically updates:
    • Field declarations
    • Primary constructor (required this... / super...)
    • factory Model.fromJson(...)
    • Map<String, dynamic> toJson()
    • factory Model.fromEntity(...)
    • Entity toEntity()
    • copyWith(...)
    • props or operator == / hashCode
  6. Preview diff and apply changes.

3. Rename Field (Workflow C)

  1. Run Modelizer: Rename Field.
  2. Select target field from QuickPick.
  3. Enter new name and choose whether to update the JSON key mapping.
  4. References across constructor, JSON methods, and entity converters update safely.

4. Remove Field (Workflow D)

  1. Run Modelizer: Remove Field.
  2. Select field to delete.
  3. The field and its references across all methods are removed cleanly.

5. Synchronize Entity and Model (Workflow E)

  1. Run Modelizer: Sync Entity and Model.
  2. Modelizer identifies structural discrepancies and displays an interactive checklist.
  3. Select fields to synchronize and apply.

6. Regenerate Members (Workflow F)

  1. Run Modelizer: Regenerate Members.
  2. Select specific methods to rebuild (fromJson, toJson, copyWith, etc.).
  3. Custom helper methods remain intact.

Code Generation Example

Generated Domain Entity (lib/features/user/domain/entities/user_entity.dart)

class UserEntity {
  final int id;
  final String name;
  final String? bio;

  const UserEntity({
    required this.id,
    required this.name,
    this.bio,
  });

  UserEntity copyWith({
    int? id,
    String? name,
    String? bio,
  }) {
    return UserEntity(
      id: id ?? this.id,
      name: name ?? this.name,
      bio: bio ?? this.bio,
    );
  }
}

Generated Data Model (lib/features/user/data/models/user_model.dart)

import '../../domain/entities/user_entity.dart';

class UserModel extends UserEntity {
  const UserModel({
    required super.id,
    required super.name,
    super.bio,
  });

  factory UserModel.fromJson(Map<String, dynamic> json) {
    return UserModel(
      id: (json['id'] as num).toInt(),
      name: json['name'] as String,
      bio: json['bio'] as String?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'name': name,
      'bio': bio,
    };
  }

  factory UserModel.fromEntity(UserEntity entity) {
    return UserModel(
      id: entity.id,
      name: entity.name,
      bio: entity.bio,
    );
  }

  UserEntity toEntity() {
    return UserEntity(
      id: id,
      name: name,
      bio: bio,
    );
  }

  UserModel copyWith({
    int? id,
    String? name,
    String? bio,
  }) {
    return UserModel(
      id: id ?? this.id,
      name: name ?? this.name,
      bio: bio ?? this.bio,
    );
  }
}

Configuration Settings

Configure via VS Code Settings (Cmd+, / Ctrl+,) search for Modelizer:

Setting Type Default Description
modelizer.dateStrategy enum 'iso8601' Date strategy: 'iso8601', 'timestamp', or 'string'.
modelizer.equalityStrategy enum 'plain' 'plain' (Dart operator== & hashCode) or 'equatable'.
modelizer.copyWithStrategy enum 'standard' 'standard' (clean idiomatic copyWith) or 'sentinel'.
modelizer.formatWithDart boolean true Automatically run dart format when Dart SDK is available.
modelizer.defaultModelSuffix string 'Model' Suffix for generated data model classes.
modelizer.defaultEntitySuffix string 'Entity' Suffix for generated domain entity classes.

Installation

From VS Code Marketplace

Search for Modelizer by Soham Kolhe in the Extensions view (Cmd+Shift+X / Ctrl+Shift+X), or install via terminal:

code --install-extension sohamkolhe.modelizer

From VSIX Package Directly

code --install-extension modelizer-1.0.1.vsix

Method 2: From VS Code Extensions View

  1. Open VS Code.
  2. Press Cmd+Shift+X (macOS) or Ctrl+Shift+X (Windows/Linux) to open the Extensions view.
  3. Click the ... menu in the top right of the Extensions panel.
  4. Select Install from VSIX...
  5. Choose modelizer-1.0.1.vsix.

Available Commands

Access all commands via Command Palette (Cmd+Shift+P on macOS / Ctrl+Shift+P on Windows/Linux) or the Modelizer Sidebar:

Command Identifier Description
Focus Sidebar modelizer.openSidebar Opens the Modelizer Clean Architecture sidebar panel
Generate From JSON modelizer.generateFromJson Generate paired Entity and Model from raw JSON
Generate Entity modelizer.generateEntity Generate pure Domain Entity from JSON
Generate Model modelizer.generateModel Generate Data Model from JSON
Add Selected Fields to UI Entity modelizer.addToUiEntity Parses comma-separated selection and injects into UI Entity
Add Selected Fields to Entity or Model modelizer.addToEntityOrModel Parses selection and injects into Domain Entity or Model
Add Selected Fields to Class modelizer.addFieldsFromSelection Adds comma-separated fields to any targeted class
Add Field modelizer.addField Add a single field to an existing Dart class via prompts
Edit Field modelizer.editField Update type, nullability, or default value of an existing field
Rename Field modelizer.renameField Rename a field and update constructor, copyWith, & JSON mappings
Remove Field modelizer.removeField Safely removes a field and all its references from a class
Sync Entity and Model modelizer.syncEntityAndModel Detects drift and synchronizes fields between Entity and Model
Regenerate Members modelizer.regenerateMembers Re-builds constructor, copyWith, and JSON serialization
Accept All Changes modelizer.acceptAll Accepts all proposed changes from the review queue
Reject All Changes modelizer.rejectAll Discards all proposed changes from the review queue

Local Development Setup

Prerequisites:

  • Node.js: v20.x or higher
  • npm: v10.x or higher
  • VS Code: ^1.85.0
# 1. Clone repository
git clone https://github.com/sohamkolhe9829/modelizer.git
cd modelizer

# 2. Switch to development branch
git checkout dev

# 3. Install dependencies
npm ci

# 4. Compile TypeScript in watch mode
npm run watch

# 5. Execute test suite
npm test

# 6. Package extension VSIX locally
npm run package

Press F5 in VS Code to open an Extension Development Host window and test live changes with full debugging capabilities.


Branch Strategy & Contributing

Modelizer follows a strict two-branch version control policy:

  • main: Protected branch containing only production-ready, release-tested code. Releases are published exclusively from main.
  • dev: Active integration branch for development. All feature and bugfix branches merge into dev.

For full details on Conventional Commits, Semantic Versioning, Pull Request guidelines, and release procedures, see VERSION_CONTROL_RULES.md.


Documentation Links

  • Software Requirements Specification (SRS.md)
  • Implementation & Architecture Guide (IMPLEMENTATION.md)
  • Version Control & Release Rules (VERSION_CONTROL_RULES.md)

License

Released under the MIT License.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft