ReadonlyRef<T> class abstract interface

Read-only component of a reactive ref.

This interface provides read access to a ref's value without the ability to modify it. Use this in APIs where you want to expose reactive state without allowing mutations.

Example

class Counter {
  final _count = ref(0);

  // Expose read-only access
  ReadonlyRef<int> get count => _count;

  void increment() => _count.value++;
}
Implemented types
Implementers

Properties

debugName String?
Debug name for this ref.
no setter
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
Gets the current value, tracking the dependency.
no setter

Methods

call() → T
Shorthand for getting value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
peek() → T
Gets the current value without tracking the dependency.
toString() String
A string representation of this object.
inherited

Operators

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