Merge branch 'dev' into link_space_model_spaces

This commit is contained in:
mohammad
2025-03-06 11:50:21 +03:00
82 changed files with 2484 additions and 813 deletions

View File

@ -172,11 +172,8 @@ class _SpaceTreeViewState extends State<SpaceTreeView> {
.expandedSpaces
.contains(space.uuid),
onItemSelected: () {
context
.read<SpaceTreeBloc>()
.add(OnSpaceSelected(
community.uuid,
space.uuid ?? '',
context.read<SpaceTreeBloc>().add(
OnSpaceSelected(community, space.uuid ?? '',
space.children));
widget.onSelect();
},
@ -196,10 +193,7 @@ class _SpaceTreeViewState extends State<SpaceTreeView> {
isSoldCheck: state.soldCheck
.contains(space.uuid),
children: _buildNestedSpaces(
context,
state,
space,
community.uuid),
context, state, space, community),
);
}).toList(),
),
@ -281,8 +275,8 @@ class _SpaceTreeViewState extends State<SpaceTreeView> {
});
}
List<Widget> _buildNestedSpaces(BuildContext context, SpaceTreeState state,
SpaceModel space, String communityId) {
List<Widget> _buildNestedSpaces(
BuildContext context, SpaceTreeState state, SpaceModel space, CommunityModel community) {
return space.children.map((child) {
return CustomExpansionTileSpaceTree(
isSelected: state.selectedSpaces.contains(child.uuid) ||
@ -291,16 +285,15 @@ class _SpaceTreeViewState extends State<SpaceTreeView> {
title: child.name,
isExpanded: state.expandedSpaces.contains(child.uuid),
onItemSelected: () {
context.read<SpaceTreeBloc>().add(
OnSpaceSelected(communityId, child.uuid ?? '', child.children));
context
.read<SpaceTreeBloc>()
.add(OnSpaceSelected(community, child.uuid ?? '', child.children));
widget.onSelect();
},
onExpansionChanged: () {
context
.read<SpaceTreeBloc>()
.add(OnSpaceExpanded(communityId, child.uuid ?? ''));
context.read<SpaceTreeBloc>().add(OnSpaceExpanded(community.uuid, child.uuid ?? ''));
},
children: _buildNestedSpaces(context, state, child, communityId),
children: _buildNestedSpaces(context, state, child, community),
);
}).toList();
}