AssetReference class

A reference to an asset on disk.

Annotations
  • @JsonSerializable()

Constructors

AssetReference(String name, AssetType type, {String? encryptionKey, double gain = defaultGain})
Create an instance.
const
AssetReference.collection(String name, {String? encryptionKey, double gain = defaultGain})
Create an instance with its type set to AssetType.collection.
const
AssetReference.file(String name, {String? encryptionKey, double gain = defaultGain})
Create an instance with its type set to AssetType.file.
const
AssetReference.fromJson(Map<String, dynamic> json)
Create an instance from a JSON object.
factory

Properties

encryptionKey String?
The encryption key, if any.
final
gain double
The gain to play this sound at.
final
hashCode int
The hash code for this object.
no setterinherited
name String
The name of this sound.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type AssetType
The type of the sound.
final

Methods

copy(double gain) AssetReference
Return a copy of this object with a new gain value.
getFile(Random random) File
Get a file from this reference.
load(Random random) List<int>
Load the contents of this asset.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
silent() AssetReference
Return a version of this AssetReference with gain set to 0.0.
toJson() Map<String, dynamic>
Convert an instance to JSON.
toString() String
A string representation of this object.
inherited

Operators

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