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
🏗️ 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
⚙️ 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
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
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: Generate Presentation
- Create new Flutter presentation module
Jatis: Generate Dependencies
- Create dependency classes
Jatis: Generate Service
- Create standalone service classes
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.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! 🚀