🚀 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

Libraries

fsa