UIProSwipeableTile.swipeToTrigger constructor

const UIProSwipeableTile.swipeToTrigger({
  1. required Key key,
  2. required Widget child,
  3. required BackgroundBuilder backgroundBuilder,
  4. required Color color,
  5. required SwipedCallback onSwiped,
  6. double swipeThreshold = 0.4,
  7. double borderRadius = 8.0,
  8. SwipeDirection direction = SwipeDirection.endToStart,
  9. Duration movementDuration = const Duration(milliseconds: 200),
  10. HitTestBehavior behavior = HitTestBehavior.opaque,
  11. bool isElevated = true,
})

Similar to UIProSwipeableTile but It doesn't allow dismiss instead you can swipe until swipeThreshold also doesn't have confirmSwipe, onSwiped, resizeDuration

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.swipeToTrigger({
  required Key key,
  required this.child,
  required this.backgroundBuilder,
  required this.color,
  required this.onSwiped,
  this.swipeThreshold = 0.4,
  this.borderRadius = 8.0,
  this.direction = SwipeDirection.endToStart,
  this.movementDuration = const Duration(milliseconds: 200),
  this.behavior = HitTestBehavior.opaque,
  this.isElevated = true,
})  : isCard = false,
      horizontalPadding = 0,
      verticalPadding = 1,
      confirmSwipe = null,
      // onSwiped = null,
      resizeDuration = null,
      swipeToTrigger = true,
      shadow = const BoxShadow(color: Colors.black),
      assert(swipeThreshold > 0.0 && swipeThreshold <= 0.5),
      super(key: key);