Documentation for Flutter-related aliases and functions located in alias/flutter.ps1 and scripts/flutter-run.ps1.
This repository provides two Flutter helpers:
| Command | Kind | File |
|---|---|---|
flutter-run |
Alias | alias/flutter.ps1 |
flutter-refresh |
Function | scripts/flutter-run.ps1 |
Defines a PowerShell alias that maps flutter-run directly to the locally installed Flutter CLI executable.
When to use it:
- When you want a consistent
fluttercommand from PowerShell without relying on a global PATH entry. - When your Flutter SDK is installed at a custom location (e.g.,
C:\dev\flutter).
Configuration:
The alias is defined in alias/flutter.ps1:
Set-Alias flutter-run C:\dev\flutter\bin\flutter.batIf your Flutter SDK resides elsewhere, update the path in that file.
Usage:
. ./alias/flutter.ps1
flutter-run <flutter-arguments>Examples:
# Launch the app
flutter-run run
# Analyze the project
flutter-run analyze
# Run tests
flutter-run testPerforms a full Flutter project refresh: cleans the build cache, restores dependencies, and runs the application with verbose logging.
When to use it:
- When your Flutter project has stale build artifacts or dependency issues.
- When you want a single command to clean, restore, and relaunch your app.
- When you need verbose output to diagnose build or runtime problems.
Source (scripts/flutter-run.ps1):
function flutter-refresh {
# Clean project
flutter clean
# Restore dependencies
flutter pub get
# Run app with verbose logs
flutter-run run --verbose
}What it does:
flutter clean— Removes thebuild/directory and other generated artifacts.flutter pub get— Downloads and caches the project's Dart dependencies.flutter-run run --verbose— Builds and launches the app with detailed logging to help diagnose issues.
Usage:
. ./scripts/flutter-run.ps1
flutter-refreshNote: Because
flutter-refreshinternally uses theflutter-runalias, make sure the alias fromalias/flutter.ps1is loaded in your session or thatflutteris available on your PATH.
Example workflow:
# Source both the alias and the function
. ./alias/flutter.ps1
. ./scripts/flutter-run.ps1
# Refresh the project
flutter-refreshThe repository also includes scripts/manual.ps1, which automatically discovers and documents both the flutter-run alias and the flutter-refresh function:
. ./scripts/manual.ps1
help
man flutter-run
man flutter-refresh. ./alias/flutter.ps1
. ./scripts/flutter-run.ps1
flutter-refreshAdd the following lines to your PowerShell profile (notepad $PROFILE):
. "C:\Users\Manuel Morales\Repos\PowerShell\alias\flutter.ps1"
. "C:\Users\Manuel Morales\Repos\PowerShell\scripts\flutter-run.ps1"Save and restart PowerShell.