PPTextField class
自定义文本输入框组件
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- PPTextField
Constructors
- PPTextField({Key? key, required TextEditingController controller, required String labelText, TextStyle labelStyle = const TextStyle(color: Colors.grey, fontSize: 18), Color fillColor = const Color(0xFFEEEEEE), double borderRadius = 12.0, BorderSide borderSide = BorderSide.none, BorderSide focusedBorderSide = const BorderSide(color: Colors.blue, width: 1.0), BorderSide errorBorderSide = const BorderSide(color: Colors.red, width: 1.0), Color clearColor = const Color(0xFFBDBDBD), int maxLength = 50, bool showCounter = false})
-
const
Properties
- borderRadius → double
-
文本输入框的圆角半径
final
- borderSide → BorderSide
-
文本输入框的边框样式
final
- clearColor → Color
-
取消按钮的颜色
final
- controller → TextEditingController
-
文本控制器,用于获取和设置文本输入框的内容
final
- errorBorderSide → BorderSide
-
错误时的边框样式
final
- fillColor → Color
-
文本输入框的背景颜色
final
- focusedBorderSide → BorderSide
-
聚焦时的边框样式
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- labelStyle → TextStyle
-
标签文本的样式
final
- labelText → String
-
标签文本,用于显示在文本输入框上方
final
- maxLength → int
-
最大输入长度
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showCounter → bool
-
是否显示计数器
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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