Upgrade
π Description
The upgrade command updates all packages in your Flutter project to their latest compatible versions. It intelligently manages version constraints, resolves conflicts, and ensures your project remains stable while benefiting from the latest improvements.
βοΈ Usage
gexd upgrade [package_name] [options]
gexd upgrade [options]π Basic Examples:
# Upgrade all packages
gexd upgrade
# Upgrade specific package
gexd upgrade http
# Upgrade multiple specific packages
gexd upgrade http dio shared_preferences
# Preview upgrades without applying
gexd upgrade --dry-run
# Major version upgrades
gexd upgrade --major-versions
# Upgrade dev dependencies only
gexd upgrade --dev-dependenciesπ© Flags
--dry-run
Show available upgrades without applying changes
--major-versions
Allow major version upgrades
--dev-dependencies
Upgrade dev dependencies only
--no-dev-dependencies
Skip dev dependencies
--force
Force upgrade without compatibility checks
--precompile
Precompile executables after upgrade
π― Upgrade Process:
π Dependency Analysis - Analyzes current package versions
π Version Discovery - Finds latest compatible versions
β οΈ Conflict Detection - Identifies potential breaking changes
π Upgrade Plan - Shows what will be changed
β User Confirmation - Asks for approval before applying
β¬οΈ Package Update - Downloads and installs new versions
π Examples by Scope:
Full Project Upgrade:
# Upgrade everything safely
gexd upgrade
# Preview all available upgrades
gexd upgrade --dry-run
# Upgrade with major versions (risky)
gexd upgrade --major-versionsTargeted Upgrades:
# Upgrade specific package
gexd upgrade flutter_svg
# Upgrade state management packages
gexd upgrade get riverpod bloc
# Upgrade dev tools only
gexd upgrade --dev-dependenciesSafe Upgrades:
# Minor and patch updates only
gexd upgrade --no-major-versions
# With compatibility verification
gexd upgrade --verify-compatibilityβ
What It Does:
π Version Analysis - Compares current vs available versions
π Compatibility Check - Ensures version compatibility
π pubspec.yaml Update - Updates version constraints
β¬οΈ Package Resolution - Resolves and downloads packages
π§ͺ Build Test - Optionally tests build after upgrade
π Upgrade Report - Shows summary of changes
π‘οΈ Safety Features:
β οΈ Breaking Change Detection: Warns about major version changes
π Dependency Resolution: Solves version conflicts automatically
πΎ Backup Creation: Backs up pubspec.yaml before changes
π§ͺ Build Verification: Tests compilation after upgrade
π Detailed Reporting: Shows exactly what changed
π Upgrade Strategies:
Conservative (Recommended):
# Minor and patch updates only
gexd upgradeModerate:
# Include compatible minor versions
gexd upgrade --minor-versionsAggressive (Risky):
# Allow major version updates
gexd upgrade --major-versionsπ§ Advanced Options:
Selective Upgrades:
# Upgrade specific categories
gexd upgrade --category ui # UI packages
gexd upgrade --category networking # Network packages
gexd upgrade --category testing # Test packagesConstraint Management:
# Update constraints in pubspec.yaml
gexd upgrade --update-constraints
# Lock to exact versions
gexd upgrade --lock-versionsβ οΈ Potential Issues:
Breaking Changes:
π API Changes: New versions might have different APIs
β‘ Performance Impact: New versions might affect performance
π§© Dependency Conflicts: Packages might have conflicting requirements
Recovery:
# Restore from backup
gexd upgrade --restore-backup
# Downgrade specific package
gexd downgrade package_name version
# Reset to working state
git checkout pubspec.yaml pubspec.lock
dart pub getπ
Best Practices:
π§ͺ Test Before Committing: Run tests after upgrade
π¦ Incremental Upgrades: Update few packages at a time
π Read Release Notes: Check changelog for breaking changes
πΎ Version Control: Commit before upgrading
π CI/CD Verification: Ensure pipeline still passes
β οΈ Notes:
π Semantic Versioning: Follows semver for safe upgrades
π Pub.dev Integration: Fetches latest versions from pub.dev
β‘ Performance Impact: Larger projects take longer to analyze
π Network Required: Needs internet to check for updates
Generated automatically by gexd_doc
Last updated