pub struct SpellCheckConfiguration {
pub spell_check_service: Option<Rc<dyn SpellCheckService>>,
pub misspelled_selection_color: Option<Color>,
pub misspelled_text_style: Option<TextStyle>,
pub spell_check_suggestions_toolbar_builder: Option<EditableTextContextMenuBuilder>,
/* private fields */
}Expand description
Controls how spell check is performed for text input.
This configuration determines the SpellCheckService used to fetch the
SuggestionSpan spell check results and the TextStyle used to
mark misspelled words within text input.
Fields§
§spell_check_service: Option<Rc<dyn SpellCheckService>>The service used to fetch spell check results for text input.
misspelled_selection_color: Option<Color>The color the paint the selection highlight when spell check is showing suggestions for a misspelled word.
For example, on iOS, the selection appears red while the spell check menu is showing.
misspelled_text_style: Option<TextStyle>Style used to indicate misspelled words.
This is nullable to allow style-specific wrappers of EditableText
to infer this, but this must be specified if this configuration is
provided directly to EditableText or its construction will fail with an
assertion error.
spell_check_suggestions_toolbar_builder: Option<EditableTextContextMenuBuilder>Builds the toolbar used to display spell check suggestions for misspelled words.
Implementations§
Source§impl SpellCheckConfiguration
impl SpellCheckConfiguration
Sourcepub const fn new() -> SpellCheckConfiguration
pub const fn new() -> SpellCheckConfiguration
Creates a configuration that specifies the service and suggestions handler for spell check.
Sourcepub const fn disabled() -> SpellCheckConfiguration
pub const fn disabled() -> SpellCheckConfiguration
Creates a configuration that disables spell check.
Sourcepub fn spell_check_service(
self,
spell_check_service: Rc<dyn SpellCheckService>,
) -> SpellCheckConfiguration
pub fn spell_check_service( self, spell_check_service: Rc<dyn SpellCheckService>, ) -> SpellCheckConfiguration
Dart SpellCheckConfiguration(spellCheckService:).
Sourcepub fn misspelled_selection_color(
self,
misspelled_selection_color: Color,
) -> SpellCheckConfiguration
pub fn misspelled_selection_color( self, misspelled_selection_color: Color, ) -> SpellCheckConfiguration
Dart SpellCheckConfiguration(misspelledSelectionColor:).
Sourcepub fn misspelled_text_style(
self,
misspelled_text_style: TextStyle,
) -> SpellCheckConfiguration
pub fn misspelled_text_style( self, misspelled_text_style: TextStyle, ) -> SpellCheckConfiguration
Dart SpellCheckConfiguration(misspelledTextStyle:).
Sourcepub fn spell_check_suggestions_toolbar_builder(
self,
spell_check_suggestions_toolbar_builder: EditableTextContextMenuBuilder,
) -> SpellCheckConfiguration
pub fn spell_check_suggestions_toolbar_builder( self, spell_check_suggestions_toolbar_builder: EditableTextContextMenuBuilder, ) -> SpellCheckConfiguration
Dart SpellCheckConfiguration(spellCheckSuggestionsToolbarBuilder:).
Sourcepub fn spell_check_enabled(&self) -> bool
pub fn spell_check_enabled(&self) -> bool
Whether or not the configuration should enable or disable spell check.
Sourcepub fn copy_with(&self) -> SpellCheckConfiguration
pub fn copy_with(&self) -> SpellCheckConfiguration
Returns a copy of the current SpellCheckConfiguration instance with
specified overrides.
If this configuration is disabled, returns SpellCheckConfiguration::disabled.
Chain setters: config.copy_with().misspelled_text_style(style).