Prerequisites
Before installing Flutter CoreLibrary packages, ensure you have:- Flutter SDK installed (version 3.0.0 or higher recommended)
- A Flutter project set up
- Basic familiarity with
pubspec.yamlfile
Installing packages
You can add Flutter CoreLibrary packages to your project using either the Flutter CLI or by manually editing yourpubspec.yaml file.
Choose your packages
Identify which packages you need from the Flutter CoreLibrary. Each package serves a specific purpose:
- cqrs - CQRS backend communication
- leancode_lint - Lint rules and code quality
- leancode_hooks - Reusable Flutter hooks
- enhanced_gradients - Better gradient rendering
- login_client - OAuth2 authentication
- leancode_debug_page - Debug tools
- leancode_force_update - Force update functionality
- leancode_markup - Markup text rendering
Add packages using CLI
The easiest way to add packages is using the Flutter CLI:This automatically adds the latest version to your
pubspec.yaml and runs flutter pub get.Or add manually to pubspec.yaml
Alternatively, you can manually edit your After editing, run:
pubspec.yaml file:pubspec.yaml
Special configuration
Some packages require additional setup:leancode_lint
After installingleancode_lint, you need to configure your analysis_options.yaml:
analysis_options.yaml
leancode_debug_page
To use the debug page, wrap yourMaterialApp with DebugPageOverlay:
leancode_force_update
Wrap yourMaterialApp with ForceUpdateGuard:
Version compatibility
Check each package’spubspec.yaml for specific version requirements:
- cqrs: Dart SDK >=3.0.1
- leancode_lint: Dart SDK >=3.11.0
- leancode_hooks: Flutter >=3.35.0, Dart SDK >=3.9.0
- enhanced_gradients: Flutter >=3.19.0, Dart SDK >=3.3.0
Troubleshooting
Package conflicts
If you encounter version conflicts, try:pubspec.yaml.
Analysis server issues
Ifleancode_lint rules don’t appear after installation:
- Restart the analysis server in your IDE
- Run
flutter cleanandflutter pub get - Check that the plugin is correctly specified in
analysis_options.yaml
Import errors
Make sure you’ve runflutter pub get after adding packages to pubspec.yaml.
Next steps
Core Packages
Explore CQRS and authentication packages
Guides
Get started with comprehensive guides
