code_formatter_package 1.0.0
code_formatter_package: ^1.0.0 copied to clipboard
A Flutter package for formatting and splitting Dart code into widgets.
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.
1.0.0 - 2025-01-26 #
Added #
- FormatterResult class: Methods now return a
FormatterResultobject with detailed success/failure information - FormatterConfig class: Flexible configuration options for customizing the formatting behavior
- ExtractedWidget class: Detailed information about each extracted widget
- CodeFormatterException: Custom exception class with error types
- CodeFormatterErrorType enum: Specific error types for better error handling
- State class bundling: Automatically bundles State classes with their StatefulWidget
- Import extraction: Preserves and includes original imports in generated files
- Smart file naming: Uses widget class names converted to snake_case for file names
- Preview feature:
previewWidgets()method to preview extraction without saving - Async support:
formatFileAsync()for non-blocking file operations - Callback support:
onCompletecallback ininitializeFormatter() - Overwrite control: Option to skip existing files with
overwriteExistingconfig - Header comments: Optional header comments in generated files
- Comprehensive documentation: Full API documentation with examples
Changed #
- API redesign: Methods now return
FormatterResultinstead of void - Configuration: Replaced individual parameters with
FormatterConfigclass - Error handling: Proper error types instead of print statements
- File naming: Default to widget class name instead of
widget_1.dart
Deprecated #
formatCodeLegacy()- UseformatCode()withFormatterConfiginsteadformatFileLegacy()- UseformatFile()withFormatterConfiginstead
0.0.6 - 2024-12-10 #
Added #
- Automatic code formatting functionality
- Custom widget naming support
- Example file demonstrating package usage
Changed #
- Improved file output handling with organized structure
- Updated Flutter version compatibility (>=3.0.0)
- Updated Dart SDK version (>=3.4.4 <4.0.0)
Fixed #
- Resolved issues with relative paths for Dart files
- Stability improvements for large file formatting