go_flow library

Functions

asyncGoFlow<T>(ASyncDefferable<T> task) Future<T?>
This function sets up a context in which you can define actions to be executed when the current scope exits.
syncGoFlow<T>(SyncDefferable<T> task) → T?
This function sets up a context in which you can define actions to be executed when the current scope exits.

Typedefs

ASyncDefer<T> = FutureOr<T?> Function(GetterMethod<T> result, GenericGetterMethod recover)
Signature of AsyncDeffer that has two parameters a getter that returns result (result()) and recover parameter that returns exception of the given type (recover<type>())
ASyncDefferable<T> = FutureOr<T?> Function(void defer(ASyncDefer<T> ))
Signature of ASyncDefferable task that has a parameter: defer that can be used to schedule a task to be executed after scope exits
GenericGetterMethod = E? Function<E extends Object?>()
used as recovery method to indicate what kind of error to recover from
GetterMethod<E extends Object?> = E? Function()
Simple getter method that returns E
SyncDefer<T> = T? Function(GetterMethod<T> result, GenericGetterMethod recover)
Signature of SyncDeffer that has two parameters a getter that returns result (result()) and recover parameter that returns exception of the given type (recover<type>())
SyncDefferable<T> = T? Function(void defer(SyncDefer<T> ))
Signature of SyncDefferable task that has a parameter: defer that can be used to schedule a task to be executed after scope exits

Exceptions / Errors

Panic
An Unhandled exception that did not get caught inside a deffer statement