Jatis Flutter Generator
A comprehensive VS Code extension for generating Flutter presentations, dependencies, and services following Jatis standardization. Built with consistent architecture patterns, complete unit testing, and flexible configuration options to ensure team-wide development consistency.
Features
🚀 Flutter Project Creation
- Complete Flutter project setup with automatic platform configuration
- Platform detection and enabling - automatically enables disabled platforms (web, windows, linux, macos)
- Multi-platform support with customizable platform selection
- Automatic project opening after successful creation
- Flutter installation validation before project creation
- Streamlined workflow with just project name and platform inputs
🏗️ Presentation Generation
- Generate complete Flutter presentations with consistent architecture patterns
- Creates organized folder structure:
constants , controller , service , model , view
- Additional controller functions with custom input prompt (e.g., getUserData, updateProfile)
- Automatic test generation for all components including additional functions
- Generates clean, maintainable code following best practices
🔧 Dependency Management
- Generate dependency classes with reusable components
- Additional dependency functions with custom input prompt (e.g., initialize, configure, cleanup)
- Automatic dependency test generation for reliable code including additional functions
- Organized code structure with clear separation
📋 Model Generation from JSON
- Generate Dart models from JSON with automatic type detection and conversion
- Nested model support - automatically creates separate model files for nested objects
- Plural-to-singular conversion - converts array names like
users → User model
- Smart type mapping - generates proper Dart types (
List<User> , String , int , etc.)
- Directory selection - choose target directory within lib/ folder with history tracking
- JSON validation - real-time validation with preview before generation
- Comprehensive model methods - fromJson, toJson, toString, and proper constructors
⚙️ Service Generation
- Generate standalone service classes with interface-implementation pattern
- Additional service functions with custom input prompt (e.g., authenticate, refreshToken, logout)
- Configurable service paths for organized code structure
- Automatic service test generation with comprehensive test setup including additional functions
- Clean separation between business logic and presentation layer
- Automated test file generation for all presentations, dependencies, and services
- Testing framework setup with automatic mock generation
- Build runner support with easy directory selection
- Test coverage reports to ensure code quality
- GetX state management package installation and configuration
- History tracking for recently used directories and files
⚙️ Configuration Management
- Flexible path configuration to organize your project structure
- Easy setup with user-friendly configuration options
- Clean import paths in generated code
- Package version management for testing and build tools
- Project-level settings with simple setup interface
Installation
- Install from VS Code Marketplace: Jatis Flutter Generator
- Or install manually:
code --install-extension hakanon.jatis-flutter-generator
Usage
Create Flutter Project
- Right-click on any folder in Explorer or use Command Palette
- Select "Create Flutter Project" from context menu
- Enter project name (follows Flutter naming conventions)
- Select target platforms (default: android,ios)
- Supports: android, ios, web, windows, macos, linux
- Extension automatically enables disabled platforms
- Project is created and automatically opened in VS Code
Example Project Creation:
Input: my_flutter_app
Platforms: web,windows,linux
Result:
✓ Enables Flutter platforms (if disabled): web, windows, linux
✓ Creates project with platform directories:
- android/
- ios/
- web/
- windows/
- linux/
✓ Automatically opens the new project
Generate Presentation
- Right-click on any folder in Explorer
- Select "Generate Presentation" from context menu
- Enter presentation name (e.g.,
user_profile , payment )
- Presentation and tests are automatically created
Generated Structure:
lib/presentation/user_profile/ # Configurable: lib/{moduleSubpath}/
├── constants/user_profile_constant.dart
├── controller/
│ ├── user_profile_controller.dart
│ └── user_profile_binding.dart
├── model/user_profile_viewmodel.dart
├── service/user_profile_service.dart
└── view/user_profile_page.dart
test/presentation/user_profile/ # Configurable: test/{testSubpath}/
├── constants/user_profile_constant_test.dart
├── controller/
│ ├── user_profile_controller_test.dart
│ └── user_profile_binding_test.dart
├── model/user_profile_viewmodel_test.dart
└── service/user_profile_service_test.dart
Generate Dependencies
- Right-click on any folder in Explorer
- Select "Generate Dependencies" from context menu
- Enter dependency name (e.g.,
database , api_client )
- Dependency class and tests are automatically created
Generated Structure:
lib/base/dependencies/database/ # Configurable: lib/{dependenciesSubpath}/
└── database.dart
test/dependencies/database/ # Configurable: test/{dependenciesTestSubpath}/
└── database_test.dart
Generate Service
- Right-click on any folder in Explorer
- Select "Generate Service" from context menu
- Enter service name (e.g.,
auth , payment , notification )
- Service class and tests are automatically created
Generated Structure:
lib/services/auth/ # Configurable: lib/{serviceSubpath}/
└── auth_service.dart
test/services/auth/ # Configurable: test/{serviceTestSubpath}/
└── auth_service_test.dart
Create Model from JSON
- Right-click on any folder in Explorer or use Command Palette
- Select "Create Model from JSON" from context menu
- Choose target directory within lib/ folder (with search and history)
- Enter model name (e.g.,
User , ApiResponse , ProductData )
- Input JSON data - extension validates and shows preview
- Models are automatically generated with nested support
Example JSON Input:
{
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"hair": {
"color": "brown",
"length": "short"
},
"users": [
{
"name": "Alice",
"age": 25
}
]
}
Generated Structure:
lib/models/ # Your selected directory
├── api_response.dart # Main model
├── hair.dart # Nested object model
└── user.dart # Array element model (users → User)
Generated Model Features:
- Proper Dart types (
int , String , List<User> , etc.)
- Required/optional parameters based on nullable analysis
fromJson() and toJson() methods with proper type conversion
toString() method for debugging
- Null-safe constructor with proper parameter handling
Build Runner Operations
- Install Build Runner: Automatically installs build_runner package
- Run Build Runner: Execute for entire project or specific directories
- Directory Selection: Choose specific folders to build with history tracking
Package Management
- Install Packages: Choose from Mockito, Build Runner, or GetX packages with automatic installation
- Run Test Coverage: Execute tests with coverage reports
- Directory-specific Testing: Run tests for specific modules or the entire project
Commands
Access via Command Palette (Ctrl+Shift+P / Cmd+Shift+P ):
Jatis: Create Flutter Project - Create new Flutter project with platform configuration
Jatis: Generate Presentation - Create new Flutter presentation module
Jatis: Generate Dependencies - Create dependency classes
Jatis: Generate Service - Create standalone service classes
Jatis: Create Model from JSON - Generate Dart models from JSON input with nested support
Jatis: Install Packages - Install Mockito, Build Runner, or GetX packages
Jatis: Run Build Runner - Execute build runner with options
Jatis: Run Unit Test with Coverage - Execute test coverage
Jatis: Configuration - Open settings panel
Configuration
Configure the extension via VS Code Settings or the built-in Configuration UI:
Path Configuration
The extension uses a flexible path system with absolute roots and configurable subpaths:
Setting |
Default Value |
Description |
jatis.baseModuleSubpath |
presentation |
Subpath under lib/ for presentation generation |
jatis.baseTestSubpath |
presentation |
Subpath under test/ for presentation tests |
jatis.baseDependenciesSubpath |
base/dependencies |
Subpath under lib/ for dependencies |
jatis.baseDependenciesTestSubpath |
dependencies |
Subpath under test/ for dependency tests |
jatis.baseServiceSubpath |
services |
Subpath under lib/ for service generation |
jatis.baseServiceTestSubpath |
services |
Subpath under test/ for service tests |
jatis.mockitoVersion |
^5.4.6 |
Mockito package version |
jatis.buildRunnerVersion |
^2.5.4 |
Build runner package version |
jatis.getVersion |
^4.7.2 |
Get (GetX) package version |
Path Structure
- Absolute roots (never change):
lib/ and test/
- Configurable subpaths: Set via configuration UI
- Clean imports: Generated code uses
package:myapp/presentation/... (no lib/ prefix)
- User-friendly: Configure
presentation instead of /lib/presentation
Example Configuration:
- Module Subpath:
features/auth → Creates modules in lib/features/auth/
- Test Subpath:
features/auth → Creates tests in test/features/auth/
- Import paths:
package:myapp/features/auth/controller/...
Code Architecture
Controller Pattern
Generated controllers use modern Dart patterns:
class UserProfileController extends GetxController implements UserProfileControllerInterface {
late final UserProfileServiceInterface _service;
late final UserProfileViewModel _viewmodel = UserProfileViewModel();
UserProfileController(this._service);
@override
UserProfileViewModel get viewModel => _viewmodel;
}
Dependency Injection
Clean dependency injection with GetX:
class UserProfileBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut<UserProfileServiceInterface>(() => UserProfileService());
Get.lazyPut<UserProfileControllerInterface>(() => UserProfileController(
Get.find<UserProfileServiceInterface>(),
));
}
}
Test Generation
Automatically generates comprehensive tests with mockito:
@GenerateMocks([UserProfileServiceInterface])
void main() {
late UserProfileController controller;
late MockUserProfileServiceInterface mockService;
setUp(() {
mockService = MockUserProfileServiceInterface();
controller = UserProfileController(mockService);
});
group('UserProfileController', () {
test('should initialize with correct viewModel', () {
expect(controller.viewModel, isA<UserProfileViewModel>());
});
});
}
Requirements
- Flutter SDK 3.0.0 or higher
- Dart SDK 2.17.0 or higher
- VS Code 1.102.0 or higher
Release Notes
Version 1.1.7
- 📋 Model Generation from JSON: New comprehensive JSON-to-Dart model generation feature
- New "Create Model from JSON" command available in context menu and Command Palette
- Smart JSON validation with real-time error checking and formatted preview
- Nested model support - automatically detects and creates separate model files for nested objects
- Plural-to-singular conversion - intelligently converts array names (e.g.,
users → User model)
- Advanced type mapping - generates proper Dart types (
List<User> , String , int , double , bool )
- Directory selection within lib/ - focused directory picker showing only lib/ subdirectories with search and history
- Template architecture refactor - moved model generation to dedicated template system for better maintainability
- Comprehensive model methods - generates
fromJson() , toJson() , toString() , and null-safe constructors
- Nested object imports - automatically manages imports between related model files
Version 1.1.6
- 🚀 New Flutter Project Creation Command: Complete Flutter project setup with automatic platform configuration
- New "Create Flutter Project" command available in context menu and Command Palette
- Automatic platform detection and enabling - detects disabled platforms (web, windows, linux, macos) and enables them automatically
- Multi-platform support with customizable platform selection and intelligent defaults
- Flutter installation validation ensures Flutter is available before project creation
- Streamlined workflow with just project name and platform inputs
- Automatic project opening after successful creation for immediate development
- Platform directory creation ensures all selected platforms have their respective directories (web/, windows/, linux/, macos/)
- User-friendly notifications for platform enabling and creation status
Version 1.1.5
- 🐛 Fixed Input Cancellation: Fixed issue where pressing ESC during additional functions input would still generate files
- ESC/Cancel during additional functions prompt now properly cancels the entire generation process
- Applies to all three generator types: presentations, services, and dependencies
- Empty input (pressing Enter) still continues with no additional functions as expected
- Improves user experience by respecting cancellation intent
Version 1.1.4
- 🔧 Enhanced Presentation Generation: Added support for additional controller functions
- New input prompt for custom functions after entering presentation name
- Functions are automatically added to both controller interface and implementation
- Comprehensive unit tests generated for all additional functions
- Camel case validation ensures Flutter naming standards
- Empty input is allowed for presentations without additional functions
- ⚙️ Enhanced Service Generation: Added support for additional service functions
- New input prompt for custom functions after entering service name (e.g., authenticate, refreshToken, logout)
- Functions are automatically added to both service interface and implementation
- Comprehensive unit tests generated for all additional functions with TODO comments
- Consistent pattern with presentation controller function generation
- 🔗 Enhanced Dependency Generation: Added support for additional dependency functions
- New input prompt for custom functions after entering dependency name (e.g., initialize, configure, cleanup)
- Functions are automatically added to both dependency interface and implementation
- Comprehensive unit tests generated for all additional functions with TODO comments
- Unified additional functions pattern across all three generator types
Version 1.1.3
- 🎨 Icon Update: Changed extension icon image
Version 1.1.2
- 🚀 Generate Service Command: Added new service generation functionality
- New "Generate Service" command for creating standalone service classes
- Service classes follow interface-implementation pattern (e.g.,
AuthServiceInterface + AuthService )
- Configurable service paths (
jatis.baseServiceSubpath and jatis.baseServiceTestSubpath )
- Automatic service test generation with comprehensive test setup
- Services are organized separately from presentation modules for better architecture
- 📋 History Tracking Enhancement: Improved selection history functionality
- Fixed history sorting to properly show most recently selected items first
- History items now update timestamp when selected from history list
- Better tracking across build runner directory selection and unit test file selection
- 🏗️ Template Architecture Refactor: Separated templates for better maintainability
- Split templates into dedicated files:
PresentationTemplates , PresentationTestTemplates , DependencyTestTemplates , ServiceTestTemplates
- Improved code organization with focused template responsibilities
- Better type safety and easier maintenance of template generation
- ⚙️ Enhanced Configuration UI: Added service path configuration options
- Service Subpath and Service Test Subpath settings in Configuration UI
- Edit and reset functionality for service path settings
- Consistent configuration pattern across all generator types
Version 1.1.1
- 📦 GetX Package Support: Added GetX (Get) package to installation options
- New "Get" option in Install Packages command
- Configurable GetX version (default: ^4.7.2) in extension settings
- GetX version management through Configuration UI
- 🔧 Streamlined Package Installation: Removed individual "Install Mockito Package" and "Install Build Runner Package" commands from context menu and Command Palette, consolidated into unified "Install Packages" menu
- ⚙️ Enhanced Configuration: Added GetX version configuration to settings panel
- 🏗️ Improved Controller Template: Updated controller constructor to use cleaner positional parameters instead of named parameters
- Changed from
Controller({required ServiceInterface service}) to Controller(this._service)
- Updated corresponding test templates to match new constructor pattern
Version 1.1.0
- 🔄 Codebase Migration: Extension codebase refactored from JavaScript to TypeScript for better maintainability
- ⚙️ Flexible Path Configuration: New configurable subpath system with centralized constants
- Absolute roots (
lib/ , test/ ) are now centralized constants
- User-configurable subpaths (e.g.,
presentation , features/auth )
- Clean import paths without lib/ prefix in generated code
- Intuitive configuration UI with dynamic prompts
- ✨ Enhanced Features: Improved extension stability and performance
- 🔧 Template Updates: Updated code generation templates with modern Dart patterns
- 🐛 Bug Fixes: Fixed various issues for better user experience
- ⚡ Performance: Optimized extension performance and reliability
Version 1.0.4
- Added selection history feature for improved user experience
Version 1.0.3
- Added "All Unit Tests" option to test coverage command
Version 1.0.2
- Fixed "Command not found" error when using extension from marketplace
Version 1.0.1
- Added command to install build runner and its configuration
Happy Flutter Development! 🚀
| |