ZenTestController class abstract

Test-specific controller base class with additional utilities

Inheritance
Available extensions

Constructors

ZenTestController()

Properties

activeWatcherCount int
Get count of active watchers (useful for debugging)
no setterinherited
createdAt DateTime
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isDisposed bool
no setterinherited
isInitialized bool
no setterinherited
isReady bool
no setterinherited
methodCalls List<String>
Track all method calls for verification
final
reactiveObjectCount int
Get count of tracked reactive objects for debugging
no setterinherited
reactiveStats Map<String, int>
Get stats about reactive objects
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addDisposer(void disposer()) → void
Add a disposer function that will be called when the controller is disposed
inherited
addUpdateListener(String updateId, VoidCallback listener) → void
Register a listener for a specific update ID
inherited
autoDispose<T>(ValueNotifier<T> obs, bool disposeCondition(T), void callback(T)) ZenWorkerHandle

Available on ZenController, provided by the ZenControllerAdvancedExtension extension

Worker that auto-disposes when a condition is met
clearCallHistory() → void
Clear method call history
condition<T>(ValueNotifier<T> obs, bool condition(T), void callback(T)) ZenWorkerHandle
inherited
createEffect<T>({required String name}) ZenEffect<T>
Create an effect that will be auto-disposed with this controller
inherited
createWorkerGroup() ZenWorkerGroup
Create a managed worker group
inherited
createWorkers(List<ZenWorkerHandle Function()> creators) List<ZenWorkerHandle>

Available on ZenController, provided by the ZenControllerWorkerExtension extension

Create multiple workers in one call
debounce<T>(ValueNotifier<T> obs, void callback(T), Duration duration) ZenWorkerHandle
inherited
didChangeAppLifecycleState(AppLifecycleState state) → void
Override from WidgetsBindingObserver to handle app lifecycle
inherited
dispose() → void
Dispose the controller and clean up ALL resources - PREVENTS MEMORY LEAKS
inherited
disposeWorkers(List<ZenWorkerHandle> workers) → void

Available on ZenController, provided by the ZenControllerWorkerExtension extension

Dispose specific workers
ever<T>(ValueNotifier<T> obs, void callback(T)) ZenWorkerHandle
Type-safe convenience worker methods
inherited
getCallCount(String methodName) int
Get call count for method
getResourceStats() Map<String, dynamic>
Get comprehensive resource usage statistics
inherited
getWorkerStats() Map<String, dynamic>
Get worker statistics for debugging/monitoring
inherited
interval<T>(ValueNotifier<T> obs, void callback(T), Duration duration) ZenWorkerHandle
inherited
limited<T>(ValueNotifier<T> obs, void callback(T), int maxExecutions) ZenWorkerHandle

Available on ZenController, provided by the ZenControllerAdvancedExtension extension

Worker that executes a limited number of times
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
obs<T>(T initialValue) Rx<T>
Create and auto-track a reactive variable - PREVENTS MEMORY LEAKS
inherited
obsList<T>([List<T>? initialValue]) RxList<T>
Create and auto-track a reactive list - PREVENTS MEMORY LEAKS
inherited
obsMap<K, V>([Map<K, V>? initialValue]) RxMap<K, V>
Create and auto-track a reactive map - PREVENTS MEMORY LEAKS
inherited
obsSet<T>([Set<T>? initialValue]) RxSet<T>
Create and auto-track a reactive set - PREVENTS MEMORY LEAKS
inherited
once<T>(ValueNotifier<T> obs, void callback(T)) ZenWorkerHandle
inherited
onClose() → void
User-defined cleanup hook - called before internal disposal
inherited
onDetached() → void
Called when the app is detached
inherited
onHidden() → void
Called when the app is hidden
inherited
onInactive() → void
Called when the app is inactive
inherited
onInit() → void
inherited
onPause() → void
Called when the app is paused (goes to background)
inherited
onReady() → void
inherited
onResume() → void
Called when the app is resumed (comes back to foreground)
inherited
pauseAllWorkers() → void
Pause all workers managed by this controller
inherited
pauseSpecificWorkers(List<ZenWorkerHandle> workers) → void

Available on ZenController, provided by the ZenControllerWorkerExtension extension

Pause specific workers
pauseWorkers() → void
Pause workers - convenience method for UI callbacks (no parameters)
inherited
removeUpdateListener(String updateId, VoidCallback listener) → void
Remove a listener for a specific update ID
inherited
resumeAllWorkers() → void
Resume all workers managed by this controller
inherited
resumeSpecificWorkers(List<ZenWorkerHandle> workers) → void

Available on ZenController, provided by the ZenControllerWorkerExtension extension

Resume specific workers
resumeWorkers() → void
Resume workers - convenience method for UI callbacks (no parameters)
inherited
throttle<T>(ValueNotifier<T> obs, void callback(T), Duration duration) ZenWorkerHandle
inherited
toString() String
A string representation of this object.
inherited
trackCall(String methodName) → void
Track method call with name
trackReactive(Rx reactive) → void
Manually track a reactive object (for external reactive objects)
inherited
update([List<String>? updateIds]) → void
Optimized update method that can notify specific listeners or all listeners
inherited
wasMethodCalled(String methodName) bool
Verify method was called
watch<T>(ValueNotifier<T> observable, void callback(T), {WorkerType type = WorkerType.ever, Duration? duration, bool condition(T)?}) ZenWorkerHandle
Create workers that auto-dispose with controller
inherited

Operators

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