asFutureOrNull method

Future<T>? asFutureOrNull()

Returns this as a Future, or null if it's a synchronous value.

Implementation

@pragma('vm:prefer-inline')
Future<T>? asFutureOrNull() => isFuture ? this as Future<T> : null;