snapshots abstract method

Future<void> snapshots(
  1. AsyncSnapshotListenerCallback<RESULT_TYPE, AsyncSnapshot<RESULT_TYPE>> listener, [
  2. VoidCallback? onFinally
])

Asynchronously executes a computation once with snapshots callbacks in parameters for the asynchronous computation that may fail into something that is safe to read.

This is useful to avoid having to do a tedious try/catch/then.

This is same as execute except that it will return a snapshot of the asynchronous computation's state.

Implementation

Future<void> snapshots(
  AsyncSnapshotListenerCallback<RESULT_TYPE, AsyncSnapshot<RESULT_TYPE>>
      listener, [
  VoidCallback? onFinally,
]);