removed center

This commit is contained in:
hannathkadher
2024-10-09 12:37:59 +04:00
parent d423552ddf
commit 5ef614f1e1

View File

@ -174,58 +174,54 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
size: Size(2000, 2000), // Explicit canvas size
painter: CurvedLinePainter(connections),
),
Center(
child: spaces.isEmpty
? AddSpaceButton(
onTap: () {
_showCreateSpaceDialog(screenSize);
},
)
: Stack(
children: spaces
.asMap()
.entries
.map((entry) => SpaceCardWidget(
index: entry.key,
screenSize: screenSize,
position: spaces[entry.key].position,
isHovered:
spaces[entry.key].isHovered,
onPanUpdate:
(int index, Offset delta) {
setState(() {
spaces[index].position += delta;
});
},
onHoverChanged:
(int index, bool isHovered) {
setState(() {
spaces[index].isHovered =
isHovered;
});
},
onButtonTap: (int index,
Offset newPosition,
String direction) {
_showCreateSpaceDialog(
screenSize,
position: spaces[index].position +
newPosition,
parentIndex: index,
direction: direction,
);
},
buildSpaceContainer: (int index) {
return SpaceContainerWidget(
index: index,
icon: spaces[index].icon,
name: spaces[index].name,
);
},
))
.toList(),
),
),
spaces.isEmpty
? AddSpaceButton(
onTap: () {
_showCreateSpaceDialog(screenSize);
},
)
: Stack(
children: spaces
.asMap()
.entries
.map((entry) => SpaceCardWidget(
index: entry.key,
screenSize: screenSize,
position: spaces[entry.key].position,
isHovered: spaces[entry.key].isHovered,
onPanUpdate: (int index, Offset delta) {
setState(() {
spaces[index].position += delta;
});
},
onHoverChanged:
(int index, bool isHovered) {
setState(() {
spaces[index].isHovered = isHovered;
});
},
onButtonTap: (int index,
Offset newPosition,
String direction) {
_showCreateSpaceDialog(
screenSize,
position: spaces[index].position +
newPosition,
parentIndex: index,
direction: direction,
);
},
buildSpaceContainer: (int index) {
return SpaceContainerWidget(
index: index,
icon: spaces[index].icon,
name: spaces[index].name,
);
},
))
.toList(),
),
],
),
),