SwipeAction class
Constructors
- SwipeAction({required dynamic onTap(CompletionHandler ), String? title, TextStyle style = const TextStyle(fontSize: 18, color: Colors.white), Color color = Colors.red, Widget? icon, bool closeOnTap = true, double backgroundRadius = 0.0, bool forceAlignmentToBoundary = false, double widthSpace = 80, SwipeNestedAction? nestedAction, Widget? content, bool performsFirstActionWithFullSwipe = false})
-
const
Properties
- backgroundRadius → double
-
背景左上(右上)和左下(左上)的圆角
final
- closeOnTap → bool
-
close the actions button after you tap it,default value is true
点击这个按钮的时候,是否关闭actions 默认为true
final
- color → Color
-
bg color
背景颜色
final
- content → Widget?
-
If you want to customize your content,you can use this attr.
And don't set title and icon attrs
如果你想自定义你的按钮内容,那么就设置这个content参数
注意如果你设置了content,那么就不要设置title和icon,两个都必须为null
final
- forceAlignmentToBoundary → bool
-
When you have just one button,if it is on leading/trailing,set this param to true will
make the content inside button Alignment.centerRight / Alignment.centerLeft
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → Widget?
-
图标
final
- nestedAction → SwipeNestedAction?
-
嵌套的action
final
- onTap → dynamic Function(CompletionHandler )
-
onTap callback
点击事件回调
final
- performsFirstActionWithFullSwipe → bool
-
Tip:It is ok to set this property only in first action.
When drag cell a long distance,it will be dismissed,
and it will execute the onTap of the first SwipeAction
def value = false
这个属性设置给第一个action就好
就像iOS一样,往左拉满会直接删除一样,拉满后会执行第一个 SwipeAction 的onTap方法
默认为false
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → TextStyle
-
title's text Style
default value is :TextStyle(fontSize: 18,color: Colors.white)
标题的字体样式,默认值在上面
final
- title → String?
-
标题
final
- widthSpace → double
-
The width space this action button will take when opening.
当处于打开状态下这个按钮所占的宽度
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited