Ref<T> class

Ref ~ Data reference

  • Having problems with non immutable classes?
  • have a few fields you will like to edit or change any where in your code?
  • need raw global access in to a value in your code?

Well, your problem is solved. You can now reference your Object using the Ref class and easily set and get the value anytime and anywhere in your code. Ref helps to assign a key to your Object. Making it available globally in your code.

var data = Ref.of(#data).get;
Ref.of(#data).set(data);
Ref.of(#data).get = data}
Ref.create(data)
Implemented types

Constructors

Ref.create(T? value)
create a new Ref instance pointing to a unique key generated automatically. To access the generated key, see: receipt. The created reference will host value
factory
Ref.of(Symbol key)
create a new Ref instance pointing to key. The created reference will host null or The value of the old reference if any.

Properties

get ↔ T?
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
hasListeners bool
Whether any listeners are currently registered.
no setteroverride
key Symbol
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setteroverride

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
override
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
override
set(T? data) Ref<T>
toString() String
A string representation of this object.
override

Operators

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

Static Properties

receipt Symbol?
getter/setter pair