map<U> method

LoadResult<U> map<U>(
  1. U mapper(
    1. T
    )
)

Map the value to a different type.

Implementation

LoadResult<U> map<U>(U Function(T) mapper) {
  if (!success || value == null) {
    return LoadResult<U>(
      success: success,
      error: error,
      warnings: warnings,
      metadata: metadata,
    );
  }
  return LoadResult<U>(
    value: mapper(value as T),
    success: true,
    warnings: warnings,
    metadata: metadata,
  );
}