Files
client-sdk-flutter/example/analysis_options.yaml
T
Hiroshi HorieandGitHub ab31ddabb9 Apply Flutter best practices [Non-Breaking] (#2)
* Add flutter_lints package

* Use key in widget constructors

lint: use_key_in_widget_constructors

* Unnecessary new keyword

lint: unnecessary_new

* Prefer const with constant constructors

* Exclude protobuf files from analyzer

* Private field could be final

* Annotate overridden members

* Use initializing formals when possible

* Don't access members with `this` unless avoiding shadowing

* Prefer is! operator

* Use isEmpty instead of length

* Use collection literals when possible

* Revert comment changes

* Cleaner null testing

* Misc fixes

* Avoid using `forEach` with a function literal

* Prefer `final` over `var` where applicable

* Enforce stricter type-checking

* Ignore VS Code files

* Flutter format

* Prefer using lowerCamelCase for constant names

* flutter format -l 100

* Disable `avoid_print` for examples

* Slight improvements to example

Should solve lint error: no_logic_in_create_state
2021-08-31 16:35:07 +09:00

45 lines
1.2 KiB
YAML

# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
# https://pub.dev/packages/flutter_lints
include: package:flutter_lints/flutter.yaml
analyzer:
#
# Enforce stricter type-checking
# https://dart.dev/guides/language/analysis-options#enabling-additional-type-checks
# https://dash-overflow.net/articles/getting_started/#step-3-disabling-_implicit-dynamic_--_implicit-cast_
#
strong-mode:
implicit-casts: false
implicit-dynamic: false
#
# exclude protobuf files
#
exclude:
- '**/*.pb.dart'
- '**/*.pbenum.dart'
- '**/*.pbjson.dart'
- '**/*.pbserver.dart'
linter:
rules:
#
# Additional recommended rules
#
prefer_single_quotes: true
#
# Turn off avoid_print for example projects
#
avoid_print: false