flyer
A powerful CLI package to speed up Flutter app development by automating repetitive tasks like creating features, pages, forms, 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.
Features
- Project Initialization: Set up the infrastructure of your Flutter project and install essential packages with Arabic and English localization by default.
- Feature Generation: Generate fully-structured Flutter features.
- Language Support: Add multiple languages to your app with ease.
- Page Generation: Add pages to specific features.
- Form Generation: Generate forms with custom fields.
- Deep Linking: Setup and test deep linking with automatic Android/iOS configuration.
- Watch Mode: Automatically monitor localization keys and add missing ones.
- Code Formatting: Reformat your code for consistency.
- Unused Resources Finder: Identify and optionally delete unused assets, packages, and files.
Installation
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
Usage
Init Command
The init command sets up the basic infrastructure for your Flutter project and installs essential
packages.
flyer init [OPTIONS]
Available Options
| Option | Description | Example Usage |
|---|---|---|
--lang |
Add languages during initialization (defaults to en,ar). |
--lang=en,ar,fr |
--firebase |
Setup Firebase (installs firebase_core and runs flutterfire configure). |
--firebase |
--onboarding |
Add onboarding feature with intro screens. | --onboarding |
Examples
flyer init --lang=en,ar,de
With Firebase and Onboarding:
flyer init --firebase --onboarding
This command:
- Sets up the basic infrastructure for your Flutter project with three default features:
splash,home, andaccount. - Generates a MasterPage with a modern floating bottom navigation bar (animated, dark mode support, haptic feedback).
- Generates AppBloc/AppState with tab navigation management.
- Generates BottomNavData and BottomNavItemModel for easy tab configuration.
- Generates AppStyles with full text style system (thin, light, regular, medium, semibold, bold) using Almarai font.
- Copies Almarai font files to
assets/fonts/and configures them inpubspec.yaml. - Installs essential packages (
app_features,api_request,equatable,hive_flutter,get_it,flutter_bloc,flutter_easyloading,toastification,responsive_framework,app_forms,requests_inspector). - Automatically adds Arabic (
ar) and English (en) languages by default. - Automatically installs
requests_inspectorpackage for API debugging. - Adds any additional languages specified with
--langoption. - Displays Messages, Dialogs, and BottomSheet without context.
- Handles app responsiveness using
responsive_frameworkpackage. - Initializes API configuration using
api_requestpackage. - Manages Routes using
go_routerpackage (viaapp_features). - With
--firebase: Installsfirebase_core, addsFirebase.initializeApp()tomain.dart, and runsflutterfire configureinteractively. - With
--onboarding: Adds an onboarding feature with PageView intro screens, dot indicators, and skip/next navigation. Shown only on first launch.
Generated Structure
lib/
├── app/
│ ├── app_feature.dart # AppFeature with MasterPage route
│ ├── master_page.dart # Floating bottom nav bar with IndexedStack
│ ├── bloc/
│ │ ├── app_bloc.dart # Tab index management
│ │ └── app_state.dart # App state with currentIndex
│ ├── data/
│ │ └── bottom_nav_data.dart # Tab items configuration
│ ├── models/
│ │ └── bottom_nav_item_model.dart
│ └── utils/
│ └── notification_util.dart
├── config/app_config.dart
├── core/
│ ├── app_storage.dart # Hive-based storage
│ ├── extensions/
│ └── utils/api_util.dart
├── theme/
│ ├── app_theme.dart
│ ├── app_colors.dart
│ └── app_styles.dart # Full text style system
├── features/
│ ├── splash/ # Splash -> MasterPage (or Onboarding)
│ ├── home/
│ ├── account/
│ └── on_boarding/ # (with --onboarding flag)
├── l10n/
└── main.dart
assets/
└── fonts/ # Almarai font files
Make Command
The make command allows you to create features, pages, forms, and manage languages for
your Flutter project.
flyer make [OPTIONS]
Available Options
| Option | Description | Example Usage |
|---|---|---|
--feature, -f |
Create a new feature. | --feature=myFeature |
--lang |
Add multiple languages to the app. | --lang=en,ar |
--page |
Create a page within a feature. | --page=login --feature=account |
--form |
Create a form with fields in a feature. | --form=login --feature=account --fields=email,password |
Examples
Create a New Feature
flyer make --feature=account
This creates:
lib/features/account/
account_feature.dart
account_page.dart
bloc/account_bloc.dart
bloc/account_state.dart
actions/
Each generated feature includes quick access getters:
// Access feature anywhere
AccountFeature.to.go();
AccountFeature.to.push();
// Access bloc anywhere
AccountBloc.to.login(data);
Add Multiple Languages
flyer make --lang=en,fr,es
Generate a Page
flyer make --page=login --feature=account
This adds a new page to the account feature, updates the feature's routes, and adds a pushLogin() navigation method.
Generate a Form
flyer make --form=login --feature=account --fields=email,password
Run Utility Tasks
The run command provides utility tasks like reformatting your project's code.
flyer run [OPTIONS]
Available Options
| Option | Description | Example Usage |
|---|---|---|
--format |
Reformat the project's code. | --format=. |
Example
To format your project's code:
flyer run --format=.
Watch Mode
The watch command monitors your Flutter project for localization changes and automatically adds missing keys to .arb files.
flyer watch --loc [OPTIONS]
Available Options
| Option | Description | Default |
|---|---|---|
--loc |
Watch for missing localization keys and auto-add them (required). | false |
--debounce |
Debounce time in seconds. | 2 |
--verbose, -v |
Show detailed logs. | false |
Example
flyer watch --loc
With verbose logging and custom debounce:
flyer watch --loc --verbose --debounce=5
This command:
- Watches
lib/directory for.dartfile changes. - Runs
dart analyzeto detect missingAppLocalizationsgetters. - Adds missing keys to all
.arbfiles with language-appropriate defaults. - Runs
flutter gen-l10nto regenerate localization files.
Deep Linking
The deeplink command sets up and tests deep linking for your Flutter app on both Android and iOS platforms.
Setup
flyer deeplink [OPTIONS]
Available Options
| Option | Description | Example Usage |
|---|---|---|
--domain, -d |
Domain for App Links and Universal Links. | --domain=example.com |
--scheme, -s |
Custom URL scheme. | --scheme=myapp |
--dry-run |
Show what will be done without making any changes. |
You must specify at least one of --domain or --scheme.
Example
flyer deeplink --domain=example.com --scheme=myapp
This command:
- Extracts project info (Android package name, iOS bundle ID, Team ID, SHA256 fingerprint).
- Updates
AndroidManifest.xmlwith intent filters. - Creates
assetlinks.jsonfor Android App Links verification. - Creates
apple-app-site-associationfor iOS Universal Links. - Updates iOS
Info.plistwith URL schemes and deep linking settings. - Generates
DeeplinkHandlerutility class (singleton) for handling deep links. - Installs
app_linkspackage.
Testing Deep Links
flyer deeplink --test [OPTIONS]
Test Options
| Option | Description | Example Usage |
|---|---|---|
--test |
Enable test mode. | |
--url |
URL to test. | --url=https://example.com/path |
--scheme |
Custom URL scheme for test. | --scheme=myapp |
--android |
Test on Android only. | |
--ios |
Show iOS test instructions. |
Example
flyer deeplink --test --url=myapp://example.com/product/123 --android
Full Documentation
For complete setup instructions, testing, and advanced features (including Universal Links), see:
- DEEPLINK_GUIDE.md - Comprehensive deep linking documentation
Find Unused Resources
The fiend command helps you identify and optionally delete unused assets, packages, and files in
your Flutter project.
flyer fiend [OPTIONS]
Available 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. | --unusedFiles=. |
Note: These options require a value (e.g.,
--unusedAssets=.).
Example Usage
Find Unused Assets
flyer fiend --unusedAssets=.
Find Unused Packages
flyer fiend --unusedPackages=.
Find Unused Files
flyer fiend --unusedFiles=.
Contributing
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.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Additional Information
For more details, visit the official Dart documentation and Flutter CLI documentation.
Libraries
- commands/deeplink_command
- commands/fiend_command
- commands/init_command
- commands/make_command
- commands/run_command
- commands/watch_command
- core/app_helper
- core/colors_text
- core/constants/packages_name
- core/creator_util
- core/extensions
- core/helpers/updated_features_in_config
- core/user_helper
- creators
- functions/deeplink/deeplink_setup
- functions/deeplink/deeplink_test
- functions/deeplink/extract_project_info
- functions/delete_file
- functions/extract_strings
- functions/find_unused_assets
- functions/find_unused_file
- functions/find_unused_package
- functions/format_code
- functions/get_app_name
- functions/install_package
- functions/localization/add_keys_to_arb
- functions/localization/analyze_missing_keys
- functions/run_pub_get
- functions/watch_localization
- samples/api_util_sample
- samples/app_bloc_sample
- samples/app_colors_sample
- samples/app_config_sample
- samples/app_feature_sample
- samples/app_notifications_sample
- samples/app_storage_sample
- samples/app_styles_sample
- samples/app_theme_sample
- samples/cubit_samples
- samples/deeplink_samples
- samples/extensions/context_extension_sample
- samples/feature_sample
- samples/form_sample
- samples/home_sample
- samples/main_sample
- samples/master_page_sample
- samples/onboarding/onboarding_data_sample
- samples/onboarding/onboarding_feature_sample
- samples/onboarding/onboarding_model_sample
- samples/onboarding/onboarding_page_sample
- samples/page_sample
- samples/splash_feature_sample
- samples/splash_page_sample
- samples/state_samples
- samples/utils/notification_util_sample