SwipeActionCell constructor
const
SwipeActionCell({
- required Key key,
- required Widget child,
- List<
SwipeAction> ? trailingActions, - List<
SwipeAction> ? leadingActions, - bool isDraggable = true,
- bool closeWhenScrolling = true,
- bool firstActionWillCoverAllSpaceOnDeleting = true,
- SwipeActionController? controller,
- int? index,
- Widget selectedIndicator = const Icon(Icons.add_circle, color: Colors.blue),
- Widget unselectedIndicator = const Icon(Icons.do_not_disturb_on, color: Colors.red),
- Color? backgroundColor,
- double editModeOffset = 60,
- double fullSwipeFactor = 0.75,
- int deleteAnimationDuration = 400,
- int openAnimationDuration = 400,
- int closeAnimationDuration = 400,
- Curve openAnimationCurve = Curves.easeOutQuart,
- Curve closeAnimationCurve = Curves.easeOutQuart,
- 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 。 最好 不要 使用GlobalKey和UniqueKey。 我之前在内部也想使用GlobalKey 和 UniqueKey。 但是想到有性能问题,所以需要您从外部提供轻量级的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);