Skip to main content

SearchDelegateData

Struct SearchDelegateData 

Source
pub struct SearchDelegateData {
    pub search_field_label: Option<String>,
    pub search_field_style: Option<TextStyle>,
    pub search_field_decoration_theme: Option<InputDecorationThemeData>,
    pub keyboard_type: Option<TextInputType>,
    pub text_input_action: TextInputAction,
    pub autocorrect: bool,
    pub enable_suggestions: bool,
    /* private fields */
}
Expand description

The state of a SearchDelegate that Dart keeps in the delegate’s fields: every delegate holds one, and answers it from SearchDelegate::search_delegate_data.

The fields Dart gives as constructor arguments are plain fields; the setters (automatically_imply_leading, leading_width) are for what Dart leaves mutable.

Fields§

§search_field_label: Option<String>

The hint text shown in the search field when it is empty.

If this value is set to None, the value of MaterialLocalizations::search_field_label will be used instead.

§search_field_style: Option<TextStyle>

The style of the search_field_label.

If this value is set to None, the value of the ambient Theme’s InputDecorationThemeData.hint_style will be used instead.

Only one of search_field_style or search_field_decoration_theme can be non-None.

§search_field_decoration_theme: Option<InputDecorationThemeData>

The InputDecorationThemeData used to configure the search field’s visuals.

Only one of search_field_style or search_field_decoration_theme can be non-None.

§keyboard_type: Option<TextInputType>

The type of action button to use for the keyboard.

Defaults to the default value specified in TextField.

§text_input_action: TextInputAction

The text input action configuring the soft keyboard to a particular action button.

Defaults to TextInputAction::Search.

§autocorrect: bool

Whether to enable autocorrection in the search field. Defaults to true.

§enable_suggestions: bool

Whether to show input suggestions as the user types in the search field. Defaults to true.

Implementations§

Source§

impl SearchDelegateData

Source

pub fn new(app: &mut App) -> SearchDelegateData

Creates the state of a delegate; Dart’s SearchDelegate({searchFieldLabel, searchFieldStyle, searchFieldDecorationTheme, keyboardType, textInputAction, autocorrect, enableSuggestions}) arguments are the setters.

Source

pub fn search_field_label( self, search_field_label: impl Into<String>, ) -> SearchDelegateData

Dart SearchDelegate(searchFieldLabel:).

Source

pub fn search_field_style( self, search_field_style: TextStyle, ) -> SearchDelegateData

Dart SearchDelegate(searchFieldStyle:).

Source

pub fn search_field_decoration_theme( self, search_field_decoration_theme: InputDecorationThemeData, ) -> SearchDelegateData

Dart SearchDelegate(searchFieldDecorationTheme:).

Source

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

Dart SearchDelegate(keyboardType:).

Source

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

Dart SearchDelegate(textInputAction:).

Source

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

Dart SearchDelegate(autocorrect:).

Source

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

Dart SearchDelegate(enableSuggestions:).

Source

pub fn automatically_imply_leading(&self) -> Option<bool>

Dart’s SearchDelegate.automaticallyImplyLeading: whether the app bar of the search page implies a leading widget. When None, it is true.

Source

pub fn set_automatically_imply_leading(&self, value: Option<bool>)

Source

pub fn leading_width(&self) -> Option<f64>

Dart’s SearchDelegate.leadingWidth: the width of the app bar’s leading widget.

Source

pub fn set_leading_width(&self, value: Option<f64>)

Auto Trait Implementations§

§

impl !Freeze for SearchDelegateData

§

impl !RefUnwindSafe for SearchDelegateData

§

impl !Send for SearchDelegateData

§

impl !Sync for SearchDelegateData

§

impl !UnwindSafe for SearchDelegateData

§

impl Forget for SearchDelegateData

§

impl Move for SearchDelegateData

§

impl Unpin for SearchDelegateData

§

impl UnsafeUnpin for SearchDelegateData

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> 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<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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>