mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-15 01:35:25 +00:00
fixing canvas issue
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'plus_button_widget.dart'; // Make sure to import your PlusButtonWidget
|
||||
|
||||
class SpaceCardWidget extends StatelessWidget {
|
||||
@ -26,52 +25,48 @@ class SpaceCardWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Positioned(
|
||||
left: position.dx,
|
||||
top: position.dy,
|
||||
child: GestureDetector(
|
||||
onPanUpdate: (details) {
|
||||
// Call the provided callback to update the position
|
||||
onPanUpdate(index, details.delta);
|
||||
return GestureDetector(
|
||||
onPanUpdate: (details) {
|
||||
// Call the provided callback to update the position
|
||||
onPanUpdate(index, details.delta);
|
||||
},
|
||||
child: MouseRegion(
|
||||
onEnter: (_) {
|
||||
// Call the provided callback to handle hover state
|
||||
onHoverChanged(index, true);
|
||||
},
|
||||
child: MouseRegion(
|
||||
onEnter: (_) {
|
||||
// Call the provided callback to handle hover state
|
||||
onHoverChanged(index, true);
|
||||
},
|
||||
onExit: (_) {
|
||||
// Call the provided callback to handle hover state
|
||||
onHoverChanged(index, false);
|
||||
},
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
buildSpaceContainer(index), // Build the space container
|
||||
if (isHovered) ...[
|
||||
PlusButtonWidget(
|
||||
index: index,
|
||||
direction: 'left',
|
||||
offset: const Offset(-21, 20),
|
||||
screenSize: screenSize,
|
||||
onButtonTap: onButtonTap,
|
||||
),
|
||||
PlusButtonWidget(
|
||||
index: index,
|
||||
direction: 'right',
|
||||
offset: const Offset(140, 20),
|
||||
screenSize: screenSize,
|
||||
onButtonTap: onButtonTap,
|
||||
),
|
||||
PlusButtonWidget(
|
||||
index: index,
|
||||
direction: 'down',
|
||||
offset: const Offset(63, 50),
|
||||
screenSize: screenSize,
|
||||
onButtonTap: onButtonTap,
|
||||
),
|
||||
],
|
||||
onExit: (_) {
|
||||
// Call the provided callback to handle hover state
|
||||
onHoverChanged(index, false);
|
||||
},
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none, // Allow hovering elements to be displayed outside the boundary
|
||||
children: [
|
||||
buildSpaceContainer(index), // Build the space container
|
||||
if (isHovered) ...[
|
||||
PlusButtonWidget(
|
||||
index: index,
|
||||
direction: 'left',
|
||||
offset: const Offset(-21, 20),
|
||||
screenSize: screenSize,
|
||||
onButtonTap: onButtonTap,
|
||||
),
|
||||
PlusButtonWidget(
|
||||
index: index,
|
||||
direction: 'right',
|
||||
offset: const Offset(140, 20),
|
||||
screenSize: screenSize,
|
||||
onButtonTap: onButtonTap,
|
||||
),
|
||||
PlusButtonWidget(
|
||||
index: index,
|
||||
direction: 'down',
|
||||
offset: const Offset(63, 50),
|
||||
screenSize: screenSize,
|
||||
onButtonTap: onButtonTap,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
Reference in New Issue
Block a user