pub struct DefaultSpellCheckService {
pub last_saved_results: Option<SpellCheckResults>,
}Expand description
The service used by default to fetch spell check results for text input.
Any widget may use this service to spell check text by calling
fetch_spell_check_suggestions with an
instance of this class. This is currently only supported by Android and iOS.
See also:
SpellCheckService, the service that this implements that may be overridden for use byEditableText.EditableText, which may use this service to fetch results.
Fields§
§last_saved_results: Option<SpellCheckResults>The last received results from the shell side.
Implementations§
Source§impl DefaultSpellCheckService
impl DefaultSpellCheckService
Sourcepub fn new() -> DefaultSpellCheckService
pub fn new() -> DefaultSpellCheckService
Creates service to spell check text input by default.
Sourcepub fn merge_results(
old_results: &[SuggestionSpan],
new_results: &[SuggestionSpan],
) -> Vec<SuggestionSpan>
pub fn merge_results( old_results: &[SuggestionSpan], new_results: &[SuggestionSpan], ) -> Vec<SuggestionSpan>
Merges two lists of spell check SuggestionSpans.
Used in cases where the text has not changed, but the spell check results received from the shell side have. This case is caused by IMEs (GBoard, for instance) that ignore the composing region when spell checking text.
Assumes that the lists provided as parameters are sorted by range start
and that both list of SuggestionSpans apply to the same text.