Asset class

Represents an individual asset file with metadata.

Contains information about the asset's location, type, and naming conventions for code generation.

Constructors

Asset({required String name, required String path, required String extension, required String directory, required String fileName})
Creates a new Asset instance.
const
Asset.fromPath(String filePath)
Creates an Asset from a file path.
factory

Properties

directory String
The directory name containing this asset.
final
extension String
The file extension (e.g., 'png', 'svg', 'jpg').
final
fileName String
The full filename including extension.
final
hashCode int
The hash code for this object.
no setteroverride
isFont bool
Checks if this asset is a font file.
no setter
isImage bool
Checks if this asset is an image file.
no setter
name String
The file name without extension (e.g., 'icon' from 'icon.png').
final
path String
The complete file path relative to the project root.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldInclude bool
Checks if this asset should be included in generation.
no setter

Methods

getRelativePath(String assetsRoot) String
Gets the relative path from the assets directory.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toClassName() String
Converts the directory name to a valid Dart class name.
toConstantName() String
Converts the asset name to a valid Dart constant name.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override