WFormCheckbox class

单个复选框字段组件

Inheritance
Available extensions

Constructors

WFormCheckbox({Key? key, required WFormCheckboxConfig config, required String name, required Widget? title, bool initialValue = false, ValueChanged<bool?>? onChanged})
创建单个复选框字段

Properties

autovalidateMode AutovalidateMode
Used to enable/disable this form field auto validation and update its error text.
finalinherited
builder FormFieldBuilder<bool>
Function that returns the widget representing this form field.
finalinherited
config WFormCheckboxConfig
复选框配置
final
enabled bool
Whether the form is able to receive user input.
finalinherited
errorBuilder FormFieldErrorBuilder?
Function that returns the widget representing the error to display.
finalinherited
focusNode FocusNode?
An optional focus node to use as the focus node for this widget.
finalinherited
forceErrorText String?
An optional property that forces the FormFieldState into an error state by directly setting the FormFieldState.errorText property without running the validator function.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
initialValue bool?
An optional value to initialize the form field to, or null otherwise.
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
name String
Used to reference the field within the form, or to reference form data after the form is submitted.
finalinherited
notificationListener WNotificationListener<Notification>

Available on Widget, provided by the WNotificationListenerExtension extension

创建 WNotificationListener 实例
no setter
onChanged ValueChanged<bool?>?
Called when the field value is changed.
finalinherited
onReset VoidCallback?
An optional method to call when the form field is reset via FormFieldState.reset.
finalinherited
onSaved ValueChanged<bool?>?
An optional method to call with the final value when the form is saved via FormState.save.
finalinherited
restorationId String?
Restoration ID to save and restore the state of the form field.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title Widget?
标题 widget
final
validator FormFieldValidator<bool>?
An optional method that validates an input. Returns an error string to display if the input is invalid, or null otherwise.
finalinherited
valueTransformer → ValueTransformer<bool?>?
Called just before field value is saved. Used to massage data just before committing the value.
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → FormBuilderFieldState<WFormCheckbox, bool>
Creates the mutable state for this widget at a given location in the tree.
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
expanded([int flex = 1]) Widget

Available on Widget, provided by the WidgetExtension extension

将 Widget 包装在 Expanded 中
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toButton({GestureTapCallback? onTap, GestureLongPressCallback? onLongPress, WButtonConfig? config}) Widget

Available on Widget, provided by the WidgetExtension extension

将 Widget 包装在 WButton 中
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
withBottomPadding(double padding) Widget

Available on Widget, provided by the WidgetExtension extension

添加底部 padding
withBottomSafeSpace() Widget

Available on Widget, provided by the WidgetExtension extension

添加底部安全空间(适配底部导航栏)
withBottomSpace(double height) Widget

Available on Widget, provided by the WidgetExtension extension

添加自定义底部空间
withContainer(WContainerConfig config) Widget

Available on Widget, provided by the WidgetExtension extension

将 Widget 包装在 Container 中
withHorizontalPadding(double padding) Widget

Available on Widget, provided by the WidgetExtension extension

添加水平 padding
withLeftPadding(double padding) Widget

Available on Widget, provided by the WidgetExtension extension

添加左侧 padding
withRightPadding(double padding) Widget

Available on Widget, provided by the WidgetExtension extension

添加右侧 padding
withTopPadding(double padding) Widget

Available on Widget, provided by the WidgetExtension extension

添加顶部 padding
withTopSafeSpace() Widget

Available on Widget, provided by the WidgetExtension extension

添加顶部安全空间(适配状态栏)
withVerticalPadding(double padding) Widget

Available on Widget, provided by the WidgetExtension extension

添加垂直 padding

Operators

operator ==(Object other) bool
The equality operator.
inherited