pub struct TextField {Show 72 fields
pub key: Option<KeyRef>,
pub magnifier_configuration: Option<TextMagnifierConfiguration>,
pub group_id: TypeId,
pub controller: Option<TextEditingControllerRef>,
pub focus_node: Option<FocusNodeRef>,
pub decoration: Option<InputDecoration>,
pub keyboard_type: Option<TextInputType>,
pub text_input_action: Option<TextInputAction>,
pub text_capitalization: TextCapitalization,
pub style: Option<AnyTextStyle>,
pub strut_style: Option<StrutStyle>,
pub text_align: TextAlign,
pub text_align_vertical: Option<TextAlignVertical>,
pub text_direction: Option<TextDirection>,
pub autofocus: bool,
pub states_controller: Option<Ref<MaterialStatesController>>,
pub obscuring_character: String,
pub obscure_text: bool,
pub autocorrect: Option<bool>,
pub smart_dashes_type: Option<SmartDashesType>,
pub smart_quotes_type: Option<SmartQuotesType>,
pub enable_suggestions: bool,
pub max_lines: Option<i32>,
pub min_lines: Option<i32>,
pub expands: bool,
pub read_only: bool,
pub toolbar_options: Option<ToolbarOptions>,
pub show_cursor: Option<bool>,
pub max_length: Option<i32>,
pub max_length_enforcement: Option<MaxLengthEnforcement>,
pub on_changed: Option<Rc<dyn Fn(&mut App, String)>>,
pub on_editing_complete: Option<Rc<dyn Fn(&mut App)>>,
pub on_submitted: Option<Rc<dyn Fn(&mut App, String)>>,
pub on_app_private_command: Option<AppPrivateCommandCallback>,
pub input_formatters: Option<Vec<TextInputFormatterRef>>,
pub enabled: Option<bool>,
pub ignore_pointers: Option<bool>,
pub cursor_width: f64,
pub cursor_height: Option<f64>,
pub cursor_radius: Option<Radius>,
pub cursor_opacity_animates: Option<bool>,
pub cursor_color: Option<Color>,
pub cursor_error_color: Option<Color>,
pub selection_height_style: Option<BoxHeightStyle>,
pub selection_width_style: Option<BoxWidthStyle>,
pub keyboard_appearance: Option<Brightness>,
pub scroll_padding: EdgeInsets,
pub enable_interactive_selection: Option<bool>,
pub select_all_on_focus: Option<bool>,
pub selection_controls: Option<Rc<dyn TextSelectionControls>>,
pub drag_start_behavior: DragStartBehavior,
pub on_tap: Option<GestureTapCallback>,
pub on_tap_always_called: bool,
pub on_tap_outside: Option<TapRegionCallback>,
pub on_tap_up_outside: Option<TapRegionUpCallback>,
pub mouse_cursor: Option<MouseCursorRef>,
pub build_counter: Option<InputCounterWidgetBuilder>,
pub scroll_physics: Option<ScrollPhysicsRef>,
pub scroll_controller: Option<ScrollControllerRef>,
pub autofill_hints: Vec<String>,
pub clip_behavior: Clip,
pub restoration_id: Option<String>,
pub scribble_enabled: bool,
pub stylus_handwriting_enabled: bool,
pub enable_ime_personalized_learning: bool,
pub enable_inline_prediction: Option<bool>,
pub content_insertion_configuration: Option<ContentInsertionConfiguration>,
pub context_menu_builder: Option<EditableTextContextMenuBuilder>,
pub can_request_focus: bool,
pub undo_controller: Option<Ref<UndoHistoryController>>,
pub hint_locales: Option<Vec<Locale>>,
pub spell_check_configuration: Option<SpellCheckConfiguration>,
}Expand description
A Material Design text field.
A text field lets the user enter text, either with hardware keyboard or with an onscreen keyboard.
The text field calls the on_changed callback whenever the user changes
the text in the field. If the user indicates that they are done typing in the field (e.g.,
by pressing a button on the soft keyboard), the text field calls the
on_submitted callback.
By default, a text field has a decoration that draws a divider below
the text field. If the decoration is None, the decoration is removed entirely, including
the extra padding introduced by the decoration to save space for the labels.
If decoration is non-null (which is the default), the text field
requires one of its ancestors to be a Material widget.
To integrate the TextField into a Form with other FormField widgets, consider using
TextFormField.
Fields§
§key: Option<KeyRef>See Widget::key.
magnifier_configuration: Option<TextMagnifierConfiguration>The configuration of the magnifier; TextMagnifier::adaptive_magnifier_configuration
when None.
group_id: TypeId{@macro flutter.widgets.editableText.groupId}
controller: Option<TextEditingControllerRef>Controls the text being edited.
If null, this widget will create its own TextEditingController.
focus_node: Option<FocusNodeRef>Defines the keyboard focus for this widget.
If null, this widget will create its own FocusNode.
decoration: Option<InputDecoration>The decoration to show around the text field.
By default, draws a horizontal line under the text field but can be configured to show an icon, label, hint text, and error text.
Specify None to remove the decoration entirely (including the extra padding introduced
by the decoration to save space for the labels).
keyboard_type: Option<TextInputType>{@macro flutter.widgets.editableText.keyboardType}
None: Dart’s default, TextInputType::TEXT for one line and
TextInputType::MULTILINE otherwise (effective_keyboard_type).
text_input_action: Option<TextInputAction>The type of action button to use for the keyboard.
text_capitalization: TextCapitalization{@macro flutter.widgets.editableText.textCapitalization}
style: Option<AnyTextStyle>The style to use for the text being edited.
This text style is also used as the base style for the decoration.
If null, TextTheme::title_medium is used (Material 2),
or body_large (Material 3). A WidgetStateTextStyle is resolved against the field’s
states.
strut_style: Option<StrutStyle>{@macro flutter.widgets.editableText.strutStyle}
text_align: TextAlign{@macro flutter.widgets.editableText.textAlign}
text_align_vertical: Option<TextAlignVertical>{@macro cupertino_ui.InputDecorator.textAlignVertical}
text_direction: Option<TextDirection>{@macro flutter.widgets.editableText.textDirection}
autofocus: bool{@macro flutter.widgets.editableText.autofocus}
states_controller: Option<Ref<MaterialStatesController>>Represents the interactive “state” of this widget in terms of a set of WidgetStates,
including WidgetState::Disabled, WidgetState::Hovered, WidgetState::Error,
and WidgetState::Focused.
obscuring_character: String{@macro flutter.widgets.editableText.obscuringCharacter}
obscure_text: bool{@macro flutter.widgets.editableText.obscureText}
autocorrect: Option<bool>{@macro flutter.widgets.editableText.autocorrect}
smart_dashes_type: Option<SmartDashesType>{@macro flutter.services.TextInputConfiguration.smartDashesType}
None: Dart’s default from obscure_text
(effective_smart_dashes_type).
smart_quotes_type: Option<SmartQuotesType>{@macro flutter.services.TextInputConfiguration.smartQuotesType}
None: Dart’s default from obscure_text
(effective_smart_quotes_type).
enable_suggestions: bool{@macro flutter.services.TextInputConfiguration.enableSuggestions}
max_lines: Option<i32>{@macro flutter.widgets.editableText.maxLines}
min_lines: Option<i32>{@macro flutter.widgets.editableText.minLines}
expands: bool{@macro flutter.widgets.editableText.expands}
read_only: bool{@macro flutter.widgets.editableText.readOnly}
toolbar_options: Option<ToolbarOptions>Use context_menu_builder instead.
Configuration of toolbar options.
If not set, select all and paste will default to be enabled. Copy and cut will be
disabled if obscure_text is true. If
read_only is true, paste and cut will be disabled regardless.
show_cursor: Option<bool>{@macro flutter.widgets.editableText.showCursor}
max_length: Option<i32>The maximum number of characters (Unicode grapheme clusters) to allow in the text field.
If set, a character counter will be displayed below the field showing how many
characters have been entered. If set to a number greater than 0, it will also display
the maximum number allowed. If set to TextField::NO_MAX_LENGTH then only the current
character count is displayed.
After max_length characters have been input, additional input is ignored, unless
max_length_enforcement is set to
MaxLengthEnforcement::None.
max_length_enforcement: Option<MaxLengthEnforcement>Determines how the max_length limit should be enforced.
on_changed: Option<Rc<dyn Fn(&mut App, String)>>Called when the user initiates a change to the TextField’s value: when they have inserted or deleted text.
on_editing_complete: Option<Rc<dyn Fn(&mut App)>>{@macro flutter.widgets.editableText.onEditingComplete}
on_submitted: Option<Rc<dyn Fn(&mut App, String)>>{@macro flutter.widgets.editableText.onSubmitted}
on_app_private_command: Option<AppPrivateCommandCallback>{@macro flutter.widgets.editableText.onAppPrivateCommand}
input_formatters: Option<Vec<TextInputFormatterRef>>{@macro flutter.widgets.editableText.inputFormatters}
enabled: Option<bool>If false the text field is “disabled”: it ignores taps and its
decoration is rendered in grey.
If non-null this property overrides the decoration’s enabled property.
ignore_pointers: Option<bool>Determines whether this widget ignores pointer events.
Defaults to null, and when null, does nothing.
cursor_width: f64{@macro flutter.widgets.editableText.cursorWidth}
cursor_height: Option<f64>{@macro flutter.widgets.editableText.cursorHeight}
cursor_radius: Option<Radius>{@macro flutter.widgets.editableText.cursorRadius}
cursor_opacity_animates: Option<bool>{@macro flutter.widgets.editableText.cursorOpacityAnimates}
cursor_color: Option<Color>The color of the cursor.
The cursor indicates the current location of text insertion point in the field.
cursor_error_color: Option<Color>The color of the cursor when the InputDecorator is showing an error.
If this is null it will default to TextStyle.color of
InputDecoration.error_style. If that is null, it will use ColorScheme.error of
ThemeData.color_scheme.
selection_height_style: Option<BoxHeightStyle>Controls how tall the selection highlight boxes are computed to be.
selection_width_style: Option<BoxWidthStyle>Controls how wide the selection highlight boxes are computed to be.
keyboard_appearance: Option<Brightness>The appearance of the keyboard.
If unset, defaults to ThemeData.brightness.
scroll_padding: EdgeInsets{@macro flutter.widgets.editableText.scrollPadding}
enable_interactive_selection: Option<bool>{@macro flutter.widgets.editableText.enableInteractiveSelection}
None: Dart’s default, !read_only || !obscure_text
(effective_enable_interactive_selection).
select_all_on_focus: Option<bool>{@macro flutter.widgets.editableText.selectAllOnFocus}
selection_controls: Option<Rc<dyn TextSelectionControls>>{@macro flutter.widgets.editableText.selectionControls}
drag_start_behavior: DragStartBehavior{@macro flutter.widgets.scrollable.dragStartBehavior}
on_tap: Option<GestureTapCallback>Called for the first tap in a series of taps.
The text field builds a GestureDetector to handle input events like tap, to trigger
focus requests, to move the caret, adjust the selection, etc. Handling some of those
events by wrapping the text field with a competing GestureDetector is problematic.
on_tap_always_called: boolWhether on_tap should be called for every tap.
Defaults to false, so on_tap is only called for each distinct tap.
When enabled, on_tap is called for every tap including consecutive
taps.
on_tap_outside: Option<TapRegionCallback>{@macro flutter.widgets.editableText.onTapOutside}
on_tap_up_outside: Option<TapRegionUpCallback>{@macro flutter.widgets.editableText.onTapUpOutside}
mouse_cursor: Option<MouseCursorRef>The cursor for a mouse pointer when it enters or is hovering over the widget.
If mouse_cursor is a WidgetStateMouseCursor, it is resolved
against the field’s states. If this property is null,
WidgetStateMouseCursor::textable() is used.
build_counter: Option<InputCounterWidgetBuilder>Callback that generates a custom InputDecoration.counter widget.
The returned widget is placed below the text field, as in the
InputDecoration.counter property. If it returns null, no counter is shown.
scroll_physics: Option<ScrollPhysicsRef>{@macro flutter.widgets.editableText.scrollPhysics}
scroll_controller: Option<ScrollControllerRef>{@macro flutter.widgets.editableText.scrollController}
autofill_hints: Vec<String>{@macro flutter.widgets.editableText.autofillHints}
clip_behavior: Clip{@macro cupertino_ui.Material.clipBehavior}
restoration_id: Option<String>Restoration ID to save and restore the state of the text field.
If non-null, the text field will persist and restore its current scroll offset and -
if no controller has been provided - the content of the text
field. If a controller has been provided, it is the
responsibility of the owner of that controller to persist and restore it.
scribble_enabled: boolUse stylus_handwriting_enabled instead.
{@macro flutter.widgets.editableText.scribbleEnabled}
stylus_handwriting_enabled: bool{@macro flutter.widgets.editableText.stylusHandwritingEnabled}
enable_ime_personalized_learning: bool{@macro flutter.services.TextInputConfiguration.enableIMEPersonalizedLearning}
enable_inline_prediction: Option<bool>{@macro flutter.services.TextInputConfiguration.enableInlinePrediction}
content_insertion_configuration: Option<ContentInsertionConfiguration>{@macro flutter.widgets.editableText.contentInsertionConfiguration}
{@macro flutter.widgets.EditableText.contextMenuBuilder}
If not provided, will build a default menu based on the platform.
can_request_focus: boolDetermine whether this text field can request the primary focus.
Defaults to true. If false, the text field will not request focus when tapped, or when its context menu is displayed. If false it will not be possible to move the focus to the text field with tab key.
undo_controller: Option<Ref<UndoHistoryController>>{@macro flutter.widgets.undoHistory.controller}
hint_locales: Option<Vec<Locale>>{@macro flutter.services.TextInputConfiguration.hintLocales}
spell_check_configuration: Option<SpellCheckConfiguration>{@macro flutter.widgets.EditableText.spellCheckConfiguration}
If SpellCheckConfiguration::misspelled_text_style is not specified in this
configuration, then TextField::material_misspelled_text_style is used by default.
Implementations§
Source§impl TextField
impl TextField
Sourcepub const NO_MAX_LENGTH: i32 = -1
pub const NO_MAX_LENGTH: i32 = -1
If max_length is set to this value, only the “current input
length” part of the character counter is shown.
Sourcepub fn controller(self, controller: TextEditingControllerRef) -> TextField
pub fn controller(self, controller: TextEditingControllerRef) -> TextField
Dart TextField(controller:).
Sourcepub fn focus_node(self, focus_node: FocusNodeRef) -> TextField
pub fn focus_node(self, focus_node: FocusNodeRef) -> TextField
Dart TextField(focusNode:).
Sourcepub fn undo_controller(
self,
undo_controller: Ref<UndoHistoryController>,
) -> TextField
pub fn undo_controller( self, undo_controller: Ref<UndoHistoryController>, ) -> TextField
Dart TextField(undoController:).
Sourcepub fn decoration(self, decoration: Option<InputDecoration>) -> TextField
pub fn decoration(self, decoration: Option<InputDecoration>) -> TextField
Dart TextField(decoration:).
Sourcepub fn keyboard_type(self, keyboard_type: TextInputType) -> TextField
pub fn keyboard_type(self, keyboard_type: TextInputType) -> TextField
Dart TextField(keyboardType:).
Sourcepub fn text_input_action(self, text_input_action: TextInputAction) -> TextField
pub fn text_input_action(self, text_input_action: TextInputAction) -> TextField
Dart TextField(textInputAction:).
Sourcepub fn text_capitalization(
self,
text_capitalization: TextCapitalization,
) -> TextField
pub fn text_capitalization( self, text_capitalization: TextCapitalization, ) -> TextField
Dart TextField(textCapitalization:).
Sourcepub fn style(self, style: impl Into<AnyTextStyle>) -> TextField
pub fn style(self, style: impl Into<AnyTextStyle>) -> TextField
Dart TextField(style:).
Sourcepub fn strut_style(self, strut_style: StrutStyle) -> TextField
pub fn strut_style(self, strut_style: StrutStyle) -> TextField
Dart TextField(strutStyle:).
Sourcepub fn text_align(self, text_align: TextAlign) -> TextField
pub fn text_align(self, text_align: TextAlign) -> TextField
Dart TextField(textAlign:).
Sourcepub fn text_align_vertical(
self,
text_align_vertical: TextAlignVertical,
) -> TextField
pub fn text_align_vertical( self, text_align_vertical: TextAlignVertical, ) -> TextField
Dart TextField(textAlignVertical:).
Sourcepub fn text_direction(self, text_direction: TextDirection) -> TextField
pub fn text_direction(self, text_direction: TextDirection) -> TextField
Dart TextField(textDirection:).
Sourcepub fn toolbar_options(self, toolbar_options: ToolbarOptions) -> TextField
👎Deprecated: Use context_menu_builder instead.
pub fn toolbar_options(self, toolbar_options: ToolbarOptions) -> TextField
Use context_menu_builder instead.
Dart TextField(toolbarOptions:).
Sourcepub fn show_cursor(self, show_cursor: bool) -> TextField
pub fn show_cursor(self, show_cursor: bool) -> TextField
Dart TextField(showCursor:).
Sourcepub fn states_controller(
self,
states_controller: Ref<MaterialStatesController>,
) -> TextField
pub fn states_controller( self, states_controller: Ref<MaterialStatesController>, ) -> TextField
Dart TextField(statesController:).
Sourcepub fn obscuring_character(
self,
obscuring_character: impl Into<String>,
) -> TextField
pub fn obscuring_character( self, obscuring_character: impl Into<String>, ) -> TextField
Dart TextField(obscuringCharacter:).
Sourcepub fn obscure_text(self, obscure_text: bool) -> TextField
pub fn obscure_text(self, obscure_text: bool) -> TextField
Dart TextField(obscureText:).
Sourcepub fn autocorrect(self, autocorrect: bool) -> TextField
pub fn autocorrect(self, autocorrect: bool) -> TextField
Dart TextField(autocorrect:).
Sourcepub fn smart_dashes_type(self, smart_dashes_type: SmartDashesType) -> TextField
pub fn smart_dashes_type(self, smart_dashes_type: SmartDashesType) -> TextField
Dart TextField(smartDashesType:).
Sourcepub fn smart_quotes_type(self, smart_quotes_type: SmartQuotesType) -> TextField
pub fn smart_quotes_type(self, smart_quotes_type: SmartQuotesType) -> TextField
Dart TextField(smartQuotesType:).
Sourcepub fn enable_suggestions(self, enable_suggestions: bool) -> TextField
pub fn enable_suggestions(self, enable_suggestions: bool) -> TextField
Dart TextField(enableSuggestions:).
Sourcepub fn max_length(self, max_length: i32) -> TextField
pub fn max_length(self, max_length: i32) -> TextField
Dart TextField(maxLength:).
Sourcepub fn max_length_enforcement(
self,
max_length_enforcement: MaxLengthEnforcement,
) -> TextField
pub fn max_length_enforcement( self, max_length_enforcement: MaxLengthEnforcement, ) -> TextField
Dart TextField(maxLengthEnforcement:).
Sourcepub fn on_changed(
self,
on_changed: impl Fn(&mut App, String) + 'static,
) -> TextField
pub fn on_changed( self, on_changed: impl Fn(&mut App, String) + 'static, ) -> TextField
Dart TextField(onChanged:).
Sourcepub fn on_editing_complete(
self,
on_editing_complete: impl Fn(&mut App) + 'static,
) -> TextField
pub fn on_editing_complete( self, on_editing_complete: impl Fn(&mut App) + 'static, ) -> TextField
Dart TextField(onEditingComplete:).
Sourcepub fn on_submitted(
self,
on_submitted: impl Fn(&mut App, String) + 'static,
) -> TextField
pub fn on_submitted( self, on_submitted: impl Fn(&mut App, String) + 'static, ) -> TextField
Dart TextField(onSubmitted:).
Sourcepub fn on_app_private_command(
self,
on_app_private_command: impl Fn(&mut App, &str) + 'static,
) -> TextField
pub fn on_app_private_command( self, on_app_private_command: impl Fn(&mut App, &str) + 'static, ) -> TextField
Dart TextField(onAppPrivateCommand:).
Sourcepub fn input_formatters(
self,
input_formatters: Vec<TextInputFormatterRef>,
) -> TextField
pub fn input_formatters( self, input_formatters: Vec<TextInputFormatterRef>, ) -> TextField
Dart TextField(inputFormatters:).
Sourcepub fn ignore_pointers(self, ignore_pointers: bool) -> TextField
pub fn ignore_pointers(self, ignore_pointers: bool) -> TextField
Dart TextField(ignorePointers:).
Sourcepub fn cursor_width(self, cursor_width: f64) -> TextField
pub fn cursor_width(self, cursor_width: f64) -> TextField
Dart TextField(cursorWidth:).
Sourcepub fn cursor_height(self, cursor_height: f64) -> TextField
pub fn cursor_height(self, cursor_height: f64) -> TextField
Dart TextField(cursorHeight:).
Sourcepub fn cursor_radius(self, cursor_radius: Radius) -> TextField
pub fn cursor_radius(self, cursor_radius: Radius) -> TextField
Dart TextField(cursorRadius:).
Sourcepub fn cursor_opacity_animates(self, cursor_opacity_animates: bool) -> TextField
pub fn cursor_opacity_animates(self, cursor_opacity_animates: bool) -> TextField
Dart TextField(cursorOpacityAnimates:).
Sourcepub fn cursor_color(self, cursor_color: Color) -> TextField
pub fn cursor_color(self, cursor_color: Color) -> TextField
Dart TextField(cursorColor:).
Sourcepub fn cursor_error_color(self, cursor_error_color: Color) -> TextField
pub fn cursor_error_color(self, cursor_error_color: Color) -> TextField
Dart TextField(cursorErrorColor:).
Sourcepub fn selection_height_style(
self,
selection_height_style: BoxHeightStyle,
) -> TextField
pub fn selection_height_style( self, selection_height_style: BoxHeightStyle, ) -> TextField
Dart TextField(selectionHeightStyle:).
Sourcepub fn selection_width_style(
self,
selection_width_style: BoxWidthStyle,
) -> TextField
pub fn selection_width_style( self, selection_width_style: BoxWidthStyle, ) -> TextField
Dart TextField(selectionWidthStyle:).
Sourcepub fn keyboard_appearance(self, keyboard_appearance: Brightness) -> TextField
pub fn keyboard_appearance(self, keyboard_appearance: Brightness) -> TextField
Dart TextField(keyboardAppearance:).
Sourcepub fn scroll_padding(self, scroll_padding: EdgeInsets) -> TextField
pub fn scroll_padding(self, scroll_padding: EdgeInsets) -> TextField
Dart TextField(scrollPadding:).
Sourcepub fn drag_start_behavior(
self,
drag_start_behavior: DragStartBehavior,
) -> TextField
pub fn drag_start_behavior( self, drag_start_behavior: DragStartBehavior, ) -> TextField
Dart TextField(dragStartBehavior:).
Sourcepub fn enable_interactive_selection(
self,
enable_interactive_selection: bool,
) -> TextField
pub fn enable_interactive_selection( self, enable_interactive_selection: bool, ) -> TextField
Dart TextField(enableInteractiveSelection:).
Sourcepub fn select_all_on_focus(self, select_all_on_focus: bool) -> TextField
pub fn select_all_on_focus(self, select_all_on_focus: bool) -> TextField
Dart TextField(selectAllOnFocus:).
Sourcepub fn selection_controls(
self,
selection_controls: Rc<dyn TextSelectionControls>,
) -> TextField
pub fn selection_controls( self, selection_controls: Rc<dyn TextSelectionControls>, ) -> TextField
Dart TextField(selectionControls:).
Sourcepub fn on_tap(self, on_tap: GestureTapCallback) -> TextField
pub fn on_tap(self, on_tap: GestureTapCallback) -> TextField
Dart TextField(onTap:).
Sourcepub fn on_tap_always_called(self, on_tap_always_called: bool) -> TextField
pub fn on_tap_always_called(self, on_tap_always_called: bool) -> TextField
Dart TextField(onTapAlwaysCalled:).
Sourcepub fn on_tap_outside(
self,
on_tap_outside: impl Fn(&mut App, PointerDownEvent) + 'static,
) -> TextField
pub fn on_tap_outside( self, on_tap_outside: impl Fn(&mut App, PointerDownEvent) + 'static, ) -> TextField
Dart TextField(onTapOutside:).
Sourcepub fn on_tap_up_outside(
self,
on_tap_up_outside: impl Fn(&mut App, PointerUpEvent) + 'static,
) -> TextField
pub fn on_tap_up_outside( self, on_tap_up_outside: impl Fn(&mut App, PointerUpEvent) + 'static, ) -> TextField
Dart TextField(onTapUpOutside:).
Sourcepub fn mouse_cursor(self, mouse_cursor: MouseCursorRef) -> TextField
pub fn mouse_cursor(self, mouse_cursor: MouseCursorRef) -> TextField
Dart TextField(mouseCursor:).
Sourcepub fn build_counter(
self,
build_counter: impl Fn(&mut App, BuildContext, i32, Option<i32>, bool) -> Option<WidgetRef> + 'static,
) -> TextField
pub fn build_counter( self, build_counter: impl Fn(&mut App, BuildContext, i32, Option<i32>, bool) -> Option<WidgetRef> + 'static, ) -> TextField
Dart TextField(buildCounter:).
Sourcepub fn scroll_controller(
self,
scroll_controller: ScrollControllerRef,
) -> TextField
pub fn scroll_controller( self, scroll_controller: ScrollControllerRef, ) -> TextField
Dart TextField(scrollController:).
Sourcepub fn scroll_physics(self, scroll_physics: ScrollPhysicsRef) -> TextField
pub fn scroll_physics(self, scroll_physics: ScrollPhysicsRef) -> TextField
Dart TextField(scrollPhysics:).
Sourcepub fn autofill_hints(self, autofill_hints: Vec<String>) -> TextField
pub fn autofill_hints(self, autofill_hints: Vec<String>) -> TextField
Dart TextField(autofillHints:).
Sourcepub fn content_insertion_configuration(
self,
content_insertion_configuration: ContentInsertionConfiguration,
) -> TextField
pub fn content_insertion_configuration( self, content_insertion_configuration: ContentInsertionConfiguration, ) -> TextField
Dart TextField(contentInsertionConfiguration:).
Sourcepub fn clip_behavior(self, clip_behavior: Clip) -> TextField
pub fn clip_behavior(self, clip_behavior: Clip) -> TextField
Dart TextField(clipBehavior:).
Sourcepub fn restoration_id(self, restoration_id: impl Into<String>) -> TextField
pub fn restoration_id(self, restoration_id: impl Into<String>) -> TextField
Dart TextField(restorationId:).
Sourcepub fn scribble_enabled(self, scribble_enabled: bool) -> TextField
👎Deprecated: Use stylus_handwriting_enabled instead.
pub fn scribble_enabled(self, scribble_enabled: bool) -> TextField
Use stylus_handwriting_enabled instead.
Dart TextField(scribbleEnabled:).
Sourcepub fn stylus_handwriting_enabled(
self,
stylus_handwriting_enabled: bool,
) -> TextField
pub fn stylus_handwriting_enabled( self, stylus_handwriting_enabled: bool, ) -> TextField
Dart TextField(stylusHandwritingEnabled:).
Sourcepub fn enable_ime_personalized_learning(
self,
enable_ime_personalized_learning: bool,
) -> TextField
pub fn enable_ime_personalized_learning( self, enable_ime_personalized_learning: bool, ) -> TextField
Dart TextField(enableIMEPersonalizedLearning:).
Sourcepub fn enable_inline_prediction(
self,
enable_inline_prediction: bool,
) -> TextField
pub fn enable_inline_prediction( self, enable_inline_prediction: bool, ) -> TextField
Dart TextField(enableInlinePrediction:).
Dart TextField(contextMenuBuilder:).
Sourcepub fn can_request_focus(self, can_request_focus: bool) -> TextField
pub fn can_request_focus(self, can_request_focus: bool) -> TextField
Dart TextField(canRequestFocus:).
Sourcepub fn spell_check_configuration(
self,
spell_check_configuration: SpellCheckConfiguration,
) -> TextField
pub fn spell_check_configuration( self, spell_check_configuration: SpellCheckConfiguration, ) -> TextField
Dart TextField(spellCheckConfiguration:).
Sourcepub fn magnifier_configuration(
self,
magnifier_configuration: TextMagnifierConfiguration,
) -> TextField
pub fn magnifier_configuration( self, magnifier_configuration: TextMagnifierConfiguration, ) -> TextField
Dart TextField(magnifierConfiguration:).
Sourcepub fn hint_locales(self, hint_locales: Vec<Locale>) -> TextField
pub fn hint_locales(self, hint_locales: Vec<Locale>) -> TextField
Dart TextField(hintLocales:).
Sourcepub fn effective_keyboard_type(&self) -> TextInputType
pub fn effective_keyboard_type(&self) -> TextInputType
Dart’s keyboardType field, as its constructor fills it.
Sourcepub fn effective_smart_dashes_type(&self) -> SmartDashesType
pub fn effective_smart_dashes_type(&self) -> SmartDashesType
Dart’s smartDashesType field, as its constructor fills it.
Sourcepub fn effective_smart_quotes_type(&self) -> SmartQuotesType
pub fn effective_smart_quotes_type(&self) -> SmartQuotesType
Dart’s smartQuotesType field, as its constructor fills it.
Sourcepub fn effective_enable_interactive_selection(&self) -> bool
pub fn effective_enable_interactive_selection(&self) -> bool
Dart’s enableInteractiveSelection field, as its constructor fills it.
Sourcepub fn selection_enabled(&self) -> bool
pub fn selection_enabled(&self) -> bool
{@macro flutter.widgets.editableText.selectionEnabled}
Sourcepub fn material_misspelled_text_style() -> TextStyle
pub fn material_misspelled_text_style() -> TextStyle
The TextStyle used to indicate misspelled words in the Material style.
See also:
SpellCheckConfiguration::misspelled_text_style, the style configured to mark misspelled words with.CupertinoTextField::cupertino_misspelled_text_style, the style configured to mark misspelled words with in the Cupertino style.
Sourcepub fn default_spell_check_suggestions_toolbar_builder(
app: &mut App,
_context: BuildContext,
editable_text_state: Handle<EditableTextState>,
) -> WidgetRef
pub fn default_spell_check_suggestions_toolbar_builder( app: &mut App, _context: BuildContext, editable_text_state: Handle<EditableTextState>, ) -> WidgetRef
Default builder for TextField’s spell check suggestions toolbar.
On Apple platforms, builds an iOS-style toolbar. Everywhere else, builds an Android-style toolbar.
See also:
spell_check_configuration, where this is typically specified forTextField.SpellCheckConfiguration::spell_check_suggestions_toolbar_builder, the parameter for which this is the default value forTextField.CupertinoTextField::default_spell_check_suggestions_toolbar_builder, which is like this but specifies the default forCupertinoTextField.
Sourcepub fn infer_android_spell_check_configuration(
configuration: Option<&SpellCheckConfiguration>,
) -> SpellCheckConfiguration
pub fn infer_android_spell_check_configuration( configuration: Option<&SpellCheckConfiguration>, ) -> SpellCheckConfiguration
Returns a new SpellCheckConfiguration where the given configuration has had any
missing values replaced with their defaults for the Android platform.
Trait Implementations§
Source§impl StatefulWidget for TextField
impl StatefulWidget for TextField
Source§type State = TextFieldState
type State = TextFieldState
Source§fn debug_fill_properties(
&self,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn create_state(&self) -> TextFieldState
fn create_state(&self) -> TextFieldState
Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
impl !RefUnwindSafe for TextField
impl !Send for TextField
impl !Sync for TextField
impl !UnwindSafe for TextField
impl Forget for TextField
impl Freeze for TextFieldwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement, Retained<Handle<MagnifierController>>, Retained<Handle<ValueNotifier<MagnifierInfo>>>) -> Option<Rc<dyn Widget>>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Retained<Handle<MagnifierController>>, Retained<Handle<ValueNotifier<MagnifierInfo>>>) -> Option<Rc<dyn Widget>>>>: Freeze,
*const (): Freeze,
NonZero<u32>: Freeze,
&'static TextEditingControllerVTable: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
&'static FocusNodeVTable: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
&'static dyn ColorExtension: Freeze,
*const RcInner<dyn ColorExtension> is !null: Freeze,
PhantomData<RcInner<dyn ColorExtension>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
*const RcInner<Paint> is !null: Freeze,
PhantomData<RcInner<Paint>>: Freeze,
PhantomData<Shadow>: Freeze,
PhantomData<FontFeature>: Freeze,
PhantomData<FontVariation>: Freeze,
*const RcInner<dyn TextStyleExtension> is !null: Freeze,
PhantomData<RcInner<dyn TextStyleExtension>>: Freeze,
*const RcInner<dyn InputBorder> is !null: Freeze,
PhantomData<RcInner<dyn InputBorder>>: Freeze,
PhantomData<fn() -> WidgetStatesController>: Freeze,
*const RcInner<dyn Fn(&mut App, String)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, String)>>: Freeze,
*const RcInner<dyn Fn(&mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze,
*const RcInner<dyn Fn(&mut App, &str)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, &str)>>: Freeze,
PhantomData<TextInputFormatterRef>: Freeze,
*const RcInner<dyn TextSelectionControls> is !null: Freeze,
PhantomData<RcInner<dyn TextSelectionControls>>: Freeze,
*const RcInner<dyn Fn(&mut App, PointerDownEvent)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, PointerDownEvent)>>: Freeze,
*const RcInner<dyn Fn(&mut App, PointerUpEvent)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, PointerUpEvent)>>: Freeze,
*const RcInner<dyn MouseCursor> is !null: Freeze,
PhantomData<RcInner<dyn MouseCursor>>: Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement, i32, Option<i32>, bool) -> Option<Rc<dyn Widget>>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, i32, Option<i32>, bool) -> Option<Rc<dyn Widget>>>>: Freeze,
*const RcInner<dyn ScrollPhysics> is !null: Freeze,
PhantomData<RcInner<dyn ScrollPhysics>>: Freeze,
&'static ScrollControllerVTable: Freeze,
*const RcInner<dyn Fn(&mut App, KeyboardInsertedContent)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, KeyboardInsertedContent)>>: Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>>: Freeze,
PhantomData<fn() -> UndoHistoryController>: Freeze,
PhantomData<Locale>: Freeze,
*const RcInner<dyn SpellCheckService> is !null: Freeze,
PhantomData<RcInner<dyn SpellCheckService>>: Freeze,
impl Move for TextField
impl Unpin for TextFieldwhere
Rc<dyn Key>: Unpin,
Rc<dyn Fn(&mut App, AnyElement, Retained<Handle<MagnifierController>>, Retained<Handle<ValueNotifier<MagnifierInfo>>>) -> Option<Rc<dyn Widget>>>: Unpin,
*const (): Unpin,
NonZero<u32>: Unpin,
&'static TextEditingControllerVTable: Unpin,
Rc<Keep>: Unpin,
&'static FocusNodeVTable: Unpin,
Rc<dyn Widget>: Unpin,
&'static dyn ColorExtension: Unpin,
Rc<dyn ColorExtension>: Unpin,
*const u8 is !null: Unpin,
Rc<Paint>: Unpin,
Rc<dyn TextStyleExtension>: Unpin,
Rc<dyn InputBorder>: Unpin,
Rc<dyn Fn(&mut App, String)>: Unpin,
Rc<dyn Fn(&mut App)>: Unpin,
Rc<dyn Fn(&mut App, &str)>: Unpin,
Rc<dyn TextInputFormatter>: Unpin,
Rc<dyn TextSelectionControls>: Unpin,
Rc<dyn Fn(&mut App, PointerDownEvent)>: Unpin,
Rc<dyn Fn(&mut App, PointerUpEvent)>: Unpin,
Rc<dyn MouseCursor>: Unpin,
Rc<dyn Fn(&mut App, AnyElement, i32, Option<i32>, bool) -> Option<Rc<dyn Widget>>>: Unpin,
Rc<dyn ScrollPhysics>: Unpin,
&'static ScrollControllerVTable: Unpin,
Rc<dyn Fn(&mut App, KeyboardInsertedContent)>: Unpin,
Rc<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>: Unpin,
Rc<dyn SpellCheckService>: Unpin,
impl UnsafeUnpin for TextFieldwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement, Retained<Handle<MagnifierController>>, Retained<Handle<ValueNotifier<MagnifierInfo>>>) -> Option<Rc<dyn Widget>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Retained<Handle<MagnifierController>>, Retained<Handle<ValueNotifier<MagnifierInfo>>>) -> Option<Rc<dyn Widget>>>>: UnsafeUnpin,
*const (): UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
&'static TextEditingControllerVTable: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
&'static FocusNodeVTable: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
&'static dyn ColorExtension: UnsafeUnpin,
*const RcInner<dyn ColorExtension> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const RcInner<Paint> is !null: UnsafeUnpin,
PhantomData<RcInner<Paint>>: UnsafeUnpin,
PhantomData<Shadow>: UnsafeUnpin,
PhantomData<FontFeature>: UnsafeUnpin,
PhantomData<FontVariation>: UnsafeUnpin,
*const RcInner<dyn TextStyleExtension> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn TextStyleExtension>>: UnsafeUnpin,
*const RcInner<dyn InputBorder> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn InputBorder>>: UnsafeUnpin,
PhantomData<fn() -> WidgetStatesController>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, String)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, String)>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, &str)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, &str)>>: UnsafeUnpin,
PhantomData<TextInputFormatterRef>: UnsafeUnpin,
*const RcInner<dyn TextSelectionControls> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn TextSelectionControls>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, PointerDownEvent)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, PointerDownEvent)>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, PointerUpEvent)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, PointerUpEvent)>>: UnsafeUnpin,
*const RcInner<dyn MouseCursor> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn MouseCursor>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement, i32, Option<i32>, bool) -> Option<Rc<dyn Widget>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, i32, Option<i32>, bool) -> Option<Rc<dyn Widget>>>>: UnsafeUnpin,
*const RcInner<dyn ScrollPhysics> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ScrollPhysics>>: UnsafeUnpin,
&'static ScrollControllerVTable: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, KeyboardInsertedContent)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, KeyboardInsertedContent)>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>>: UnsafeUnpin,
PhantomData<fn() -> UndoHistoryController>: UnsafeUnpin,
PhantomData<Locale>: UnsafeUnpin,
*const RcInner<dyn SpellCheckService> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn SpellCheckService>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.