mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
push add ac fucntions and handle doplicate adding to the then or if items
This commit is contained in:
@ -10,24 +10,32 @@ class DraggableCard extends StatelessWidget {
|
||||
required this.title,
|
||||
this.titleColor,
|
||||
this.isDragged = false,
|
||||
this.isDisabled = false,
|
||||
});
|
||||
|
||||
final String imagePath;
|
||||
final String title;
|
||||
final Color? titleColor;
|
||||
final bool isDragged;
|
||||
final bool isDisabled;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Draggable<Map<String, String>>(
|
||||
Widget card = Draggable<Map<String, String>>(
|
||||
data: {'key': UniqueKey().toString(), 'imagePath': imagePath, 'title': title},
|
||||
feedback: Transform.rotate(
|
||||
angle: -0.1,
|
||||
child: _buildCardContent(context),
|
||||
),
|
||||
childWhenDragging: _buildGreyContainer(),
|
||||
child: isDragged ? _buildGreyContainer() : _buildCardContent(context),
|
||||
child: _buildCardContent(context),
|
||||
);
|
||||
|
||||
if (isDisabled) {
|
||||
card = AbsorbPointer(child: card);
|
||||
}
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
Widget _buildCardContent(BuildContext context) {
|
||||
|
Reference in New Issue
Block a user