track<T> abstract method

Future<T> track<T>(
  1. FutureOr<T> operation(), {
  2. Object? id,
})

Runs operation while this scope owns an active operation.

If id is omitted, a unique identity is created for this invocation. Multiple concurrent tracked operations may share one id; each gets its own internal lease, so the id remains active until the last invocation ends. Errors are rethrown after the loading state is cleared.

Implementation

Future<T> track<T>(FutureOr<T> Function() operation, {Object? id});