MockScope class

A mock designed for use when testing code that uses Scope.

Implemented types

Constructors

MockScope()

Properties

hashCode int
The hash code for this object.
no setterinherited
onClear ↔ (void Function<T>(StateRef<T> ref)?)
Called when clear is called.
getter/setter pair
onRead ↔ (void Function<T>(Watchable<T> ref)?)
Called when read is called.
getter/setter pair
onRedo VoidCallback?
Called when redo is called.
getter/setter pair
onUndo VoidCallback?
Called when undo is called.
getter/setter pair
onUse ↔ (void Function<T>(LogicRef<T> ref)?)
Called when use is called.
getter/setter pair
onWrite ↔ (void Function<T>(StateRef<T> ref, T state, Object? action)?)
Called when write is called.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear<T>(StateRef<T> ref) → void
Removes the state referenced by ref from the scope.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read<T>(Watchable<T> ref, List<BinderKey>? keys) → T
Gets the current state referenced by ref.
override
redo() → void
Re-executes a previously canceled write.
override
reset() → void
Clears all the states.
toString() String
A string representation of this object.
inherited
undo() → void
Cancels the last write.
override
use<T>(LogicRef<T> ref) → T
Gets the current logic component referenced by ref.
override
write<T>(StateRef<T> ref, T state, [Object? action]) → void
Updates the value of the state referenced by ref with state.
override

Operators

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