copyWith method
Create a copy of this state with updated fields (Requirement 1.4)
This method enables immutable state updates by creating a new instance with only the specified fields changed.
Implementation
GroupsLoaded copyWith({
List<Group>? groups,
bool? hasMore,
bool? isLoadingMore,
Set<String>? selectedGroups,
String? searchKeyword,
}) {
return GroupsLoaded(
groups: groups ?? this.groups,
hasMore: hasMore ?? this.hasMore,
isLoadingMore: isLoadingMore ?? this.isLoadingMore,
selectedGroups: selectedGroups ?? this.selectedGroups,
searchKeyword: searchKeyword ?? this.searchKeyword,
);
}