mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-16 01:56:24 +00:00
fixed space select
This commit is contained in:
@ -19,8 +19,9 @@ import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
|
||||
class CommunityStructureArea extends StatefulWidget {
|
||||
final CommunityModel? selectedCommunity;
|
||||
final SpaceModel? selectedSpace;
|
||||
SpaceModel? selectedSpace;
|
||||
final List<ProductModel>? products;
|
||||
final ValueChanged<SpaceModel?>? onSpaceSelected;
|
||||
|
||||
final List<SpaceModel> spaces;
|
||||
final List<Connection> connections;
|
||||
@ -31,6 +32,7 @@ class CommunityStructureArea extends StatefulWidget {
|
||||
this.products,
|
||||
required this.spaces,
|
||||
required this.connections,
|
||||
this.onSpaceSelected,
|
||||
});
|
||||
|
||||
@override
|
||||
@ -150,7 +152,7 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
||||
onDoubleTap: () {
|
||||
_showEditSpaceDialog(visibleSpaces[index]);
|
||||
},
|
||||
onTap: (){
|
||||
onTap: () {
|
||||
_selectSpace(visibleSpaces[index]);
|
||||
},
|
||||
icon: visibleSpaces[index].icon ?? '',
|
||||
@ -559,8 +561,13 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
||||
..scale(1.2);
|
||||
}
|
||||
|
||||
void _selectSpace(SpaceModel space){
|
||||
print(space.name);
|
||||
}
|
||||
void _selectSpace(SpaceModel space) {
|
||||
setState(() {
|
||||
widget.selectedSpace = space;
|
||||
});
|
||||
|
||||
if (widget.onSpaceSelected != null) {
|
||||
widget.onSpaceSelected!(space);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user