mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 08:46:18 +01:00
Remove padding from Draggable
This commit is contained in:
parent
b871fdf49b
commit
d73fd18294
2 changed files with 25 additions and 24 deletions
|
@ -113,9 +113,13 @@ class _EditContentList extends StatelessWidget {
|
|||
.getThumbSize(zoomLevel.requireData)
|
||||
.toDouble(),
|
||||
items: state.editTransformedItems ?? state.transformedItems,
|
||||
itemBuilder: (context, _, item) => item.buildWidget(context),
|
||||
itemBuilder: (context, _, item) => Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: item.buildWidget(context),
|
||||
),
|
||||
itemDragFeedbackBuilder: (context, _, item) =>
|
||||
item.buildDragFeedbackWidget(context),
|
||||
item.buildDragFeedbackWidget(context) ??
|
||||
item.buildWidget(context),
|
||||
staggeredTileBuilder: (_, item) => item.staggeredTile,
|
||||
onDragResult: (results) {
|
||||
context.addEvent(_EditManualSort(results));
|
||||
|
|
|
@ -41,32 +41,29 @@ class Draggable<T extends Object> extends StatelessWidget {
|
|||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: LongPressDraggable<T>(
|
||||
data: data,
|
||||
dragAnchorStrategy: pointerDragAnchorStrategy,
|
||||
onDragStarted: onDragStarted,
|
||||
onDragEnd: (_) => onDragEndedAny?.call(),
|
||||
onDragCompleted: onDragEndedAny,
|
||||
onDraggableCanceled: (v, o) => onDragEndedAny?.call(),
|
||||
feedback: FractionalTranslation(
|
||||
translation: const Offset(-.5, -.5),
|
||||
child: SizedBox(
|
||||
width: feedbackSize?.width ?? 128,
|
||||
height: feedbackSize?.height ?? 128,
|
||||
child: Opacity(
|
||||
opacity: .5,
|
||||
child: feedback ?? child,
|
||||
),
|
||||
LongPressDraggable<T>(
|
||||
data: data,
|
||||
dragAnchorStrategy: pointerDragAnchorStrategy,
|
||||
onDragStarted: onDragStarted,
|
||||
onDragEnd: (_) => onDragEndedAny?.call(),
|
||||
onDragCompleted: onDragEndedAny,
|
||||
onDraggableCanceled: (v, o) => onDragEndedAny?.call(),
|
||||
feedback: FractionalTranslation(
|
||||
translation: const Offset(-.5, -.5),
|
||||
child: SizedBox(
|
||||
width: feedbackSize?.width ?? 128,
|
||||
height: feedbackSize?.height ?? 128,
|
||||
child: Opacity(
|
||||
opacity: .5,
|
||||
child: feedback ?? child,
|
||||
),
|
||||
),
|
||||
childWhenDragging: Opacity(
|
||||
opacity: .25,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
childWhenDragging: Opacity(
|
||||
opacity: .25,
|
||||
child: child,
|
||||
),
|
||||
child: child,
|
||||
),
|
||||
if (onDropBefore != null || onDropAfter != null)
|
||||
Positioned.fill(
|
||||
|
|
Loading…
Reference in a new issue