asset_generator 1.3.1
asset_generator: ^1.3.1 copied to clipboard
A Dart package that generates code for asset paths and pre-caches images, simplifying asset management in Flutter projects.
Use this package as an executable
Install it
You can install the package from the command line:
dart pub global activate asset_generator
Use it
The package has the following executables:
$ generate
Use this package as a library
Depend on it
Run this command:
With Flutter:
$ flutter pub add asset_generator
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
dependencies:
asset_generator: ^1.3.1
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:asset_generator/asset_generator.dart';