withFallback method

Future<T> withFallback(
  1. T fallback
)

Returns fallback if this future throws any error.

riskyOperation().withFallback(defaultValue)

Implementation

Future<T> withFallback(T fallback) => catchError((Object _) => fallback);