GraphicsModels class final

The models a game's scenes use, each loaded once per asset path: read from bundle, parsed, uploaded with uploader.

Constructors

GraphicsModels(AssetBundle bundle, ModelUploader uploader)
A cache loading through bundle and uploading with uploader.

Properties

bundle → AssetBundle
Where model files are read from.
final
hashCode → int
The hash code for this object.
no setterinherited
listeners → List<void Function(String path)>
Called each time a model finishes loading, and when one is to be loaded again (reload).
final
paths → Iterable<String>
Every path asked for so far.
no setter
readOverride ↔ Future<Uint8List?> Function(String path)?
Reads a file in place of bundle when it returns bytes; null falls back to the bundle. An editor sets it to read the project's files, which the bundle — a snapshot from when the app was built — may not have yet.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
uploader → ModelUploader
Uploads parsed models.
final

Methods

dataOf(String path) → ModelData?
The parsed data of the model at path, once loaded.
errorOf(String path) → Object?
Why the model at path did not load, or null.
get(String path) → GpuModel?
The model at path once it has loaded; null before that (the first call starts loading it) or when it failed to load.
load(String path) → Future<GpuModel>
Loads the model at path, or returns the load already under way.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String path) → Future<Uint8List>
The bytes of the file at path, through readOverride or bundle.
reload(String path) → void
Forgets the model at path so the next use loads it again (its file or its cooked copy changed), and tells listeners.
toString() → String
A string representation of this object.
inherited

Operators

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