UIProSwipeableTile.card constructor
const
UIProSwipeableTile.card({
- required Key key,
- required Widget child,
- required BackgroundBuilder backgroundBuilder,
- required double horizontalPadding,
- required double verticalPadding,
- required BoxShadow shadow,
- required Color color,
- required SwipedCallback onSwiped,
- double borderRadius = 16,
- double swipeThreshold = 0.4,
- ConfirmSwipeCallback? confirmSwipe,
- SwipeDirection direction = SwipeDirection.endToStart,
- Duration? resizeDuration = const Duration(milliseconds: 300),
- Duration movementDuration = const Duration(milliseconds: 200),
- HitTestBehavior behavior = HitTestBehavior.opaque,
Similar to normal UIProSwipeableTile 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.card({
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.confirmSwipe,
this.direction = SwipeDirection.endToStart,
this.resizeDuration = const Duration(milliseconds: 300),
this.movementDuration = const Duration(milliseconds: 200),
this.behavior = HitTestBehavior.opaque,
}) : isCard = true,
swipeToTrigger = false,
isElevated = false,
assert(swipeThreshold > 0.0 && swipeThreshold < 1.0),
super(key: key);