mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-24 20:22:27 +00:00
Refactor CommunityStructureCanvas to simplify DragTarget logic by replacing SizedBox with SizedBox.shrink() for better performance and readability.
This commit is contained in:
@ -425,18 +425,14 @@ class _CommunityStructureCanvasState extends State<CommunityStructureCanvas>
|
||||
height: _cardHeight,
|
||||
child: DragTarget<SpaceReorderDataModel>(
|
||||
builder: (context, candidateData, rejectedData) {
|
||||
if (_draggedData == null) {
|
||||
return const SizedBox();
|
||||
}
|
||||
if (_draggedData == null) return const SizedBox.shrink();
|
||||
|
||||
final isTargetForDragged = (_draggedData?.parent?.uuid == parent?.uuid &&
|
||||
_draggedData?.community == null) ||
|
||||
(_draggedData?.community?.uuid == community?.uuid &&
|
||||
_draggedData?.parent == null);
|
||||
|
||||
if (!isTargetForDragged) {
|
||||
return const SizedBox();
|
||||
}
|
||||
if (!isTargetForDragged) return const SizedBox.shrink();
|
||||
|
||||
return Container(
|
||||
width: 40,
|
||||
|
Reference in New Issue
Block a user