fixed hover issue

This commit is contained in:
hannathkadher
2024-11-23 15:37:37 +04:00
parent 1a967e2ba0
commit 12bf0f0b57

View File

@ -91,7 +91,6 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
@override
Widget build(BuildContext context) {
final visibleSpaces = flattenSpaces(spaces);
Size screenSize = MediaQuery.of(context).size;
return Expanded(
child: GestureDetector(
@ -111,7 +110,6 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
Flexible(
child: Stack(
children: [
if (visibleSpaces.isNotEmpty)
InteractiveViewer(
transformationController: _transformationController,
boundaryMargin: EdgeInsets.all(500),
@ -130,7 +128,8 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
: 0.3, // Adjust opacity
child: CustomPaint(painter: CurvedLinePainter([connection])),
),
for (var entry in visibleSpaces.asMap().entries)
for (var entry in spaces.asMap().entries)
if(entry.value.status != SpaceStatus.deleted)
Positioned(
left: entry.value.position.dx,
top: entry.value.position.dy,
@ -139,7 +138,7 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
onButtonTap: (int index, Offset newPosition, String direction) {
_showCreateSpaceDialog(
screenSize,
position: visibleSpaces[index].position + newPosition,
position: spaces[index].position + newPosition,
parentIndex: index,
direction: direction,
);
@ -153,20 +152,20 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
},
buildSpaceContainer: (int index) {
final bool isHighlighted =
_isHighlightedSpace(visibleSpaces[index]);
_isHighlightedSpace(spaces[index]);
return Opacity(
opacity: isHighlighted ? 1.0 : 0.3,
child: SpaceContainerWidget(
index: index,
onDoubleTap: () {
_showEditSpaceDialog(visibleSpaces[index]);
_showEditSpaceDialog(spaces[index]);
},
onTap: () {
_selectSpace(visibleSpaces[index]);
_selectSpace(spaces[index]);
},
icon: visibleSpaces[index].icon ?? '',
name: visibleSpaces[index].name,
icon: spaces[index].icon ?? '',
name: spaces[index].name,
));
},
),
@ -175,7 +174,7 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
),
),
),
if (visibleSpaces.isEmpty)
if (spaces.isEmpty)
Center(
child: AddSpaceButton(
onTap: () {