copyWith method

CommonState copyWith({
  1. Map<String, bool>? loadingStates,
})

Creates a copy of this state with the given fields replaced with new values.

Parameters:

  • loadingStates: The new loading states map. If null, keeps the current value.

Returns a new CommonState instance with updated values.

Implementation

CommonState copyWith({Map<String, bool>? loadingStates}) {
  return CommonState(loadingStates: loadingStates ?? this.loadingStates);
}