MutableValue<T> class

A wrapper around a value that can be mutated

Could be useful for having a mutable variable within a ScopedMap.

static ScopedRef<MutableValue<T>> mutable<T>(
  T Function(ScopedMap scope) create, {
  required bool isScoped,
  String? name,
  FutureOr<void> Function(T value)? dispose,
}) {
  return ScopedRef(
    (scope) => MutableValue(create(scope)),
    isScoped: isScoped,
    dispose: dispose == null ? null : (v) => dispose(v.value),
    name: name,
  );
}

Constructors

MutableValue(T value)
A wrapper around a value that can be mutated

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value ↔ T
The current value
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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