All Projects → amake → Flutter.el

amake / Flutter.el

Licence: gpl-3.0
Flutter tools for Emacs

Projects that are alternatives of or similar to Flutter.el

Mermaid Mode
Emacs major mode for working with mermaid graphs https://mermaidjs.github.io/
Stars: ✭ 60 (-16.67%)
Mutual labels:  emacs
Icomplete Vertical
Global Emacs minor mode to display icomplete candidates vertically
Stars: ✭ 66 (-8.33%)
Mutual labels:  emacs
Color Theme Buffer Local
Set emacs color themes by buffer.
Stars: ✭ 69 (-4.17%)
Mutual labels:  emacs
.emacs.d
一个快速且实用的 Emacs 配置
Stars: ✭ 63 (-12.5%)
Mutual labels:  emacs
Org Web
org-mode on the web, built with React, optimized for mobile, synced with Dropbox and Google Drive
Stars: ✭ 1,133 (+1473.61%)
Mutual labels:  emacs
Webpaste.el
webpaste.el can paste whole buffers or parts of buffers to several pastebin-like services and supports failover if one service fails.
Stars: ✭ 67 (-6.94%)
Mutual labels:  emacs
Vscode Org Mode
Emacs Org Mode for Visual Studio Code
Stars: ✭ 1,096 (+1422.22%)
Mutual labels:  emacs
Jq Mode
Emacs major mode for editing jq queries.
Stars: ✭ 70 (-2.78%)
Mutual labels:  emacs
Emacs Which Key
Emacs package that displays available keybindings in popup
Stars: ✭ 1,136 (+1477.78%)
Mutual labels:  emacs
.emacs.d
Personal Emacs Configuration
Stars: ✭ 69 (-4.17%)
Mutual labels:  emacs
Dotfiles
well-tailored NixOS & nix-darwin dotfiles
Stars: ✭ 63 (-12.5%)
Mutual labels:  emacs
Helm Github Stars
Browse your starred repositories with Emacs helm interface
Stars: ✭ 64 (-11.11%)
Mutual labels:  emacs
Witchmacs
My emacs configuration files
Stars: ✭ 68 (-5.56%)
Mutual labels:  emacs
Dotfiles
🏠
Stars: ✭ 60 (-16.67%)
Mutual labels:  emacs
Emacsist
Emacs微信公众号收录文章存档!
Stars: ✭ 70 (-2.78%)
Mutual labels:  emacs
Emacs Themes Site
Source code for https://emacsthemes.com
Stars: ✭ 58 (-19.44%)
Mutual labels:  emacs
Books Pdf
books pdf
Stars: ✭ 1,149 (+1495.83%)
Mutual labels:  emacs
Dotfiles
💻 Dotfiles for zsh, vim, emacs, tmux, and bash. Tested on mac os.
Stars: ✭ 70 (-2.78%)
Mutual labels:  emacs
Elisp
The hive for Göktuğ's Emacs Stuff.
Stars: ✭ 70 (-2.78%)
Mutual labels:  emacs
Org Sticky Header
Show off-screen Org heading at top of window
Stars: ✭ 68 (-5.56%)
Mutual labels:  emacs

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 C-M-x in dart-mode. While editing your Dart code, just hit C-M-x 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:

  • flutter-l10n-externalize-all: A function that interactively does the following for each string literal in the current buffer:

    1. Prompts you to give an ID (class property name) to the string, e.g. myString
    2. Replaces the string literal with a reference to the localizations class, e.g. MyLocalizations.of(context).myString
    3. Deletes any const keywords that apply to the reference
    4. Appends the original string content as an end-of-line comment
    5. Appends a definition for the string to the localizations class, e.g.
    String get myString => Intl.message('Hello, world!', name: 'myString');
    
  • flutter-l10n-externalize-at-point: Does all of the above but for the string literal at point only; kills the definition instead of adding it to the localizations class.

Lint your localization strings

A Flycheck checker calling intl_translation:extract_to_arb from the intl_translation package is available for making sure your strings are defined in the correct way. This is published as a separate, optional package: flutter-l10n-flycheck.

Run tests

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

  • flutter-test-all - run all tests from a flutter project.
  • flutter-test-current-file - run all tests inside the current file.
  • flutter-test-at-point - run single test or group of tests at point.

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

Installation

You can install from MELPA with package.el:

M-x package-install flutter

and, optionally

M-x package-install flutter-l10n-flycheck

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.

To use the localization tools you will want to customize these variables for your project:

  • flutter-l10n-classname: The name of the localizations class where strings are defined
  • flutter-l10n-file: The relative path from project root to the file that defines the localizations class. Should include the leading lib/.

If using flutter-l10n-flycheck be sure to call flutter-l10n-flycheck-setup and set your L10N file (the one specified in flutter-l10n-file) to use the checker: M-x add-file-local-variable-prop-line flycheck-checker intl_translation

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/"))

;; Optional
(use-package flutter-l10n-flycheck
  :after flutter
  :config
  (flutter-l10n-flycheck-setup))

A sample .dir-locals.el to go in your project root:

((dart-mode
  (flutter-l10n-classname . "AppLocalizations")
  (flutter-l10n-file . "lib/app_l10n.dart")))

The propline for your L10N file:

// -*- flycheck-checker: intl_translation; -*-

License

GPL-3

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].