LGTextField class
A beautiful glass morphism text field inspired by Apple's input design.
LGTextField provides a text input field with elegant liquid glass effects, matching iOS design patterns. Supports both grouped mode (sharing glass settings with other elements) and standalone mode (with its own independent glass layer). Includes support for prefix/suffix icons, multiline input, and full customization of styling and behavior.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- LGTextField
Constructors
-
LGTextField({Key? key, TextEditingController? controller, FocusNode? focusNode, String? placeholder, Widget? prefixIcon, Widget? suffixIcon, VoidCallback? onSuffixTap, bool obscureText = false, TextInputType? keyboardType, TextInputAction? textInputAction, int maxLines = 1, int? minLines, int? maxLength, bool enabled = true, bool readOnly = false, bool autofocus = false, ValueChanged<
String> ? onChanged, ValueChanged<String> ? onSubmitted, List<TextInputFormatter> ? inputFormatters, TextStyle? textStyle, TextStyle? placeholderStyle, EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 16, vertical: 12), double iconSpacing = 12.0, LiquidShape shape = const LiquidRoundedSuperellipse(borderRadius: 10), LiquidGlassSettings? settings, bool useOwnLayer = false, LGQuality quality = LGQuality.standard}) -
Creates a glass text field.
const
Properties
- autofocus → bool
-
Whether the text field should auto-focus.
final
- controller → TextEditingController?
-
Controls the text being edited.
final
- enabled → bool
-
Whether the text field is enabled.
final
- focusNode → FocusNode?
-
Controls the focus state of the text field.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconSpacing → double
-
Spacing between the icons and the text field.
final
-
inputFormatters
→ List<
TextInputFormatter> ? -
Input formatters for the text field.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardType → TextInputType?
-
The type of keyboard to display.
final
- maxLength → int?
-
Maximum number of characters allowed.
final
- maxLines → int
-
Maximum number of lines for the text field.
final
- minLines → int?
-
Minimum number of lines for the text field.
final
- obscureText → bool
-
Whether to obscure the text (for passwords).
final
-
onChanged
→ ValueChanged<
String> ? -
Called when the text changes.
final
-
onSubmitted
→ ValueChanged<
String> ? -
Called when the user submits the text.
final
- onSuffixTap → VoidCallback?
-
Callback when suffix icon is tapped.
final
- padding → EdgeInsetsGeometry
-
Padding inside the text field.
final
- placeholder → String?
-
Placeholder text shown when the field is empty.
final
- placeholderStyle → TextStyle?
-
The style of the placeholder text.
final
- prefixIcon → Widget?
-
Widget displayed at the start of the field.
final
- quality → LGQuality
-
Rendering quality for the glass effect.
final
- readOnly → bool
-
Whether the text field is read-only.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- settings → LiquidGlassSettings?
-
Glass effect settings (only used when useOwnLayer is true).
final
- shape → LiquidShape
-
Shape of the text field.
final
- suffixIcon → Widget?
-
Widget displayed at the end of the field.
final
- textInputAction → TextInputAction?
-
The action button on the keyboard.
final
- textStyle → TextStyle?
-
The style of the text being edited.
final
- useOwnLayer → bool
-
Whether to create its own layer or use grouped glass within an existing layer.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< LGTextField> -
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