A powerful CLI package to speed up Flutter app development by automating repetitive tasks like creating features, pages, forms, and generating Dart model classes from JSON and and reformatting code and more. Additionally, it initializes your Flutter project's infrastructure and installs essential packages.
With flyer
, you can streamline your development process, reduce boilerplate code, and focus
on building your app's core features.
- Project Initialization: Set up the infrastructure of your Flutter project and install essential packages.
- Feature Generation: Generate fully-structured Flutter features.
- Language Support: Add multiple languages to your app with ease.
- Model Generation: Generate Dart classes directly from JSON data.
- Page Generation: Add pages to specific features.
- Form Generation: Generate forms with custom fields.
- Code Formatting: Reformat your code for consistency.
- Unused Resources Finder: Identify and optionally delete unused assets, packages, and files.
Add the following dependency to your pubspec.yaml
:
dev_dependencies:
flyer: <latest version>
dart pub get
OR Run the following command to install:
dart pub add dev:flyer
The init
command sets up the basic infrastructure for your Flutter project and installs essential
packages.
flyer init [OPTIONS]
Option | Description | Example Usage |
---|---|---|
--lang |
Add languages during initialization. | --lang=en,ar,fr |
flyer init --lang=en,ar
This command:
- Sets up the basic infrastructure for your Flutter project.
- Installs essential packages (e.g.,
app_features
,flutter_bloc
, etc.). - Adds the specified languages (
en
andar
) to the project. - Displays Messages and Dialogs and BottomSheet without context.
- hande app responsive by use responsive_framework package.
- initialize Call Api by use api_request package.
- Manage Routes by use go_router package.
The make
command allows you to create features, pages, models, forms, and manage languages for
your Flutter project.
flyer make [OPTIONS]
Option | Description | Example Usage |
---|---|---|
--feature, -f |
Create a new feature. | --feature=myFeature |
--lang |
Add multiple languages to the app. | --lang=en,ar |
--model, -m |
Generate a Dart class from JSON. | --model=UserModel --json='{"name": "ahmed"}' |
--page |
Create a page within a feature. | --page=homePage --feature=myFeature |
--form |
Create a form with fields in a feature. | --form=login --fields=password,email |
flyer make --feature=account
flyer make --lang=en,fr,es
flyer make --model=User --json='{"name": "John", "age": 30}'
flyer make --model=User --json='{"name": "John", "age": 30}' --path=custom_path
flyer make --page=login --feature=account
flyer make --form=login --feature=account --fields=email,password
The run
command provides utility tasks like reformatting your project's code.
flyer run [OPTIONS]
Option | Description | Example Usage |
---|---|---|
--format |
Reformat the project's code. | --format |
To format your project's code:
flyer run --format
The fiend
command helps you identify and optionally delete unused assets, packages, and files in
your Flutter project.
flyer fiend [OPTIONS]
Option | Description | Example Usage |
---|---|---|
--unusedAssets |
Find unused assets in your project. | --unusedAssets |
--unusedPackages |
Find unused packages in your project. | --unusedPackages |
--unusedFiles |
Find unused files in your project. | --unusedPackages |
flyer fiend --unusedAssets
flyer fiend --unusedPackages
flyer fiend --unusedFiles
Contributions are welcome! Here's how you can get involved:
- Fork the repository.
- Create a new branch (
feature/my-feature
). - Commit your changes.
- Push to your branch.
- Open a pull request.
Feel free to file issues or feature requests on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.
For more details, visit the official Dart documentation and Flutter CLI documentation.
Happy coding! 😊