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: TextInputActionThe text input action configuring the soft keyboard to a particular action button.
Defaults to TextInputAction::Search.
autocorrect: boolWhether to enable autocorrection in the search field. Defaults to true.
enable_suggestions: boolWhether to show input suggestions as the user types in the search field. Defaults to true.
Implementations§
Source§impl SearchDelegateData
impl SearchDelegateData
Sourcepub fn new(app: &mut App) -> SearchDelegateData
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.
Sourcepub fn search_field_label(
self,
search_field_label: impl Into<String>,
) -> SearchDelegateData
pub fn search_field_label( self, search_field_label: impl Into<String>, ) -> SearchDelegateData
Dart SearchDelegate(searchFieldLabel:).
Sourcepub fn search_field_style(
self,
search_field_style: TextStyle,
) -> SearchDelegateData
pub fn search_field_style( self, search_field_style: TextStyle, ) -> SearchDelegateData
Dart SearchDelegate(searchFieldStyle:).
Sourcepub fn search_field_decoration_theme(
self,
search_field_decoration_theme: InputDecorationThemeData,
) -> SearchDelegateData
pub fn search_field_decoration_theme( self, search_field_decoration_theme: InputDecorationThemeData, ) -> SearchDelegateData
Dart SearchDelegate(searchFieldDecorationTheme:).
Sourcepub fn keyboard_type(self, keyboard_type: TextInputType) -> SearchDelegateData
pub fn keyboard_type(self, keyboard_type: TextInputType) -> SearchDelegateData
Dart SearchDelegate(keyboardType:).
Sourcepub fn text_input_action(
self,
text_input_action: TextInputAction,
) -> SearchDelegateData
pub fn text_input_action( self, text_input_action: TextInputAction, ) -> SearchDelegateData
Dart SearchDelegate(textInputAction:).
Sourcepub fn autocorrect(self, autocorrect: bool) -> SearchDelegateData
pub fn autocorrect(self, autocorrect: bool) -> SearchDelegateData
Dart SearchDelegate(autocorrect:).
Sourcepub fn enable_suggestions(self, enable_suggestions: bool) -> SearchDelegateData
pub fn enable_suggestions(self, enable_suggestions: bool) -> SearchDelegateData
Dart SearchDelegate(enableSuggestions:).
Sourcepub fn automatically_imply_leading(&self) -> Option<bool>
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.
Sourcepub fn set_automatically_imply_leading(&self, value: Option<bool>)
pub fn set_automatically_imply_leading(&self, value: Option<bool>)
Sourcepub fn leading_width(&self) -> Option<f64>
pub fn leading_width(&self) -> Option<f64>
Dart’s SearchDelegate.leadingWidth: the width of the app bar’s leading widget.
Sourcepub fn set_leading_width(&self, value: Option<f64>)
pub fn set_leading_width(&self, value: Option<f64>)
Sets leading_width.