👑 flutter_asset_manager

This package is brought to you by Usama Azad 😎

A command-line tool which auto generates asset directories and register them in pubspec.yaml

Features

  • Auto Generates Assets Directories
  • Auto Register Directories In pubspec.yaml
  • Auto Generate Dart File For Assets (coming soon 🔜)

Installation


1. Use this package as an executable

Install it

You can install the package from the command line:

dart pub global activate flutter_asset_manager

OR

dart pub global activate --source git https://github.com/Usama-Azad/flutter_asset_manager.git

Use it

The package has the following executables:

assetX

2. Use this package as a library

Run command

With Dart:
dart pub add flutter_asset_manager
With Flutter:
flutter pub add flutter_asset_manager

Add as a Dev Dependency in pubspec.yaml

dev_dependencies: 
  flutter_asset_manager: "^0.0.1"

OR

dev_dependencies: 
  flutter_asset_manager:
    git:
      url: https://github.com/Usama-Azad/flutter_asset_manager.git

After adding as a dev dependency run flutter pub get

Usage

After adding as a dev_dependency in pubspec.yaml, all that is left to do is run the package.


1. Default Directories

if globally activated

assetX

if dev dependency

dart run flutter_asset_manager

OR

flutter pub run flutter_asset_manager

2. Specific Directories with --no-default Argument

  • If you provide --no-default argument then it don’t create default directories

  • But with --no-default argument you must provide directories name you want to create.

if globally activated

assetX --no-default images icons

if dev dependency

dart run flutter_asset_manager --no-default images icons

OR

flutter pub run flutter_asset_manager --no-default images icons

3. Both Default & Specific Directories

  • You can generate both default & specific directories by skipping --no-default argument.

if globally activated

assetX svgs

if dev dependency

dart run flutter_asset_manager svgs

OR

flutter pub run flutter_asset_manager svgs

GitHub

View Github