ReadOnlyCompleter<T> class final

A wrapper for Completer to expose only future and isCompleted.

It might be needed to expose completion of a Completer and to restrict possibility of external Completer.complete and Completer.completeError calls.

Implemented types
Available extensions

Constructors

ReadOnlyCompleter(Completer<T> base)
Main ctor.

Properties

asReadOnly ReadOnlyCompleter<T>

Available on Completer<T>, provided by the ReadOnlyCompleterOnCompleterExtension extension

Creates ReadOnlyCompleter from this completer.
no setter
future Future<T>
Future of original completer.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isCompleted bool
Whether original completer is completed.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

complete([FutureOr<T>? value]) → void
Completes future with the supplied values.
override
completeError(Object error, [StackTrace? stackTrace]) → void
Complete future with an error.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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