Just a helper bash repo for myself to not have to search and type all of these long flutter commands. This is just meant as inspiration and should not be copied 1:1, because there might be changes.
Everything should work fine on Unix and OSX. Maybe it works in Windows as well, but not sure about it. (PRs with instructions are welcome)
Just download the bash script:
wget https://github.com/SimonErich/bash-shortcuts-flutter/blob/main/flu.sh ~/flu.sh
chmod +x ~/flu.sh
or using cURL:
curl -L https://raw.githubusercontent.com/SimonErich/bash-shortcuts-flutter/main/flu.sh -o ~/flu.sh
chmod +x ~/flu.sh
Add it to your profile file. (~/.zshrc
or ~/.bashrc
- depending on your shell):
source ~/flu.sh
Now close your terminal window and open it again. Now you should just be able to call the commands in the document:
Shortcut for the command flutter pub get
Shortcut for the command flutter analyze
Shortcut for the command flutter test
Shortcut for the command flutter format .
(just analyzes, but does not fix)
Shortcut for the command flutter format --fix .
(analyzes and fixes problems)
Shortcut for the command flutter pub run build_runner --delete-conflicting-outputs
Shortcut for the command flutter pub run build_runner watch --delete-conflicting-outputs
The script was created based on the following article: (with more explanation on syntax and workings) https://dev.to/eddeee888/how-to-write-a-bash-shortcut-script-to-enhance-your-terminal-experience-5898
May not apply to your setup.
Shortcut for the command flutter run -t lib/widgetbook.widgetbook.dart -d chrome --web-renderer html --