inferIOSSpellCheckConfiguration static method

SpellCheckConfiguration inferIOSSpellCheckConfiguration(
  1. SpellCheckConfiguration? configuration
)

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

Implementation

static SpellCheckConfiguration inferIOSSpellCheckConfiguration(
  SpellCheckConfiguration? configuration,
) {
  if (configuration == null ||
      configuration == const SpellCheckConfiguration.disabled()) {
    return const SpellCheckConfiguration.disabled();
  }

  return configuration.copyWith(
    misspelledTextStyle: configuration.misspelledTextStyle ??
        CupertinoInput.cupertinoMisspelledTextStyle,
    misspelledSelectionColor: configuration.misspelledSelectionColor ??
        CupertinoInput.kMisspelledSelectionColor,
    spellCheckSuggestionsToolbarBuilder:
        configuration.spellCheckSuggestionsToolbarBuilder ??
            CupertinoInput.defaultSpellCheckSuggestionsToolbarBuilder,
  );
}