From d7f06363cc500a49db5ee7a15ba5c01162d891f6 Mon Sep 17 00:00:00 2001 From: Darien Romero Leiva Date: Tue, 18 Mar 2025 03:11:20 -0500 Subject: [PATCH] Add documentation for the secondary button (#164555) In this PR, I've added extra comments about what the Secondary Button is, and in what cases it can be activated. Issue https://github.com/flutter/flutter/issues/123049 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md --------- Co-authored-by: Darien Romero --- .../flutter/lib/src/material/ink_well.dart | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/flutter/lib/src/material/ink_well.dart b/packages/flutter/lib/src/material/ink_well.dart index 27fcf4f248..8a4b6f9352 100644 --- a/packages/flutter/lib/src/material/ink_well.dart +++ b/packages/flutter/lib/src/material/ink_well.dart @@ -365,18 +365,36 @@ class InkResponse extends StatelessWidget { final GestureLongPressCallback? onLongPress; /// Called when the user taps this part of the material with a secondary button. + /// + /// See also: + /// + /// * [kSecondaryButton], the button this callback responds to. final GestureTapCallback? onSecondaryTap; /// Called when the user taps down on this part of the material with a /// secondary button. + /// + /// See also: + /// + /// * [kSecondaryButton], the button this callback responds to. final GestureTapDownCallback? onSecondaryTapDown; /// Called when the user releases a secondary button tap that was started on /// this part of the material. [onSecondaryTap] is called immediately after. + /// + /// See also: + /// + /// * [onSecondaryTap], a handler triggered right after this one that doesn't + /// pass any details about the tap. + /// * [kSecondaryButton], the button this callback responds to. final GestureTapUpCallback? onSecondaryTapUp; /// Called when the user cancels a secondary button tap that was started on /// this part of the material. + /// + /// See also: + /// + /// * [kSecondaryButton], the button this callback responds to. final GestureTapCallback? onSecondaryTapCancel; /// Called when this part of the material either becomes highlighted or stops