Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 750 Bytes

README.md

File metadata and controls

27 lines (21 loc) · 750 Bytes

Flutter Format pre-commit

pre-commit hook for formatting Flutter files.

Add the following in your .pre-commit-config.yaml:

- repo: https://github.com/JtheSaw/flutter-format-pre-commit
  rev: "master"
  hooks:
    - id: flutter-format
    - id: dart-fix

You can also only include/exclude some files (defaults to only .dart, is a pattern):

- repo: https://github.com/JtheSaw/flutter-format-pre-commit
  rev: "master"
  hooks:
    - id: flutter-format
      files: lib/* # Only format source files
      exclude: lib/src/avatar.dart # Exclude the avatar widget

Dart

Also see Dart Format pre-commit for formatting only Dart code.