createFutureProperty<T> method
Creates a FutureProperty and adds a listener.
listener
is the listener to add. If listener is null, Model.notifyListeners is used.
Requires the late
keyword when used during initialization:
late final counter = createFutureProperty
If a property is required with no initial listeners, instantiate a Property instead:
final counter = Property
Implementation
FutureProperty<T> createFutureProperty<T>(Future<T> initialValue,
{VoidCallback? listener}) {
final futureProperty = FutureProperty<T>(initialValue);
futureProperty.addListener(listener ?? notifyListeners);
return futureProperty;
}