SplineController class
Controller for interacting with a SplineViewer WebView. The controller is attached by the SplineViewer when the widget is created and detached when disposed. Do not reuse a controller across multiple simultaneously mounted SplineViewer instances.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAttached → bool
-
no setter
- onError ↔ void Function(Object error)?
-
getter/setter pair
- onLoaded ↔ void Function()?
-
Event callbacks
getter/setter pair
- onMessage ↔ void Function(String message)?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
$dispatchRuntimeEvent(
String eventName, Map< String, dynamic> payload) → void - Internal: dispatch event payload from viewer.
-
addEventListener(
String eventName, dynamic callback(Map< String, dynamic> )) → int - Add a Spline runtime event listener (e.g. mouseDown, mouseUp, start ...) Returns an integer id that can be used to remove a specific callback.
-
attachFromViewer(
{required InternalControllerCallback reload, required Future< void> runJs(String script), required Future evalJs(String script), required void detach(), required Future<void> loadUrl(String url)}) → void -
dispose(
) → void - Clean up (called automatically by viewer dispose, safe to call manually).
-
evaluateJavaScript(
String script) → Future - Evaluate JavaScript and return a value (platform dependent types).
-
loadSceneUrl(
String url) → Future< void> - Load a new Spline scene URL.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → Future< void> - Pause helper (no-op if API not present).
-
play(
) → Future< void> - Attempts to focus / play the Spline scene (example helper).
-
reload(
) → void - Reload the Spline scene / WebView.
-
removeEventListenerById(
int id) → void - Remove a specific callback by id.
-
removeEventListeners(
String eventName) → void - Remove all listeners for an event.
-
runJavaScript(
String script) → Future< void> - Run JavaScript without caring about the return value.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited