Add Assets Automatically in Flutter

Adding assets in Flutter can be a real pain. You have to add each folder and file separately, which can be time-consuming and exhausting. It would be great if there was an easier way to do this.

If you’re looking for a library that can support you in adding assets to your pubspec.yaml file, look no further than the asset_manager_cli package. This package can automatically generate the code for your assets and add it to your pubspec.yaml file, saving you time and headaches.

To use asset_manager_cli, simply run the below command from your terminal to install it first.

dart pub global activate asset_manager_cli

Once the package is installed, you can use this command:

asset_manager add

This command will scan the assets folder in your project folder, search for sub-folders and files to add to pubspec.yaml file.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close