Skip to content
Boring Doc
DeprecatedMedium impactOfficial migration guidesince 3.32.0landed 3.29.0-0.3.pre

Deprecate SystemContextMenuController.show

Framework · Official source

`SystemContextMenuController.show` is deprecated. The same functionality can be achieved by passing the result of calling `SystemContextMenu.getDefaultItems` to `SystemContextMenuController.showWithItems`.

Who is affected
Code that still calls the deprecated API; it keeps working until removal but produces analyzer warnings. Code that uses SystemContextMenuController.show, SystemContextMenu.getDefaultItems, SystemContextMenuController.showWithItems and related APIs.
Practical impact
Warnings now; removal in a future release. Plan the migration but no immediate break.
What action should I take?
Follow the official migration guide below, update affected call sites, run `dart fix --apply` where a fix is available, then run your tests.

Before and after (from the official guide)

dart+10−1
Before
1−_controller.show(selectionRect);
 
 
 
 
 
 
 
 
 
After
1+final List<IOSSystemContextMenuItem> defaultItems =
2+ SystemContextMenu.getDefaultItems(editableTextState);
3+final WidgetsLocalizations localizations =
4+ WidgetsLocalizations.of(context);
5+final List<IOSSystemContextMenuItemData> defaultItemData =
6+ defaultItems
7+ .map((IOSSystemContextMenuItem item) =>
8+ item.getData(localizations))
9+ .toList();
10+_controller.showWithItems(selectionRect, defaultItemData);
Raw before / after
_controller.show(selectionRect);
final List<IOSSystemContextMenuItem> defaultItems =
    SystemContextMenu.getDefaultItems(editableTextState);
final WidgetsLocalizations localizations =
    WidgetsLocalizations.of(context);
final List<IOSSystemContextMenuItemData> defaultItemData =
    defaultItems
        .map((IOSSystemContextMenuItem item) =>
            item.getData(localizations))
        .toList();
_controller.showWithItems(selectionRect, defaultItemData);
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)

Most users use the system context menu through the SystemContextMenu widget, and in this case there will be no change required. The SystemContextMenu widget automatically gets the default items under the hood.

No migration is needed:

class _MyWidgetState extends State&#x3C;MyWidget> {
  @override
  Widget build(BuildContext context) {
    TextField(
      contextMenuBuilder: (BuildContext context, EditableTextState editableTextState) {
        return SystemContextMenu.editableText(
          editableTextState: editableTextState,
        );
      }
    );
  }
}

For advanced users that directly work with SystemContextMenuController, migrate to the new method SystemContextMenuController.showWithItems. The default can be obtained from SystemContextMenu.getDefaultItems as a list of IOSSystemContextMenuItems, which can be converted to the format required by showWithItems through IOSSystemContextMenuItem.getData.

Code before migration:

_controller.show(selectionRect);

Code after migration:

final List&#x3C;IOSSystemContextMenuItem> defaultItems =
    SystemContextMenu.getDefaultItems(editableTextState);
final WidgetsLocalizations localizations =
    WidgetsLocalizations.of(context);
final List&#x3C;IOSSystemContextMenuItemData> defaultItemData =
    defaultItems
        .map((IOSSystemContextMenuItem item) =>
            item.getData(localizations))
        .toList();
_controller.showWithItems(selectionRect, defaultItemData);
Migration assistantAI-generated · grounded in cited sources
AI explanations are not configured
Set AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.
Official migration guide·Verified classification (90%)

Listed in the official breaking-changes index; title states deprecation.

An official announcement or migration guide documents an intended behaviour or API change. A verified source change (git diff) shows code changed but does not by itself prove a public API is breaking. AI interpretations are labelled and never used to classify a change.

Source commit
b3045439b7c0
Source last updated
Oct 21, 2026
Last synchronized
Oct 21, 2026
Publication status
published
Publication history
  • Oct 21, 2026, 8:31 PM: new → published (ingestion) — Backed by an official breaking-change/migration guide.
AI explanationAI-generated · grounded in cited sources
AI explanations are not configured
Set AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.
Was this useful?