defaultSpellCheckSuggestionsToolbarBuilder static method
- BuildContext context,
- 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:
- spellCheckConfiguration, where this is typically specified for TextField.
- SpellCheckConfiguration.spellCheckSuggestionsToolbarBuilder, the parameter for which this is the default value for TextField.
- CupertinoTextField.defaultSpellCheckSuggestionsToolbarBuilder, which is like this but specifies the default for CupertinoTextField.
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,
);
}
}