Skip to main content

TextField

Struct TextField 

Source
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>§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>
👎Deprecated:

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: bool

Whether 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: bool
👎Deprecated:

Use 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}

§context_menu_builder: Option<EditableTextContextMenuBuilder>

{@macro flutter.widgets.EditableText.contextMenuBuilder}

If not provided, will build a default menu based on the platform.

§can_request_focus: bool

Determine 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

Source

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.

Source

pub fn new() -> TextField

Creates a Material Design text field.

Source

pub fn key(self, key: KeyRef) -> TextField

Dart TextField(key:).

Source

pub fn group_id(self, group_id: TypeId) -> TextField

Dart TextField(groupId:).

Source

pub fn controller(self, controller: TextEditingControllerRef) -> TextField

Dart TextField(controller:).

Source

pub fn focus_node(self, focus_node: FocusNodeRef) -> TextField

Dart TextField(focusNode:).

Source

pub fn undo_controller( self, undo_controller: Ref<UndoHistoryController>, ) -> TextField

Dart TextField(undoController:).

Source

pub fn decoration(self, decoration: Option<InputDecoration>) -> TextField

Dart TextField(decoration:).

Source

pub fn keyboard_type(self, keyboard_type: TextInputType) -> TextField

Dart TextField(keyboardType:).

Source

pub fn text_input_action(self, text_input_action: TextInputAction) -> TextField

Dart TextField(textInputAction:).

Source

pub fn text_capitalization( self, text_capitalization: TextCapitalization, ) -> TextField

Dart TextField(textCapitalization:).

Source

pub fn style(self, style: impl Into<AnyTextStyle>) -> TextField

Dart TextField(style:).

Source

pub fn strut_style(self, strut_style: StrutStyle) -> TextField

Dart TextField(strutStyle:).

Source

pub fn text_align(self, text_align: TextAlign) -> TextField

Dart TextField(textAlign:).

Source

pub fn text_align_vertical( self, text_align_vertical: TextAlignVertical, ) -> TextField

Dart TextField(textAlignVertical:).

Source

pub fn text_direction(self, text_direction: TextDirection) -> TextField

Dart TextField(textDirection:).

Source

pub fn read_only(self, read_only: bool) -> TextField

Dart TextField(readOnly:).

Source

pub fn toolbar_options(self, toolbar_options: ToolbarOptions) -> TextField

👎Deprecated:

Use context_menu_builder instead.

Dart TextField(toolbarOptions:).

Source

pub fn show_cursor(self, show_cursor: bool) -> TextField

Dart TextField(showCursor:).

Source

pub fn autofocus(self, autofocus: bool) -> TextField

Dart TextField(autofocus:).

Source

pub fn states_controller( self, states_controller: Ref<MaterialStatesController>, ) -> TextField

Dart TextField(statesController:).

Source

pub fn obscuring_character( self, obscuring_character: impl Into<String>, ) -> TextField

Dart TextField(obscuringCharacter:).

Source

pub fn obscure_text(self, obscure_text: bool) -> TextField

Dart TextField(obscureText:).

Source

pub fn autocorrect(self, autocorrect: bool) -> TextField

Dart TextField(autocorrect:).

Source

pub fn smart_dashes_type(self, smart_dashes_type: SmartDashesType) -> TextField

Dart TextField(smartDashesType:).

Source

pub fn smart_quotes_type(self, smart_quotes_type: SmartQuotesType) -> TextField

Dart TextField(smartQuotesType:).

Source

pub fn enable_suggestions(self, enable_suggestions: bool) -> TextField

Dart TextField(enableSuggestions:).

Source

pub fn max_lines(self, max_lines: Option<i32>) -> TextField

Dart TextField(maxLines:).

Source

pub fn min_lines(self, min_lines: i32) -> TextField

Dart TextField(minLines:).

Source

pub fn expands(self, expands: bool) -> TextField

Dart TextField(expands:).

Source

pub fn max_length(self, max_length: i32) -> TextField

