Quotation

This commit is contained in:
Arseni
2026-01-21 21:52:36 +03:00
parent 1e5ff51e07
commit 6284625977
40 changed files with 1085 additions and 346 deletions

View File

@@ -5,11 +5,14 @@ class Resource<T> {
Resource({this.data, this.isLoading = false, this.error});
Resource<T> copyWith({T? data, bool? isLoading, Exception? error}) {
static const _unset = Object();
Resource<T> copyWith({T? data, bool? isLoading, Object? error = _unset}) {
return Resource<T>(
data: data ?? this.data,
isLoading: isLoading ?? this.isLoading,
error: error ?? this.error,
// Distinguish "not provided" from an explicit null to allow clearing error.
error: error == _unset ? this.error : error as Exception?,
);
}
}