mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
76 lines
2.6 KiB
Dart
76 lines
2.6 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/community_model.dart';
|
|
|
|
class SpaceTreeState extends Equatable {
|
|
final Map<String, List<String>> selectedCommunityAndSpaces;
|
|
final List<CommunityModel> communityList;
|
|
final List<CommunityModel> filteredCommunity;
|
|
final List<String> expandedCommunities;
|
|
final List<String> expandedSpaces;
|
|
final List<String> selectedCommunities;
|
|
final List<String> selectedSpaces;
|
|
final List<String> soldCheck;
|
|
final bool isSearching;
|
|
final String searchQuery;
|
|
|
|
const SpaceTreeState(
|
|
{this.communityList = const [],
|
|
this.filteredCommunity = const [],
|
|
this.expandedCommunities = const [],
|
|
this.expandedSpaces = const [],
|
|
this.selectedCommunities = const [],
|
|
this.selectedSpaces = const [],
|
|
this.soldCheck = const [],
|
|
this.isSearching = false,
|
|
this.selectedCommunityAndSpaces = const {},
|
|
this.searchQuery = ''});
|
|
|
|
SpaceTreeState copyWith(
|
|
{List<CommunityModel>? communitiesList,
|
|
List<CommunityModel>? filteredCommunity,
|
|
List<String>? expandedSpaces,
|
|
List<String>? expandedCommunity,
|
|
List<String>? selectedCommunities,
|
|
List<String>? selectedSpaces,
|
|
List<String>? soldCheck,
|
|
bool? isSearching,
|
|
Map<String, List<String>>? selectedCommunityAndSpaces,
|
|
String? searchQuery}) {
|
|
return SpaceTreeState(
|
|
communityList: communitiesList ?? this.communityList,
|
|
filteredCommunity: filteredCommunity ?? this.filteredCommunity,
|
|
expandedSpaces: expandedSpaces ?? this.expandedSpaces,
|
|
expandedCommunities: expandedCommunity ?? this.expandedCommunities,
|
|
selectedCommunities: selectedCommunities ?? this.selectedCommunities,
|
|
selectedSpaces: selectedSpaces ?? this.selectedSpaces,
|
|
soldCheck: soldCheck ?? this.soldCheck,
|
|
isSearching: isSearching ?? this.isSearching,
|
|
selectedCommunityAndSpaces: selectedCommunityAndSpaces ?? this.selectedCommunityAndSpaces,
|
|
searchQuery: searchQuery ?? this.searchQuery);
|
|
}
|
|
|
|
@override
|
|
List<Object?> get props => [
|
|
communityList,
|
|
filteredCommunity,
|
|
expandedSpaces,
|
|
expandedCommunities,
|
|
selectedCommunities,
|
|
selectedSpaces,
|
|
soldCheck,
|
|
isSearching,
|
|
selectedCommunityAndSpaces,
|
|
searchQuery
|
|
];
|
|
}
|
|
|
|
class SpaceTreeLoadingState extends SpaceTreeState {}
|
|
|
|
class SpaceTreeErrorState extends SpaceTreeState {
|
|
final String message;
|
|
const SpaceTreeErrorState(this.message);
|
|
|
|
@override
|
|
List<Object?> get props => [message];
|
|
}
|