copyWith method
Returns a copy of this state with updated fields if provided.
Implementation
DeviceDetailsState copyWith({
List<models.Document>? allDevices,
List<models.Document>? filteredDevices,
bool? isLoading,
String? errorMessage,
DateTime? fromDate,
DateTime? tillDate,
String? searchQuery,
}) {
return DeviceDetailsState(
allDevices: allDevices ?? this.allDevices,
filteredDevices: filteredDevices ?? this.filteredDevices,
isLoading: isLoading ?? this.isLoading,
errorMessage: errorMessage ?? this.errorMessage,
fromDate: fromDate ?? this.fromDate,
tillDate: tillDate ?? this.tillDate,
searchQuery: searchQuery ?? this.searchQuery,
);
}