Future<R> then<R>( FutureOr<R> Function(T) onValue, { Function? onError, }) => Future.value(this).then(onValue, onError: onError);