flutter_feature_generator 2.0.2
flutter_feature_generator: ^2.0.2 copied to clipboard
A powerful code generator with web interface for creating clean architecture features in Flutter projects from OpenAPI/Swagger specifications.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.0.2 #
๐งน Code Quality Improvements #
- Removed dead code in feature_generator.dart that was unreachable after return statement
- Cleaned up unused imports (shelf_static in web_server.dart, direct web_server import in main)
- Removed unused shelf_static dependency from pubspec.yaml
2.0.0 #
๐ Major Features Added #
- Interactive Web Interface: Beautiful, modern web UI for API selection and feature generation
- Granular Layer Control: Choose specific layers to generate (Data, Domain, Presentation)
- Presentation Component Selection: Fine-grained control over BLoC, Screens, and Widgets
- Smart Appending: Automatically appends to existing classes instead of overwriting
- Auto-Generated Core Files: Automatically creates
core/error/error.dartif missing - Real-time Search: Filter APIs by path, method, tag, or description
- Multi-Selection Interface: Visual selection of multiple endpoints with feedback
๐ Web Interface Features #
- Responsive design that works on desktop and mobile
- Real-time API endpoint loading from swagger.json
- Interactive checkboxes for layer and component selection
- Search and filter functionality for large API specifications
- Visual feedback with progress indicators and status messages
- Automatic feature name validation with helpful error messages
๐๏ธ Architecture Improvements #
- Consolidated Classes: New endpoints are added as methods to existing classes instead of creating separate classes
- Smart Use Cases: Adds methods to main
UseCasesclass instead of creating individual use case classes - Freezed Integration: Properly adds factory methods to freezed Event classes and fields to State classes
- BLoC Enhancement: Adds new event handlers to existing BLoC classes
- Repository Updates: Appends methods to existing repository interfaces and implementations
- Source Layer Updates: Appends methods to existing source interfaces and implementations
๐๏ธ Granular Control #
- Data Layer: Models, Services, Repository (can be selected independently)
- Domain Layer: Use Cases, Repository Interface (can be selected independently)
- Presentation Layer: Now has sub-components:
- BLoC (Events, States, Business Logic)
- Screens (UI Screens)
- Widgets (Custom Widgets folder)
๐ Smart Appending Logic #
- Detects existing features automatically
- Only adds new endpoints that don't already exist
- Preserves existing code structure and formatting
- Adds required imports automatically
- Maintains consistent code patterns
๐ Enhanced User Experience #
- Layer selection with visual hierarchy
- Presentation sub-component controls
- Real-time validation feedback
- Detailed success messages showing what was generated/updated
- Clear error messages with helpful guidance
๐ฆ Technical Improvements #
- Added
shelf,shelf_router, andshelf_staticdependencies for web server - Auto-generation of core Error class with freezed unions for functional error handling
- Improved error handling and user feedback
- Better code organization with separation of concerns
- Enhanced CLI backward compatibility
- Comprehensive documentation of required dependencies
๐ Bug Fixes #
- Fixed Windows PowerShell input issues by providing web interface alternative
- Improved file path handling across different operating systems
- Better error messages for invalid feature names and selections
- Fixed duplicate endpoint detection logic
๐ Breaking Changes #
- Default behavior now starts web interface instead of CLI (use specific arguments for CLI mode)
- Minimum Dart SDK version remains 3.0.0
- Generated code structure remains the same, but appending logic is significantly improved
1.0.7 #
1.0.0 #
Added #
- Initial release of Flutter Feature Generator
- Interactive API endpoint selection from Swagger/OpenAPI specs
- Clean architecture feature generation
- Name validation to prevent conflicts with reserved names
- Support for append mode to add APIs to existing features
- Command line interface with configurable options
- Automatic project root detection when running from tool directory
Features #
- Generate complete feature structure following clean architecture
- Parse OpenAPI/Swagger specifications
- Create data, domain, and presentation layers
- Generate models, services, repositories, use cases, and BLoCs
- Prevent naming conflicts with restricted folder names
- Cross-platform support (Windows, macOS, Linux)
Technical #
- Built with Dart 3.0+
- Uses path package for cross-platform file operations
- Args package for command line argument parsing
- Proper error handling and user feedback