fdev 0.1.2 copy "fdev: ^0.1.2" to clipboard
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_runner with --delete-conflicting-outputs
  • run flutter clean followed by flutter 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 required array 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"], and oneOf/anyOf null 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 #

  1. Modify Code: Edit files under lib/src/ or add new commands in lib/src/cli.dart.
  2. Version Bump:
    • Update version in pubspec.yaml.
    • Update cliVersion in lib/src/cli.dart.
    • Document changes in CHANGELOG.md.
  3. Format & Analyze:
    dart format .
    dart analyze
    
  4. Local Activation Test:
    dart pub global activate --source path .
    
  5. Publish to pub.dev:
    • Run dry-run checks:
      dart pub publish --dry-run
      
    • Publish to pub.dev:
      dart pub publish
      
  • fdev ios for flavor-based iOS builds
  • fdev icons for launcher icon generation
  • fdev splash for native splash generation
  • fdev env for selecting dev/stage/prod .env files
  • fdev release-notes for APK metadata and changelog output
  • fdev swagger --watch to regenerate when a local Swagger file changes
0
likes
0
points
379
downloads

Publisher

verified publisherrahulsha.com.np

Weekly Downloads

Ultimate Flutter developer tools CLI. Streamline build_runner, Swagger/OpenAPI code generator, Android signing keystores, CocoaPods updater, and developer productivity workflows.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on fdev