Ref<T> class

A mutable reference wrapper for binding and managing a value.

Inspired by C++ std::reference_wrapper, Ref<T> serves as an explicit wrapper signifying that the held element is a reference that can be fetched, rebound, and mutated.

Constructors

Ref(T _value)
Creates a new reference bound to the provided value.

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call() → T
Evaluates and retrieves the bound value implicitly.
get() → T
Retrieves the currently bound value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rebind(Ref<T> other) → void
Rebinds this reference to point to the exact same value as other.
set(T value) → void
Rebinds the reference to a completely new value.
toString() String
A string representation of this object.
override

Operators

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