fix_flutter_deprecations 0.1.2
fix_flutter_deprecations: ^0.1.2 copied to clipboard
A powerful and extensible Dart CLI tool that automatically fixes Flutter deprecations in your codebase
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.
Unreleased #
0.1.2 - 2025-08-03 #
Added #
- WillPopScope to PopScope Migration: Automatically converts deprecated
WillPopScopewidgets toPopScopewith intelligent callback transformation- Handles simple boolean returns by converting to
canPopproperty - Transforms complex logic into
onPopInvokedcallbacks with proper navigation handling
- Handles simple boolean returns by converting to
- Multiple Underscores Lint Fix: Automatically fixes "unnecessary use of multiple underscores" warnings
- Intelligently preserves generated code patterns and test mocks
- Converts multiple underscores to single underscores where appropriate
- BuildContext Async Safety: Fixes
use_build_context_synchronouslylint warnings by adding mounted checks- Automatically detects BuildContext usage after async operations
- Adds appropriate mounted checks (
if (mounted)for StatefulWidget,if (context.mounted)for others) - Supports Navigator, showDialog, ScaffoldMessenger, Theme, and MediaQuery operations
- Maintains proper code indentation and formatting
Enhanced #
- Extended rule registry to support 6 total deprecation rules
- Improved pattern matching with more sophisticated regex handling
- Enhanced validation logic for complex code transformations
0.1.1 - 2025-08-02 #
0.1.0 - 2025-08-02 #
Added #
- Initial release of fix_flutter_deprecations CLI tool
- Support for fixing
.withOpacity()to.withValues(alpha:)deprecation - Support for fixing
surfaceVarianttosurfaceContainerHighestdeprecation - Support for fixing
onSurfaceVarianttoonSurfacedeprecation - Dry-run mode to preview changes before applying
- Backup functionality for safe operation
- Selective rule application
- Progress tracking and detailed reporting
- Extensible architecture for adding new deprecation rules
- Comprehensive test coverage (100%)
- Full compatibility with Very Good Analysis standards
Features #
- Process single files or entire directories
- Parallel file processing for performance
- Detailed error reporting and recovery
- Platform support for Windows, macOS, and Linux