From 8856ccb84401eac0f12c5916ba9b59f115921267 Mon Sep 17 00:00:00 2001 From: Justin McCandless Date: Mon, 13 Jan 2025 11:27:17 -0800 Subject: [PATCH] Context menu button callback docs clarification (#161451) This PR updates the context menu button callback docs to clarify that they are only called when their button is tapped, not when their action happens any other way. There seemed to be confusion about this in https://github.com/flutter/flutter/issues/117329 and https://github.com/flutter/flutter/issues/160908. Fixes https://github.com/flutter/flutter/issues/160908. --- .../lib/src/material/adaptive_text_selection_toolbar.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/material/adaptive_text_selection_toolbar.dart b/packages/flutter/lib/src/material/adaptive_text_selection_toolbar.dart index 483c6f5897..28bf25d668 100644 --- a/packages/flutter/lib/src/material/adaptive_text_selection_toolbar.dart +++ b/packages/flutter/lib/src/material/adaptive_text_selection_toolbar.dart @@ -90,7 +90,13 @@ class AdaptiveTextSelectionToolbar extends StatelessWidget { /// Create an instance of [AdaptiveTextSelectionToolbar] with the default /// children for an editable field. /// - /// If a callback is null, then its corresponding button will not be built. + /// If an on* callback parameter is null, then its corresponding button will + /// not be built. + /// + /// These callbacks are called when their corresponding button is activated + /// and only then. For example, `onPaste` is called when the user taps the + /// "Paste" button in the context menu and not when the user pastes with the + /// keyboard. /// /// See also: ///