summaryrefslogtreecommitdiff
path: root/oh-my-zsh/plugins/flutter
diff options
context:
space:
mode:
Diffstat (limited to 'oh-my-zsh/plugins/flutter')
-rw-r--r--oh-my-zsh/plugins/flutter/README.md28
-rw-r--r--oh-my-zsh/plugins/flutter/flutter.plugin.zsh29
2 files changed, 57 insertions, 0 deletions
diff --git a/oh-my-zsh/plugins/flutter/README.md b/oh-my-zsh/plugins/flutter/README.md
new file mode 100644
index 0000000..e5a4fd2
--- /dev/null
+++ b/oh-my-zsh/plugins/flutter/README.md
@@ -0,0 +1,28 @@
+## Flutter plugin
+
+The Flutter plugin provides completion and useful aliases
+
+To use it, add `flutter` to the plugins array of your zshrc file:
+
+```zsh
+plugins=(... flutter)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+| :--------- | :---------------------- | :------------------------------------------------------------------------- |
+| `fl` | `flutter` | Shorthand for flutter command |
+| `flattach` | `flutter attach` | Attaches flutter to a running flutter application with enabled observatory |
+| `flb` | `flutter build` | Build flutter application |
+| `flchnl` | `flutter channel` | Switches flutter channel (requires input of desired channel) |
+| `flc` | `flutter clean` | Cleans flutter project |
+| `fldvcs` | `flutter devices` | List connected devices (if any) |
+| `fldoc` | `flutter doctor` | Runs flutter doctor |
+| `flpub` | `flutter pub` | Shorthand for flutter pub command |
+| `flget` | `flutter pub get` | Installs dependencies |
+| `flr` | `flutter run` | Runs flutter app |
+| `flrd` | `flutter run --debug` | Runs flutter app in debug mode (default mode) |
+| `flrp` | `flutter run --profile` | Runs flutter app in profile mode |
+| `flrr` | `flutter run --release` | Runs flutter app in release mode |
+| `flupgrd` | `flutter upgrade` | Upgrades flutter version depending on the current channel |
diff --git a/oh-my-zsh/plugins/flutter/flutter.plugin.zsh b/oh-my-zsh/plugins/flutter/flutter.plugin.zsh
new file mode 100644
index 0000000..44d196c
--- /dev/null
+++ b/oh-my-zsh/plugins/flutter/flutter.plugin.zsh
@@ -0,0 +1,29 @@
+alias fl="flutter"
+alias flattach="flutter attach"
+alias flb="flutter build"
+alias flchnl="flutter channel"
+alias flc="flutter clean"
+alias fldvcs="flutter devices"
+alias fldoc="flutter doctor"
+alias flpub="flutter pub"
+alias flget="flutter pub get"
+alias flr="flutter run"
+alias flrd="flutter run --debug"
+alias flrp="flutter run --profile"
+alias flrr="flutter run --release"
+alias flupgrd="flutter upgrade"
+
+# COMPLETION FUNCTION
+if (( ! $+commands[flutter] )); then
+ return
+fi
+
+# If the completion file doesn't exist yet, we need to autoload it and
+# bind it to `flutter`. Otherwise, compinit will have already done that.
+if [[ ! -f "$ZSH_CACHE_DIR/completions/_flutter" ]]; then
+ typeset -g -A _comps
+ autoload -Uz _flutter
+ _comps[flutter]=_flutter
+fi
+
+flutter zsh-completion >| "$ZSH_CACHE_DIR/completions/_flutter" &| \ No newline at end of file