flutter_clear 0.1.0
flutter_clear: ^0.1.0 copied to clipboard
A powerful command-line tool designed to automatically scan directories for Flutter projects and execute `flutter clean` on each one, helping developers reclaim valuable disk space and maintain clean [...]
๐งน Flutter Clear (flutter_clear) #
A powerful command-line tool designed to automatically scan directories for Flutter projects and execute flutter clean
on each one, helping developers reclaim valuable disk space and maintain clean development environments.
๐ The Problem #
As a Flutter developer, you've likely experienced this frustrating scenario:
- Low device storage warnings constantly interrupting your workflow
- Multiple Flutter projects consuming gigabytes of disk space
- Build directories growing to hundreds of megabytes or even several gigabytes per project
- The tedious process of manually running
flutter clean
on each project individually
Flutter's build process generates significant intermediate files, compiled code, and platform-specific assets in directories like build/
, .dart_tool/
, and iOS/Android build folders. While these files are essential during development, they accumulate over time and can consume 20GB or more of storage across multiple projects.
In my case it consumed more than 64gb of space
๐ก The Solution #
flutter_clear automates the cleanup process by:
โ
Automatically scanning directories to identify Flutter projects (by detecting pubspec.yaml
files)
โ
Running flutter clean
on each discovered project simultaneously
โ
Shows totol projects found in the directory provided
โ
Showing the cleaning progress during the cleanup operation
โ
Supporting recursive directory scanning for nested project structures
๐ฆ Installation #
Global Installation (Recommended)
Install Flutter Clear globally for system-wide access:
# Install from pub.dev
dart pub global activate flutter_clear
# Install from GitHub (latest development version)
dart pub global activate -s git https://github.com/thisisprabhat/flutter_clear.git
Local Installation
For development or local usage:
# Clone the repository
git clone https://github.com/thisisprabhat/flutter_clear.git
cd flutter_clear
# Install dependencies
dart pub get
# Activate locally
dart pub global activate --source path .
๐ ๏ธ Usage #
Basic Usage
# Clean Flutter projects in current directory and all subdirectories just by running the following command
flutter_clear
๐ Safety Note: Only regeneratable files are removed. Your source code, assets, configuration files, and any custom modifications remain completely untouched.
๐ Comparison with Alternatives #
Feature | Flutter Clear | Manual Process | IDE Tools |
---|---|---|---|
Batch Processing | โ All projects at once | โ One by one | โ ๏ธ Limited |
Space Reporting | โ Detailed analysis | โ Manual calculation | โ Not available |
Safety Checks | โ Dry run & confirmation | โ ๏ธ Manual verification | โ ๏ธ Variable |
Cross-Platform | โ All platforms | โ ๏ธ OS-dependent commands | โ ๏ธ IDE-specific |
Automation Ready | โ CI/CD compatible | โ Requires scripting | โ Manual only |
Speed | โก Parallel processing | ๐ Sequential | โก Fast (single project) |