removed space create button out of interactive viewer

This commit is contained in:
hannathkadher
2024-11-15 00:46:24 +04:00
parent de57e0f21d
commit 1d9a93646b

View File

@ -39,7 +39,10 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
children: [
_buildHeader(),
Flexible(
child: InteractiveViewer(
child: Stack(
children: [
if (spaces.isNotEmpty)
InteractiveViewer(
boundaryMargin: EdgeInsets.all(500),
minScale: 0.5,
maxScale: 3.0,
@ -47,15 +50,7 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
child: Container(
width: canvasWidth,
height: canvasHeight,
child: spaces.isEmpty
? Center(
child: AddSpaceButton(
onTap: () {
_showCreateSpaceDialog(screenSize);
},
),
)
: Stack(
child: Stack(
children: [
for (var connection in connections)
CustomPaint(
@ -81,8 +76,7 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
screenSize: screenSize,
onHoverChanged: _handleHoverChanged,
onPositionChanged: (newPosition) {
_updateNodePosition(
entry.value, newPosition);
_updateNodePosition(entry.value, newPosition);
},
buildSpaceContainer: (int index) {
return SpaceContainerWidget(
@ -97,7 +91,16 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
),
),
),
if (spaces.isEmpty)
Center(
child: AddSpaceButton(
onTap: () {
_showCreateSpaceDialog(screenSize);
},
),
),
],
)),
],
),
),
@ -182,7 +185,7 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
Offset(
screenSize.width / 2 - 75, // Center horizontally
screenSize.height / 2 -
100, // Slightly above the center vertically
50, // Slightly above the center vertically
);
SpaceData newSpace =