mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Fetch devices based on selection
This commit is contained in:
@ -11,7 +11,8 @@ import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/style.dart';
|
||||
|
||||
class SpaceTreeView extends StatelessWidget {
|
||||
const SpaceTreeView({super.key});
|
||||
final Function onSelect;
|
||||
const SpaceTreeView({required this.onSelect, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -64,6 +65,8 @@ class SpaceTreeView extends StatelessWidget {
|
||||
onItemSelected: () {
|
||||
context.read<SpaceTreeBloc>().add(
|
||||
OnCommunitySelected(community.uuid, community.spaces));
|
||||
|
||||
onSelect();
|
||||
},
|
||||
children: community.spaces.map((space) {
|
||||
return CustomExpansionTileSpaceTree(
|
||||
@ -76,6 +79,7 @@ class SpaceTreeView extends StatelessWidget {
|
||||
onExpansionChanged: () {
|
||||
context.read<SpaceTreeBloc>().add(
|
||||
OnSpaceExpanded(community.uuid, space.uuid ?? ''));
|
||||
onSelect();
|
||||
},
|
||||
isSelected: state.selectedSpaces.contains(space.uuid) ||
|
||||
state.soldCheck.contains(space.uuid),
|
||||
@ -109,6 +113,7 @@ class SpaceTreeView extends StatelessWidget {
|
||||
context
|
||||
.read<SpaceTreeBloc>()
|
||||
.add(OnSpaceSelected(communityId, child.uuid ?? '', child.children));
|
||||
onSelect();
|
||||
},
|
||||
onExpansionChanged: () {
|
||||
context.read<SpaceTreeBloc>().add(OnSpaceExpanded(communityId, child.uuid ?? ''));
|
||||
|
Reference in New Issue
Block a user