⌂
›
Widgets
›
CupertinoTextField
CupertinoTextField
CupertinoTextField control. Build it with the cupertino_text_field helper.
Example
cupertino_text_field(
value: "Sample",
label: "Label",
icon: "add",
password: true,
on_click: ->(event) {}
)
Properties
adaptive— Adapts to the platform (Material/Cupertino) when true.align_label_with_hint— Sets the align label with hint property.always_call_on_tap— Sets the always call on tap property.animate_cursor_opacity— Animates cursor opacity changes.autocorrect— Sets the autocorrect property.autofill_hints— Sets the autofill hints property.autofocus— Requests focus when first shown.bgcolor— Background color.blend_mode— Sets the blend mode property.border— Border definition.border_color— Border color.border_radius— Corner radius.border_width— Border thickness.can_request_focus— Sets the can request focus property.can_reveal_password— Sets the can reveal password property.capitalization— Sets the capitalization property.clear_button_semantics_label— Sets the clear button semantics label property.clear_button_visibility_mode— Sets the clear button visibility mode property.clip_behavior— How content overflowing the bounds is clipped.collapsed— Sets the collapsed property.color— Foreground color.content_padding— Content padding.counter— Sets the counter property.counter_style— Counter style.cursor_color— Cursor color.cursor_error_color— Cursor error color.cursor_height— Cursor height.cursor_radius— Cursor radius.cursor_width— Cursor width.dense— Sets the dense property.enable_ime_personalized_learning— Sets the enable ime personalized learning property.enable_interactive_selection— Sets the enable interactive selection property.enable_stylus_handwriting— Sets the enable stylus handwriting property.enable_suggestions— Sets the enable suggestions property.error— Sets the error property.error_max_lines— Sets the error max lines property.error_style— Error style.fill_color— Fill color.filled— Sets the filled property.fit_parent_size— Sets the fit parent size property.focus_color— Color shown while focused.focused_bgcolor— Focused background color.focused_border_color— Focused border color.focused_border_width— Focused border width.focused_color— Focused color.gradient— Sets the gradient property.helper— Sets the helper property.helper_max_lines— Sets the helper max lines property.helper_style— Helper style.hint_fade_duration— Sets the hint fade duration property.hint_max_lines— Sets the hint max lines property.hint_style— Hint style.hint_text— Placeholder shown when the field is empty.hover_color— Color shown while hovered.icon— Icon name shown by the control.ignore_pointers— Sets the ignore pointers property.ignore_up_down_keys— Sets the ignore up down keys property.image— Sets the image property.input_filter— Sets the input filter property.keyboard_brightness— Sets the keyboard brightness property.keyboard_type— On-screen keyboard type (e.g. number, email).label— Text label shown for the control.label_style— Label style.max_length— Sets the max length property.max_lines— Sets the max lines property.min_lines— Sets the min lines property.mouse_cursor— Cursor shown when hovering the control.multiline— Allows multiple lines of input when true.obscuring_character— Sets the obscuring character property.padding— Inner spacing between the border and the content.password— Obscures the entered text when true.placeholder_style— Placeholder style.placeholder_text— Placeholder text.prefix— Sets the prefix property.prefix_icon— Prefix icon.prefix_icon_size_constraints— Sets the prefix icon size constraints property.prefix_style— Prefix style.prefix_visibility_mode— Sets the prefix visibility mode property.read_only— Prevents editing while still allowing selection.scroll_padding— Scroll padding.selection— Sets the selection property.selection_color— Selection color.shadows— Sets the shadows property.shift_enter— Sets the shift enter property.show_cursor— Sets the show cursor property.size_constraints— Min/max size constraints.smart_dashes_type— Sets the smart dashes type property.smart_quotes_type— Sets the smart quotes type property.strut_style— Strut style.suffix— Sets the suffix property.suffix_icon— Suffix icon.suffix_icon_size_constraints— Sets the suffix icon size constraints property.suffix_style— Suffix style.suffix_visibility_mode— Sets the suffix visibility mode property.text_align— Sets the text align property.text_size— Sets the text size property.text_style— Text style.text_vertical_align— Sets the text vertical align property.value— The control's current value.
Common layout and animation properties
align— Alignment of the control within its parent.animate_align— Animates alignment changes.animate_margin— Animates margin changes.animate_offset— Animates offset changes.animate_opacity— Animates opacity changes.animate_position— Animates position changes.animate_rotation— Animates rotation changes.animate_scale— Animates scale changes.animate_size— Animates size changes.aspect_ratio— Width-to-height ratio to maintain.badge— Badge drawn on the corner of the control.bottom— Bottom offset when positioned inside a stack.col— Responsive column span (1-12) per breakpoint.data— Arbitrary value you can attach to the control and read back in handlers.disabled— Disables interaction when true.expand— Fills the available space along the parent's main axis when true.expand_loose— Like expand, but only grows up to the child's natural size.height— Fixed height in logical pixels.key— Stable identity used to preserve state across rebuilds.left— Left offset when positioned inside a stack.margin— Outer spacing around the control.offset— Translation offset applied to the control.opacity— Opacity from 0.0 (transparent) to 1.0 (opaque).right— Right offset when positioned inside a stack.rotate— Rotation applied to the control.rtl— Renders right-to-left when true.scale— Scale transform applied to the control.size_change_interval— Throttle interval for on_size_change, in ms.tooltip— Text shown on hover/long-press.top— Top offset when positioned inside a stack.visible— Hides the control when false.width— Fixed width in logical pixels.
Events
on_animation_end— Fired when an animation completes.on_blur— Fired when the control loses focus.on_change— Fired when the value changes.on_click— Fired when the control is clicked/tapped.on_focus— Fired when the control gains focus.on_selection_change— Fired when the selection range changes.on_size_change— Fired when the control's size changes.on_submit— Fired when the input is submitted.on_tap_outside— Fired when a tap occurs outside the control.
Reference
- Family:
cupertinos - Widget type:
cupertinotextfield - Helpers:
cupertino_text_field,cupertinotextfield