push add ac fucntions and handle doplicate adding to the then or if items

This commit is contained in:
ashrafzarkanisala
2024-11-19 00:54:43 +03:00
parent 54143b3ba9
commit 57b8f6b03e
60 changed files with 1392 additions and 24 deletions

View File

@ -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) {