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.
This commit is contained in:
Justin McCandless
2025-01-13 11:27:17 -08:00
committed by GitHub
parent 5bd65c434a
commit 8856ccb844

View File

@@ -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:
///