defaultSpellCheckSuggestionsToolbarBuilder static method

  1. @visibleForTesting
Widget defaultSpellCheckSuggestionsToolbarBuilder(
  1. BuildContext context,
  2. EditableTextState editableTextState
)

Default builder for TextField's spell check suggestions toolbar.

On Apple platforms, builds an iOS-style toolbar. Everywhere else, builds an Android-style toolbar.

See also:

Implementation

@visibleForTesting
static Widget defaultSpellCheckSuggestionsToolbarBuilder(
  BuildContext context,
  EditableTextState editableTextState,
) {
  switch (defaultTargetPlatform) {
    case TargetPlatform.iOS:
    case TargetPlatform.macOS:
      return CupertinoSpellCheckSuggestionsToolbar.editableText(
        editableTextState: editableTextState,
      );
    case TargetPlatform.android:
    case TargetPlatform.fuchsia:
    case TargetPlatform.linux:
    case TargetPlatform.windows:
      return SpellCheckSuggestionsToolbar.editableText(
        editableTextState: editableTextState,
      );
  }
}