copyWith method

EntityState copyWith({
  1. bool? isFetching,
  2. DateTime? lastFetched,
  3. String? error,
  4. bool? stale,
  5. bool clearError = false,
})

Implementation

EntityState copyWith({
  bool? isFetching,
  DateTime? lastFetched,
  String? error,
  bool? stale,
  bool clearError = false,
}) => EntityState(
  isFetching: isFetching ?? this.isFetching,
  lastFetched: lastFetched ?? this.lastFetched,
  error: clearError ? null : (error ?? this.error),
  stale: stale ?? this.stale,
);