copyWith method

DeviceDetailsState copyWith({
  1. List<Document>? allDevices,
  2. List<Document>? filteredDevices,
  3. bool? isLoading,
  4. String? errorMessage,
  5. DateTime? fromDate,
  6. DateTime? tillDate,
  7. String? searchQuery,
})

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,
  );
}