inferAndroidSpellCheckConfiguration static method

SpellCheckConfiguration inferAndroidSpellCheckConfiguration(
  1. SpellCheckConfiguration? configuration
)

Returns a new SpellCheckConfiguration where the given configuration has had any missing values replaced with their defaults for the Android platform.

Implementation

static SpellCheckConfiguration inferAndroidSpellCheckConfiguration(
  SpellCheckConfiguration? configuration,
) {
  if (configuration == null
    || configuration == const SpellCheckConfiguration.disabled()) {
    return const SpellCheckConfiguration.disabled();
  }
  return configuration.copyWith(
    misspelledTextStyle: configuration.misspelledTextStyle
      ?? TextField.materialMisspelledTextStyle,
    spellCheckSuggestionsToolbarBuilder:
      configuration.spellCheckSuggestionsToolbarBuilder
        ?? TextField.defaultSpellCheckSuggestionsToolbarBuilder,
  );
}