Dart TextField(maxLength:).

Source

pub fn max_length_enforcement( self, max_length_enforcement: MaxLengthEnforcement, ) -> TextField

Dart TextField(maxLengthEnforcement:).

Source

pub fn on_changed( self, on_changed: impl Fn(&mut App, String) + 'static, ) -> TextField

Dart TextField(onChanged:).

Source

pub fn on_editing_complete( self, on_editing_complete: impl Fn(&mut App) + 'static, ) -> TextField

Dart TextField(onEditingComplete:).

Source

pub fn on_submitted( self, on_submitted: impl Fn(&mut App, String) + 'static, ) -> TextField

Dart TextField(onSubmitted:).

Source

pub fn on_app_private_command( self, on_app_private_command: impl Fn(&mut App, &str) + 'static, ) -> TextField

Dart TextField(onAppPrivateCommand:).

Source

pub fn input_formatters( self, input_formatters: Vec<TextInputFormatterRef>, ) -> TextField

Dart TextField(inputFormatters:).

Source

pub fn enabled(self, enabled: bool) -> TextField

Dart TextField(enabled:).

Source

pub fn ignore_pointers(self, ignore_pointers: bool) -> TextField

Dart TextField(ignorePointers:).

Source

pub fn cursor_width(self, cursor_width: f64) -> TextField

Dart TextField(cursorWidth:).

Source

pub fn cursor_height(self, cursor_height: f64) -> TextField

Dart TextField(cursorHeight:).

Source

pub fn cursor_radius(self, cursor_radius: Radius) -> TextField

Dart TextField(cursorRadius:).

Source

pub fn cursor_opacity_animates(self, cursor_opacity_animates: bool) -> TextField

Dart TextField(cursorOpacityAnimates:).

Source

pub fn cursor_color(self, cursor_color: Color) -> TextField

Dart TextField(cursorColor:).

Source

pub fn cursor_error_color(self, cursor_error_color: Color) -> TextField

Dart TextField(cursorErrorColor:).

Source

pub fn selection_height_style( self, selection_height_style: BoxHeightStyle, ) -> TextField

Dart TextField(selectionHeightStyle:).

Source

pub fn selection_width_style( self, selection_width_style: BoxWidthStyle, ) -> TextField

Dart TextField(selectionWidthStyle:).

Source

pub fn keyboard_appearance(self, keyboard_appearance: Brightness) -> TextField

Dart TextField(keyboardAppearance:).

Source

pub fn scroll_padding(self, scroll_padding: EdgeInsets) -> TextField

Dart TextField(scrollPadding:).

Source

pub fn drag_start_behavior( self, drag_start_behavior: DragStartBehavior, ) -> TextField

Dart TextField(dragStartBehavior:).

Source

pub fn enable_interactive_selection( self, enable_interactive_selection: bool, ) -> TextField

Dart TextField(enableInteractiveSelection:).

Source

pub fn select_all_on_focus(self, select_all_on_focus: bool) -> TextField

Dart TextField(selectAllOnFocus:).

Source

pub fn selection_controls( self, selection_controls: Rc<dyn TextSelectionControls>, ) -> TextField

Dart TextField(selectionControls:).

Source

pub fn on_tap(self, on_tap: GestureTapCallback) -> TextField

Dart TextField(onTap:).

Source

pub fn on_tap_always_called(self, on_tap_always_called: bool) -> TextField

Dart TextField(onTapAlwaysCalled:).

Source

pub fn on_tap_outside( self, on_tap_outside: impl Fn(&mut App, PointerDownEvent) + 'static, ) -> TextField

Dart TextField(onTapOutside:).

Source

pub fn on_tap_up_outside( self, on_tap_up_outside: impl Fn(&mut App, PointerUpEvent) + 'static, ) -> TextField

Dart TextField(onTapUpOutside:).

Source

pub fn mouse_cursor(self, mouse_cursor: MouseCursorRef) -> TextField

Dart TextField(mouseCursor:).

Source

pub fn build_counter( self, build_counter: impl Fn(&mut App, BuildContext, i32, Option<i32>, bool) -> Option<WidgetRef> + 'static, ) -> TextField

Dart TextField(buildCounter:).

Source

pub fn scroll_controller( self, scroll_controller: ScrollControllerRef, ) -> TextField

Dart TextField(scrollController:).

Source

pub fn scroll_physics(self, scroll_physics: ScrollPhysicsRef) -> TextField

Dart TextField(scrollPhysics:).

Source

pub fn autofill_hints(self, autofill_hints: Vec<String>) -> TextField

Dart TextField(autofillHints:).

Source

pub fn content_insertion_configuration( self, content_insertion_configuration: ContentInsertionConfiguration, ) -> TextField

Dart TextField(contentInsertionConfiguration:).

Source

pub fn clip_behavior(self, clip_behavior: Clip) -> TextField

Dart TextField(clipBehavior:).

Source

pub fn restoration_id(self, restoration_id: impl Into<String>) -> TextField

Dart TextField(restorationId:).

Source

pub fn scribble_enabled(self, scribble_enabled: bool) -> TextField

👎Deprecated:

Use stylus_handwriting_enabled instead.

Dart TextField(scribbleEnabled:).

Source

pub fn stylus_handwriting_enabled( self, stylus_handwriting_enabled: bool, ) -> TextField

Dart TextField(stylusHandwritingEnabled:).

Source

pub fn enable_ime_personalized_learning( self, enable_ime_personalized_learning: bool, ) -> TextField

Dart TextField(enableIMEPersonalizedLearning:).

Source

pub fn enable_inline_prediction( self, enable_inline_prediction: bool, ) -> TextField

Dart TextField(enableInlinePrediction:).

Source

pub fn context_menu_builder( self, context_menu_builder: Option<EditableTextContextMenuBuilder>, ) -> TextField

Dart TextField(contextMenuBuilder:).

Source

pub fn can_request_focus(self, can_request_focus: bool) -> TextField

Dart TextField(canRequestFocus:).

Source

pub fn spell_check_configuration( self, spell_check_configuration: SpellCheckConfiguration, ) -> TextField

Dart TextField(spellCheckConfiguration:).

Source

pub fn magnifier_configuration( self, magnifier_configuration: TextMagnifierConfiguration, ) -> TextField

Dart TextField(magnifierConfiguration:).

Source

pub fn hint_locales(self, hint_locales: Vec<Locale>) -> TextField

Dart TextField(hintLocales:).

Source

pub fn effective_keyboard_type(&self) -> TextInputType

Dart’s keyboardType field, as its constructor fills it.

Source

pub fn effective_smart_dashes_type(&self) -> SmartDashesType

Dart’s smartDashesType field, as its constructor fills it.

Source

pub fn effective_smart_quotes_type(&self) -> SmartQuotesType

Dart’s smartQuotesType field, as its constructor fills it.

Source

pub fn effective_enable_interactive_selection(&self) -> bool

Dart’s enableInteractiveSelection field, as its constructor fills it.

Source

pub fn selection_enabled(&self) -> bool

{@macro flutter.widgets.editableText.selectionEnabled}

Source

pub fn material_misspelled_text_style() -> TextStyle

The TextStyle used to indicate misspelled words in the Material style.

See also:

Source

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:

Source

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 Clone for TextField

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TextField

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TextField

Source§

fn default() -> TextField

Returns the “default value” for a type. Read more
Source§

impl StatefulWidget for TextField

Source§

type State = TextFieldState

The state this widget creates.
Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn debug_fill_properties( &self, app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s 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 debug_check_constructor(&self)

Source§

fn create_state(&self) -> TextFieldState

Creates the mutable state for this widget at a given location in the tree. Read more
Source§

fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>

Source§

fn type_name(&self) -> &'static str

See 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 TextField
where *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 TextField
where 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 TextField
where *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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<W> IntoWidget<StatefulKind> for W
where W: StatefulWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>