I am learning Flutter and I've created a simple Android app. I want to follow the best practices, so I've also created a analysis_options.yaml
:
include: package:pedantic/analysis_options.yaml
linter:
rules:
public_member_api_docs: true
Android Studio correctly updates it's code analysis settings according to the analysis_options.yaml
and reports violations.
The issue is that when I run flutter analyze
it doesn't report any of public_member_api_docs
:
flutter analyze
Running "flutter pub get" in flutter-course... 514ms
Analyzing flutter-course...
info • Unused import: 'package:places/ui/screen/sight_list_screen.dart' • lib/main.dart:2:8 • unused_import
info • Omit type annotations for local variables • lib/ui/screen/visiting_screen.dart:166:5 • omit_local_variable_types
But when I run dart analyze
it reports ton's of warnings:
dart analyze
Analyzing flutter-course... 2.1s
info • Document all public members at lib/constants.dart:5:16 • (public_member_api_docs)
info • Document all public members at lib/constants.dart:6:16 • (public_member_api_docs)
…
info • Unused import: 'package:places/ui/screen/sight_list_screen.dart' • lib/main.dart:2:8 • unused_import
info • Omit type annotations for local variables • lib/ui/screen/visiting_screen.dart:166:5 • omit_local_variable_types
Why doesn't flutter analyze
respect the settings from my analysis_options.yaml
?