fdev 0.1.2
fdev: ^0.1.2 copied to clipboard
Ultimate Flutter developer tools CLI. Streamline build_runner, Swagger/OpenAPI code generator, Android signing keystores, CocoaPods updater, and developer productivity workflows.
fdev #
fdev is a local Dart CLI for repeated Flutter development tasks:
- run
build_runnerwith--delete-conflicting-outputs - run
flutter cleanfollowed byflutter pub get - build APKs with flavor, target, build mode, defines, and split ABI flags
- build Android app bundles with flavor, target, build mode, and defines
- run the iOS pod update workflow
- generate Android upload keystores and show SHA fingerprints
- generate plain Dart API response models from Swagger/OpenAPI JSON
- check local Dart/Flutter setup
This package is intentionally dependency-free. The generated API models also avoid external dependencies and include manual fromJson and toJson methods.
Installation #
You can install fdev globally from pub.dev using the Dart SDK:
dart pub global activate fdev
Path Setup #
Make sure Dart's global package executables are added to your system's PATH. Add the following to your shell configuration file (e.g., ~/.bashrc, ~/.zshrc, or ~/.bash_profile):
export PATH="$PATH:$HOME/.pub-cache/bin"
Then reload your shell:
source ~/.zshrc # Or corresponding config file
Verify the installation:
fdev version
fdev doctor
Local Development / Activation #
If you are developing this tool locally on this laptop, navigate to the project directory and run:
dart pub global activate --source path .
Commands #
Run Build Runner #
From a Flutter project root:
fdev gen
This runs:
dart run build_runner build --delete-conflicting-outputs
Watch mode:
fdev gen --watch
Pass extra arguments after --:
fdev gen -- --build-filter="lib/**"
Clean And Get Packages #
From a Flutter project root:
fdev clean
This runs:
flutter clean
flutter pub get
Build APK #
Default release build:
fdev apk
With flavor:
fdev apk dev
With flavor and target:
fdev apk --flavor dev --target lib/main_dev.dart
With split ABI and defines:
fdev apk prod -t lib/main_prod.dart --split-per-abi --dart-define API_ENV=prod
Debug/profile:
fdev apk dev --debug
fdev apk dev --profile
Build App Bundle #
Default release build:
fdev appbundle
With flavor and target:
fdev appbundle --flavor dev --target lib/main_dev.dart
With defines:
fdev appbundle prod -t lib/main_prod.dart --dart-define API_ENV=prod
Debug/profile:
fdev appbundle dev --debug
fdev appbundle dev --profile
Update iOS Pods #
From a Flutter project root:
fdev pod update
This runs:
flutter clean
flutter pub get
cd ios && pod update
The short alias also works:
fdev pod-update
Generate Android Signing Keystore #
From a Flutter project root:
fdev signapk
The CLI asks for:
- JKS file name
- key alias
- store password
- key password
- certificate owner name
It creates:
android/app/keystore.jks
android/app/keystore.properties
Then it prints SHA1 and SHA256.
Custom file and alias:
fdev signapk --file upload-keystore.jks --alias upload
The generated keystore.properties contains:
storePassword=...
keyPassword=...
keyAlias=upload
storeFile=keystore.jks
Keep the keystore and signing passwords private.
Show Android Keystore SHA #
From a Flutter project root:
fdev sha
The CLI asks for the JKS file name and prints SHA1/SHA256. If
android/app/keystore.properties exists, it reuses the stored file name, alias,
and password.
Non-interactive:
fdev sha --file keystore.jks
fdev keystore-sha --file android/app/upload-keystore.jks --alias upload
Generate Models From Swagger #
From a Flutter project root:
fdev swagger
The CLI asks for the Swagger/OpenAPI JSON URL and writes:
lib/models/api_models.dart
Non-interactive:
fdev swagger --url https://example.com/swagger.json --out lib/data/models/api_models.dart
From a local JSON file:
fdev swagger --file swagger.json --out lib/data/models/api_models.dart
The generator reads:
- OpenAPI 3
components.schemas - Swagger 2
definitions - inline JSON response schemas under
paths - plain sample JSON objects when the input is not an OpenAPI document
Generated models follow the Swagger/OpenAPI contract:
- fields listed in a schema's
requiredarray become required constructor parameters - required fields are non-nullable unless the property is marked nullable
- optional fields stay nullable because the response may omit them
nullable: true,x-nullable: true,type: ["...", "null"], andoneOf/anyOfnull variants are treated as nullable
Updating & Upgrading #
How to Upgrade #
If you installed fdev from pub.dev, you can easily update it to the latest version by running:
fdev upgrade
Alternatively, you can re-run the activation command:
dart pub global activate fdev
Developing & Publishing Updates #
- Modify Code: Edit files under
lib/src/or add new commands inlib/src/cli.dart. - Version Bump:
- Update
versioninpubspec.yaml. - Update
cliVersioninlib/src/cli.dart. - Document changes in
CHANGELOG.md.
- Update
- Format & Analyze:
dart format . dart analyze - Local Activation Test:
dart pub global activate --source path . - Publish to pub.dev:
- Run dry-run checks:
dart pub publish --dry-run - Publish to pub.dev:
dart pub publish
- Run dry-run checks:
Recommended Future Features #
fdev iosfor flavor-based iOS buildsfdev iconsfor launcher icon generationfdev splashfor native splash generationfdev envfor selecting dev/stage/prod.envfilesfdev release-notesfor APK metadata and changelog outputfdev swagger --watchto regenerate when a local Swagger file changes