IsolatedLogWriter class
A LogWriter that wraps any LogWriter in a dedicated isolate.
This ensures that timer-driven animations (e.g. progress spinners) keep updating even when the calling isolate's event loop is blocked by heavy synchronous work.
All operations are forwarded to the isolate and awaited; the caller chooses whether to await the returned future.
- Inheritance
-
- Object
- IsolatedObject<
LogWriter> - IsolatedLogWriter
- Implemented types
Constructors
-
IsolatedLogWriter(Factory<
LogWriter> factory) -
Creates an IsolatedLogWriter that runs the writer produced by
factoryon a dedicated isolate.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isClosed → bool
-
Whether close has been called. Once true, further evaluate calls
throw a StateError.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future< void> -
Shuts down the isolate.
override
-
closeScope(
LogScope scope, {required bool success, required Duration duration, Object? error, StackTrace? stackTrace}) → Future< void> -
Ends a scoped operation.
override
-
evaluate<
U> (FutureOr< U> function(LogWriter)) → Future<U> -
Evaluates
functionon the isolated object and returns the result.inherited -
log(
LogEntry entry) → Future< void> -
Writes a single log entry.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openScope(
LogScope scope) → Future< void> -
Begins a scoped operation.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited