flutter/docs/contributing/Using-the-Dart-analyzer.md
Kate Lovett bf7d67d80e
[wiki migration] Framework team pages (#148721)
This sorts the wiki pages owned by the Framework team in the docs/ directory as planned in [flutter.dev/go/migrate-flutter-wiki-spreadsheet](https://docs.google.com/spreadsheets/d/1x65189ZBdNiLRygpUYoU08pwvXD4M-Z157c6pm8deGI/edit?usp=sharing) 

It also adds the framework related labels to the bot for future PRs.

Changes to the content were only updating cross links. The remaining wiki links will be updated after the rest of the pages are relocated, the original wiki links still work in the meantime.

Part of https://github.com/flutter/flutter/issues/145009
2024-05-20 23:40:35 +00:00

23 lines
1.4 KiB
Markdown

When editing Flutter code, it's important to check the code with the
analyzer.
If your IDE supports doing this automatically (e.g. using Android Studio with the Flutter plugin),
then that is the easiest solution.
Alternatively, you can use the `flutter analyze --flutter-repo` tool on the console. When using the
console, you will want to manually run `flutter update-packages` each time you update your tree, so
that the `pubspec.yaml` files are processed to obtain all the dependencies for every package in the
repository. If you don't do this, you may get bogus error messages about core classes like `Offset`
from `dart:ui`. This is because `flutter analyze` does not automatically attempt to update dependencies,
since doing so can take a long time and is only necessary when the tree has been updated.
For a one-off, use `flutter analyze --flutter-repo`.
For continuous analysis, use `flutter analyze --flutter-repo --watch`.
If you omit the `--flutter-repo` option you may end up in a confusing state because that will
assume you want to check a single package and the flutter repository has several packages.
You can use the `--write` argument with `--watch` to cause each update to write all the results to a file
in ASCII. This can be used e.g. with Emacs' `compile` mode to quickly dump all the latest analysis results
into the compilation buffer so that they are recognized as error messages that Emacs can jump to.