UIProSwipeableTile.swipeToTriggerCard constructor

const UIProSwipeableTile.swipeToTriggerCard({
  1. required Key key,
  2. required Widget child,
  3. required BackgroundBuilder backgroundBuilder,
  4. required double horizontalPadding,
  5. required double verticalPadding,
  6. required BoxShadow shadow,
  7. required Color color,
  8. required SwipedCallback onSwiped,
  9. double borderRadius = 16,
  10. double swipeThreshold = 0.4,
  11. SwipeDirection direction = SwipeDirection.endToStart,
  12. Duration movementDuration = const Duration(milliseconds: 200),
  13. HitTestBehavior behavior = HitTestBehavior.opaque,
})

Similar to UIProSwipeableTile.swipeToTrigger with additional card effet like, rounded corner, padding and elevation.

The key argument must not be null because UIProSwipeableTiles are commonly used in lists and removed from the list when swiped. Without keys, the default behavior is to sync widgets based on their index in the list, which means the item after the swiped item would be synced with the state of the swiped item. Using keys causes the widgets to sync according to their keys and avoids this pitfall.

Implementation

const UIProSwipeableTile.swipeToTriggerCard({
  required Key key,
  required this.child,
  required this.backgroundBuilder,
  required this.horizontalPadding,
  required this.verticalPadding,
  required this.shadow,
  required this.color,
  required this.onSwiped,
  this.borderRadius = 16,
  this.swipeThreshold = 0.4,
  this.direction = SwipeDirection.endToStart,
  this.movementDuration = const Duration(milliseconds: 200),
  this.behavior = HitTestBehavior.opaque,
})  : isCard = true,
      swipeToTrigger = true,
      confirmSwipe = null,
      isElevated = false,
      resizeDuration = null,
      assert(swipeThreshold > 0.0 && swipeThreshold <= 0.5),
      super(key: key);