SwipeActionCell constructor

const SwipeActionCell({
  1. required Key key,
  2. required Widget child,
  3. List<SwipeAction>? trailingActions,
  4. List<SwipeAction>? leadingActions,
  5. bool isDraggable = true,
  6. bool closeWhenScrolling = true,
  7. bool firstActionWillCoverAllSpaceOnDeleting = true,
  8. SwipeActionController? controller,
  9. int? index,
  10. Widget selectedIndicator = const Icon(Icons.add_circle, color: Colors.blue),
  11. Widget unselectedIndicator = const Icon(Icons.do_not_disturb_on, color: Colors.red),
  12. Color? backgroundColor,
  13. double editModeOffset = 60,
  14. double fullSwipeFactor = 0.75,
  15. int deleteAnimationDuration = 400,
  16. int openAnimationDuration = 400,
  17. int closeAnimationDuration = 400,
  18. Curve openAnimationCurve = Curves.easeOutQuart,
  19. Curve closeAnimationCurve = Curves.easeOutQuart,
  20. Color? selectedForegroundColor,
})

About key / 关于key

You should put a key,like ValueKey or ObjectKey don't use GlobalKey or UniqueKey because that will make your app slow.

你应该在构造的时候放入key,推荐使用ValueKey 或者 ObjectKey 。 最好 不要 使用GlobalKeyUniqueKey。 我之前在内部也想使用GlobalKeyUniqueKey。 但是想到有性能问题,所以需要您从外部提供轻量级的key用于我框架内部判断,同时用于 flutter框架内部刷新。

Implementation

const SwipeActionCell({
  required Key key,
  required this.child,
  this.trailingActions,
  this.leadingActions,
  this.isDraggable = true,
  this.closeWhenScrolling = true,
  this.firstActionWillCoverAllSpaceOnDeleting = true,
  this.controller,
  this.index,
  this.selectedIndicator = const Icon(
    Icons.add_circle,
    color: Colors.blue,
  ),
  this.unselectedIndicator = const Icon(
    Icons.do_not_disturb_on,
    color: Colors.red,
  ),
  this.backgroundColor,
  this.editModeOffset = 60,
  this.fullSwipeFactor = 0.75,
  this.deleteAnimationDuration = 400,
  this.openAnimationDuration = 400,
  this.closeAnimationDuration = 400,
  this.openAnimationCurve = Curves.easeOutQuart,
  this.closeAnimationCurve = Curves.easeOutQuart,
  this.selectedForegroundColor,
}) : super(key: key);