Flutter Clean Architecture Generator
A production-quality Visual Studio Code extension that analyzes JSON API responses locally and generates complete Flutter Clean Architecture boilerplate code (Data Models, Repositories, BLoC, Event, and State).
Privacy & Offline Guarantee: API responses are processed locally within VS Code. The extension does not send API responses to external services and does not use AI.
Features
- ⚡ 100% Local & Deterministic JSON Analyzer: Automatically detects Dart data types (
int, double, String, bool, Object, List<T>, nullability, and nested sub-models).
- 🏷️ Parameter Customization Workbench:
- Checkbox inclusion toggles (
☑ / ☐), Select All, and Clear All.
- Parameter search filter.
- Independent customization of Dart Property Names (e.g.
cifNumber) and Display Labels (e.g. CIF Number) while strictly preserving exact JSON Keys (customer_id).
- 🧱 Clean Architecture Code Generation:
- Model:
final nullable properties, fromJson, toJson, and sub-model files.
- Repository: Domain Repository interface & Data Repository implementation with HTTP request logic.
- BLoC Layer:
BLoC, Event, State (supporting Initial, Loading, Loaded, Error), and copyable UI BlocListener snippet.
- 👁️ In-Memory Code Preview & Overwrite Protection: Preview all generated files in memory before writing, with automatic file conflict detection.
Example Workflow
- Open a Flutter workspace in VS Code.
- Press
Cmd+Shift+P (or Ctrl+Shift+P on Windows/Linux) to open the Command Palette.
- Search and execute:
Flutter Clean Architecture: Generate Feature.
- Paste an API JSON response:
{
"customerId": 12345,
"customerName": "John Doe",
"balance": 25000.50,
"address": {
"city": "Pune",
"state": "Maharashtra"
}
}
- Click Analyze Response, customize field names/labels if desired, and configure feature metadata.
- Click Preview to inspect generated Dart files in tabs without writing to disk.
- Click Generate Feature to safely write files into your project.
Generated Feature Architecture
lib/
└── features/
└── customer/
├── data/
│ ├── models/
│ │ ├── customer_model.dart
│ │ └── address_model.dart
│ └── repositories/
│ └── customer_repository_impl.dart
│
├── domain/
│ └── repositories/
│ └── customer_repository.dart
│
└── presentation/
└── bloc/
├── customer_bloc.dart
├── customer_event.dart
└── customer_state.dart
Supported JSON Types
int & double (safely handled with num casts)
String
bool
null / dynamic
Object (nested sub-models)
List<Primitive> (e.g. List<String>, List<int>)
List<Object> (e.g. List<AccountModel>)
Limitations
- State management pattern defaults to
flutter_bloc.
- Requires a JSON object or array of objects as root input (primitives like raw
"John" or 123 are rejected).
License
MIT License
| |