SwipeActionCell class
@created by 文景睿 2020 年 7月13日
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SwipeActionCell
Constructors
-
SwipeActionCell.new({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 normalAnimationDuration = 400, Color? selectedForegroundColor}) -
const
Properties
- backgroundColor → Color?
-
Background color for cell and def value = Theme.of(context).scaffoldBackgroundColor)
整个cell控件的背景色 默认是Theme.of(context).scaffoldBackgroundColor
final
- child → Widget
-
Your content view
无需多言
final
- closeWhenScrolling → bool
-
Close actions When you scroll the ListView . default value = true
当你滚动(比如ListView之类的时候,这个item将会关闭拉出的actions,默认为true
final
- controller → SwipeActionController?
-
The controller to control edit mode
控制器
final
- deleteAnimationDuration → int
-
The animation duration of the delete animation.The unit is ms.
删除动画的执行时间。单位是毫秒
final
- editModeOffset → double
-
The offset that cell will move when entering the edit mode
当你进入编辑模式的时候,cell的content向右边移动的距离
def value = 60
final
- firstActionWillCoverAllSpaceOnDeleting → bool
-
When deleting the cell
the first action will cover all content size with animation.(emm.. just like iOS native effect)
def value = true
当删除的时候,第一个按钮会在删除动画执行的时候覆盖整个cell( 和iOS原生动画相似 )
默认为true
final
- fullSwipeFactor → double
-
The factor describing how far the cell need to be swiped, for swipe to be considered "full"
only valid when
performsFirstActionWithFullSwipe
= true 当拖动到cell宽度 * fullSwipeFactor 的这个距离时,将会触发第一个按钮的事件 注意:performsFirstActionWithFullSwipe
为true的时候此参数才有效 def value = 0.75final - hashCode → int
-
The hash code for this object.
no setterinherited
- index → int?
-
The identifier of edit mode
如果你想用编辑模式,这个参数必传!!! 它的值就是你列表的itemBuilder中的index,直接传进来即可
final
- isDraggable → bool
-
Indicates that you can swipe the cell or not
代表是否能够侧滑交互(如果你只想用编辑模式而不需要侧滑)
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
leadingActions
→ List<
SwipeAction> ? -
final
- normalAnimationDuration → int
-
The normal animation duration,such as open animation and close animation duration. The unit is ms
普通动画的执行时间,比如开启动画,关闭动画,单位是毫秒
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedForegroundColor → Color?
-
The foreground color showing when the cell is selected in edit mode,def value is Colors.black.withAlpha(30)
当选中cell的时候的一个前景蒙版颜色,默认为Colors.black.withAlpha(30)
final
- selectedIndicator → Widget
-
When use edit mode,if you select this row,you will see this indicator on the left of the cell.
(可以不传,有默认组件)当你进入编辑模式的时候,如果你选择了这一行,那么你将会在cell左边看到这个组件
final
-
trailingActions
→ List<
SwipeAction> ? -
final
- unselectedIndicator → Widget
-
It is contrary to selectedIndicator
(可以不传,有默认组件)和上面的相反,不说了
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → SwipeActionCellState -
About Key::::::
You should put a key,like ValueKey or ObjectKey
don't use GlobalKey or UniqueKey
because that will make your app slow.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited