asset_to_dart 0.1.0
asset_to_dart: ^0.1.0 copied to clipboard
A CLI tool to auto-generate strongly typed Dart classes for Flutter assets. Supports all-in-one or per-folder output, filtering, and custom output paths.
Use this package as an executable
Install it
You can install the package from the command line:
dart pub global activate asset_to_dartUse it
The package has the following executables:
$ asset_to_dart
Use this package as a library
Depend on it
Run this command:
With Dart:
$ dart pub add asset_to_dartWith Flutter:
$ flutter pub add asset_to_dartThis will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):
dependencies:
asset_to_dart: ^0.1.0Alternatively, your editor might support dart pub get or 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_to_dart/app.dart';
import 'package:asset_to_dart/flutter_asset_gen.dart';
import 'package:asset_to_dart/functions/parse_assets_from_pubspec.dart';
import 'package:asset_to_dart/models/asset_config.dart';