fsa 0.0.2 copy "fsa: ^0.0.2" to clipboard
fsa: ^0.0.2 copied to clipboard

Flutter Smart Assets - CLI tool that auto-scans assets/fonts and generates strongly-typed Dart constants with auto-updated pubspec.yaml

🚀 F S A • Flutter Smart Assets #

FSA (Flutter Smart Assets) is a lightweight CLI tool that automatically scans your Flutter project's assets directories, then:

✅ Updates your pubspec.yaml with proper indentation
✅ Generates a strongly-typed app_assets.dart file
✅ Uses UPPERCASE constants with format suffixes intact (e.g. LOGO_PNG)
✅ Includes summary comments at the top of generated files


📦 Installation #

dart pub global activate fsa

Make sure the global bin is in your PATH.


⚡ Usage #

fsa generate

This will:

  • Scan all files in assets/
  • Update pubspec.yaml → flutter: assets: (with 2-space indentation)
  • Generate lib/app_assets.dart like:
// GENERATED CODE - DO NOT MODIFY BY HAND
// Generated by fsa (Flutter Smart Assets) - safe mode
// Assets: 6 files | Images: 1 | Fonts: 3 | Lottie: 2

class AppAssets {
  static const LOGO_PNG = "assets/logo.png";
  static const ICON_SVG = "assets/icon.svg";
}

class AppOthers {
  static const CONFIG_JSON = "assets/config.json";
}

🔧 Example Workflow #

fsa generate
# ✅ Assets scanned
# ✅ pubspec.yaml updated
# ✅ app_assets.dart created

📜 License #

BSD 3-clause license


Author: Ayoigbala Soares — https://github.com/hermes13002

1
likes
140
points
25
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter Smart Assets - CLI tool that auto-scans assets/fonts and generates strongly-typed Dart constants with auto-updated pubspec.yaml

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

flutter, path, yaml, yaml_edit

More

Packages that depend on fsa