inferIOSSpellCheckConfiguration static method

ExtendedSpellCheckConfiguration inferIOSSpellCheckConfiguration(
  1. ExtendedSpellCheckConfiguration? configuration
)

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

Implementation

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

  return configuration.copyWith(
    misspelledTextStyle: configuration.misspelledTextStyle ??
        CupertinoTextField.cupertinoMisspelledTextStyle,
    misspelledSelectionColor: configuration.misspelledSelectionColor ??
        // ignore: invalid_use_of_visible_for_testing_member
        CupertinoTextField.kMisspelledSelectionColor,
    extendedSpellCheckSuggestionsToolbarBuilder:
        configuration.extendedSpellCheckSuggestionsToolbarBuilder ??
            defaultIosSpellCheckSuggestionsToolbarBuilder,
    // spellCheckSuggestionsToolbarBuilder:
    //   configuration.spellCheckSuggestionsToolbarBuilder
    //     ?? CupertinoTextField.defaultSpellCheckSuggestionsToolbarBuilder,
  ) as ExtendedSpellCheckConfiguration;
}