fli 1.1.2
fli: ^1.1.2 copied to clipboard
A native CLI tool for generating clean and standardized Flutter project structures. Supports all platforms with optimized functionality for desktop use.
Examples #
This directory contains example projects generated with different fli
templates to showcase the project structures.
Basic Template Example #
The basic template creates a simple, clean structure suitable for small to medium apps:
fli create my_basic_app --template=basic
Generated Structure:
my_basic_app/
├── lib/
│ ├── core/
│ │ ├── constants/
│ │ │ ├── app_colors.dart
│ │ │ └── app_strings.dart
│ │ ├── theme/
│ │ │ └── app_theme.dart
│ │ └── utils/
│ │ └── app_utils.dart
│ ├── screens/
│ │ └── home/
│ │ └── home_screen.dart
│ ├── widgets/
│ │ └── custom_button.dart
│ ├── services/
│ ├── app.dart
│ └── main.dart
├── test/
│ ├── widget_test/
│ └── unit_test/
├── assets/
│ ├── images/
│ ├── icons/
│ └── fonts/
├── doc/
├── pubspec.yaml
├── analysis_options.yaml
├── .gitignore
└── README.md
Feature-Driven Template Example #
The feature-driven template organizes code by features for better scalability:
fli create my_feature_app --template=feature_driven
Generated Structure:
my_feature_app/
├── lib/
│ ├── core/
│ │ ├── constants/
│ │ ├── theme/
│ │ ├── utils/
│ │ └── services/
│ ├── features/
│ │ └── home/
│ │ └── presentation/
│ │ ├── pages/
│ │ │ └── home_page.dart
│ │ └── widgets/
│ │ └── home_content.dart
│ ├── shared/
│ │ ├── widgets/
│ │ │ └── custom_card.dart
│ │ └── services/
│ ├── app.dart
│ └── main.dart
├── test/
│ ├── features/
│ └── shared/
└── ...
Running the Examples #
To test any of the examples:
- Navigate to the generated project directory
- Install dependencies:
flutter pub get
- Run the app:
flutter run
Each example includes:
- ✅ Proper folder structure
- ✅ Theme configuration
- ✅ Basic routing setup
- ✅ Reusable widgets
- ✅ Test structure
- ✅ Documentation
- ✅ Linting rules
- ✅ Git configuration
Customizing Generated Projects #
After generating a project with fli
, you can:
- Add dependencies to
pubspec.yaml
- Configure themes in
lib/core/theme/
- Add new screens following the established pattern
- Implement state management (Provider, BLoC, Riverpod, etc.)
- Add API services in the
services/
directory - Write tests in the
test/
directory
Next Steps #
- Explore the generated code structure
- Read the generated README.md for project-specific information
- Check out the Contributing Guide for adding new templates
- Share your feedback and suggestions!