copyWith method
Returns a new state with overridden fields.
Implementation
WsDbState<T> copyWith({
bool? loading,
String? docId,
Object? doc = _u, // <— usa Object para sentinel
Object? error = _u,
bool? isWatching,
}) {
return WsDbState<T>(
loading: loading ?? this.loading,
docId: docId ?? this.docId,
isWatching: isWatching ?? this.isWatching,
doc: doc == _u ? this.doc : doc as T?,
error: error == _u ? this.error : error as ErrorItem?,
);
}