flutter_prime
A library of useful, reusable, methods and extensions for Flutter. Includes prime, a library of useful, reusable, methods and extensions for Dart.
Installation
To use this package, add flutter_prime
as a dependency in your pubspec.yaml file.
dependencies:
flutter_prime: any
Import the library
import 'package:flutter_prime/flutter_prime.dart';
Usage
TODO: add info here
Check dependencies
You can check for missing, under-promoted, over-promoted, and unused dependencies using the dependency_validator
package.
dart run dependency_validator
You can upgrade dependencies with the following commands:
dart pub upgrade
dart pub outdated
dart pub upgrade --major-versions
The steps required will depend on details provided by those commands.
Linting
If using VS Code, it should keep your Dart files nicely formatted automatically. If you're not using VS Code, you can ensure the code formatted correctly using the command:
dart format . -l 240
We also use yamllint
to keep our .yaml
files neat and correct. Run the following command to view any issues with our .yaml
files:
yamllint .
Our rules configuration is in the .yamllint.yaml
file. If you run yamllint
from a folder that doesn't have the configuration in it (or a link to it), you can specify to use our config file by executing yamllint -c ../path/to/.yamllint.yaml
.
Analysis
VS Code will display hints inline when the dart analyzer detects an issue with the code. You can manually run the analyzer to view all of the issues at once with the command:
dart analyze .
You can then fix the issues manually, or in most cases, use a built-in quick fix to correct the issue. Use the following command to see the issues that can be fixed automatically:
dart fix --dry-run .
And then run this command to apply those fixes if they look ok to you:
dart fix --apply .
Notes
Please send me suggestions/bug fixes.