DartAssetsGenerator class
The Assets generator for dart.
- Inheritance
-
- Object
- AssetsGenerator
- DartAssetsGenerator
- Annotations
-
- @immutable
Constructors
Properties
-
assetsMap
→ Map<
String, Object?> -
The
Assets
path graph.
finalinherited
- baseName → String
-
The name of the base
Assets
class.
finalinherited
-
buildExtensions
→ Map<
String, List< String> > -
Mapping from input file extension to output file extensions.
no setterinherited
- convert → bool
-
If the
Assets
names should be converted using
StringUtils.toCamelCase
.finalinherited - encoding → Encoding
-
The encoding used for reading the
.json
and.yaml
files.finalinherited - exportEncoding → Encoding
-
The encoding used for writing the
.dart
files.finalinherited - exportPath → String
-
The path to export data to.
finalinherited
-
fileMap
→ Map<
String, Object?> -
The map of files that was loaded from
importPath
.finalinherited - formatter → DartFormatter
-
The
formatter
used to format generated files.finalinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- importPath → String
-
The path to import data from.
finalinherited
- loadFiles → bool
-
If file contents should be loaded during
build
intofileMap
.finalinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
[BuildStep? buildStep]) → FutureOr< void> -
Generate fileMap from files under importPath.
override
-
className(
String name, [Iterable< String> keys = const Iterable<String>.empty()]) → String -
Return the class name from the base
name
andkeys
.inherited -
generate(
Map< String, Object?> assetsMap) → String -
Generate a single
Assets
file from
assetsMap
. -
generateFields(
StringBuffer buffer, Map< String, Object?> assetsMap, String name, {Iterable<String> keys = const Iterable<String>.empty()}) → void -
Generate the fields for the
model nested from
keys
. -
generateHeader(
StringBuffer buffer, Map< String, Object?> assetsMap) → void - Generate a header for the Assets file.
-
generateModel(
StringBuffer buffer, Map< String, Object?> assetsMap, String name, {Iterable<String> keys = const Iterable<String>.empty()}) → void -
Generate a
model nested from
keys
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited