VCountDownBtn class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- VCountDownBtn
Constructors
-
VCountDownBtn({Key? key, Future<
bool> onSend()?, int duration = 60, String idleText = '获取验证码', String finishedText = '重新发送', String countdownTextBuilder(int seconds)?, VoidCallback? onCountdownFinish, AccountValidateType? accountType, String accountGetter()?, void onValidateFailed(String message)?, String? customValidator()?, VButtonType type = VButtonType.primary, Color? color, String? bgColor, String? textColor, Gradient? gradient, bool round = false, bool block = false, double? width, double? height, double? fontSize, EdgeInsets? padding, EdgeInsets margin = EdgeInsets.zero, BorderRadius? radius, TextStyle? textStyle}) -
const
Properties
- accountGetter → String Function()?
-
获取当前账号值的回调(如从 TextEditingController 取值)
final
- accountType → AccountValidateType?
-
账号校验类型,为 null 时不校验
final
- bgColor → String?
-
final
- block → bool
-
final
- color → Color?
-
final
- countdownTextBuilder → String Function(int seconds)?
-
倒计时文案构建器,参数为剩余秒数
final
- customValidator → String? Function()?
-
自定义校验器,accountType 为 custom 时生效
返回 null 表示校验通过,返回字符串表示校验失败的提示信息
final
- duration → int
-
倒计时总秒数,默认 60
final
- finishedText → String
-
倒计时结束后的按钮文案(区别于首次的 idleText)
final
- fontSize → double?
-
final
- gradient → Gradient?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
final
- idleText → String
-
空闲态按钮文案
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- margin → EdgeInsets
-
final
- onCountdownFinish → VoidCallback?
-
倒计时结束回调
final
-
onSend
→ Future<
bool> Function()? -
点击发送验证码的回调,返回 true 表示发送成功开始倒计时
final
- onValidateFailed → void Function(String message)?
-
校验失败时的回调,参数为错误提示文案(调用方可用于弹 toast)
final
- padding → EdgeInsets?
-
final
- radius → BorderRadius?
-
final
- round → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textColor → String?
-
final
- textStyle → TextStyle?
-
final
- type → VButtonType
-
final
- width → double?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< VCountDownBtn> -
Creates the mutable state for this widget at a given location in the tree.
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