Setting up the project
To really get started, create a new Flutter project with your favorite integrated development environment (IDE) to get the skeleton of a minimal, working Flutter app. Next, open the pubspec.yaml
file and make sure to have these two dev dependencies installed:
dev_dependencies: # https://pub.dev/packages/dart_code_metrics dart_code_metrics: ^4.9.1 # https://pub.dev/packages/flutter_lints flutter_lints: ^1.0.4
We’re now going to dedicate some time to work on the analysis_options.yaml
file. Very simply, this file contains a series of static analysis rules to help you with writing readable, high-quality code. By default, a new Flutter project already creates this file for you with a minimal setup (we have removed comments for simplicity), as illustrated in the following code snippet:
include: package:flutter_lints/flutter.yaml linter: rules: avoid_print: false ...