AssetId class

Identifies an asset within a package.

Implemented types

Constructors

AssetId(String package, String path)
Creates a new AssetId at path within package.
AssetId.deserialize(List data)
Deserializes an AssetId from data, which must be the result of calling serialize on an existing AssetId.
AssetId.parse(String description)
Parses an AssetId string of the form "package|path/to/asset.txt".
factory
AssetId.resolve(Uri uri, {AssetId? from})
Creates a new AssetId from an uri String.
factory

Properties

extension String
The file extension of the asset, if it has one, including the ".".
no setter
hashCode int
The hash code for this object.
no setteroverride
package String
The name of the package containing this asset.
final
path String
The path to the asset relative to the root directory of package.
final
pathSegments List<String>
Splits path into its components.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
uri Uri
A package: URI suitable for use directly with other systems if this asset is under it's package's lib/ directory, else an asset: URI suitable for use within build tools.
latefinal

Methods

addExtension(String extension) AssetId
Returns a new AssetId with the same package as this one and with the path extended to include extension.
changeExtension(String newExtension) AssetId
Returns a new AssetId with the same package and path as this one but with file extension newExtension.
compareTo(AssetId other) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize() Object
Serializes this AssetId to an object that can be sent across isolates and passed to AssetId.deserialize.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
Returns true if other is an AssetId with the same package and path.
override