Home

Awesome

MELPA

flutter.el

Emacs tools for working with the Flutter SDK

Features

Run your app

Flutter.el helps you run the flutter binary interactively as an inferior process. It's designed to work together with dart-mode: for instance the example configuration below binds flutter-run-or-hot-reload to <kbd>C-M-x</kbd> in dart-mode. While editing your Dart code, just hit <kbd>C-M-x</kbd> to either run your app, or if it's already running, to hot-reload it.

Localize your app

Any non-trivial app will require localization, but if you're like me you probably write your code first and worry about externalizing your strings (moving their definitions to a separate file) later.

Flutter.el comes with some helpful features to make externalizing strings easier, assuming you are following best practices:

Run tests

Flutter.el helps you run tests of your flutter application. There are 3 commands available:

Easily activate keybindings for these with the flutter-test-mode minor mode.

Installation

You can install from MELPA with package.el.

First get started with MELPA, then run:

M-x package-install flutter

Configuration

Set flutter-sdk-path to the location of your Flutter SDK. This isn't even necessary if the flutter binary is on your PATH.

The localization tools will read your /l10n.yaml file by default, but alternatively you can set the following variables:

Example

Using use-package and assuming you put the Flutter SDK in /Applications/flutter:

;; Assuming usage with dart-mode
(use-package dart-mode
  ;; Optional
  :hook (dart-mode . flutter-test-mode))

(use-package flutter
  :after dart-mode
  :bind (:map dart-mode-map
              ("C-M-x" . #'flutter-run-or-hot-reload))
  :custom
  (flutter-sdk-path "/Applications/flutter/"))

License

GPL-3