Skip to content

Commit 904e90d

Browse files
chore(example): add flutter_lints for dart analysis
This resolves the issue on jetbrains IDEs where the dart analyzer doesn't start up nor the linting, intentions and auto-complete features.
1 parent 3aab019 commit 904e90d

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

example/analysis_options.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at https://dart.dev/lints.
17+
#
18+
# Instead of disabling a lint rule for the entire project in the
19+
# section below, it can also be suppressed for a single line of code
20+
# or a specific dart file by using the `// ignore: name_of_lint` and
21+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
22+
# producing the lint.
23+
rules:
24+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
25+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26+
27+
# Additional information about this file can be found at
28+
# https://dart.dev/guides/language/analysis-options

example/pubspec.lock

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ packages:
7575
description: flutter
7676
source: sdk
7777
version: "0.0.0"
78+
flutter_lints:
79+
dependency: "direct dev"
80+
description:
81+
name: flutter_lints
82+
sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493
83+
url: "https://pub.dev"
84+
source: hosted
85+
version: "1.0.4"
7886
flutter_test:
7987
dependency: "direct dev"
8088
description: flutter
@@ -92,6 +100,14 @@ packages:
92100
relative: true
93101
source: path
94102
version: "12.5.0"
103+
lints:
104+
dependency: transitive
105+
description:
106+
name: lints
107+
sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c
108+
url: "https://pub.dev"
109+
source: hosted
110+
version: "1.0.1"
95111
matcher:
96112
dependency: transitive
97113
description:

example/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dev_dependencies:
3232
sdk: flutter
3333
flutter_test:
3434
sdk: flutter
35+
flutter_lints: 1.0.4
3536

3637
# For information on the generic Dart part of this file, see the
3738
# following page: https://dart.dev/tools/pub/pubspec

0 commit comments

Comments
 (0)