AssetId class Null safety

Identifies an asset within a package.

Implemented types


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".
AssetId.resolve(Uri uri, {AssetId? from})
Creates a new AssetId from an uri String.


extension String
The file extension of the asset, if it has one, including the ".".
hashCode int
The hash code for this object.
read-only, override
package String
The name of the package containing this asset.
path String
The path to the asset relative to the root directory of package.
pathSegments List<String>
Splits path into its components.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
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.
late, final


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.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
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.


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