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