Files
sendico/frontend/pshared/lib/provider/resource.dart
2025-11-13 15:06:15 +03:00

16 lines
369 B
Dart

class Resource<T> {
final T? data;
final bool isLoading;
final Exception? error;
Resource({this.data, this.isLoading = false, this.error});
Resource<T> copyWith({T? data, bool? isLoading, Exception? error}) {
return Resource<T>(
data: data ?? this.data,
isLoading: isLoading ?? this.isLoading,
error: error ?? this.error,
);
}
}