@@ -869,6 +869,13 @@ class ShortcutManager with Diagnosticable, ChangeNotifier {
869869/// when invoking an [Action] via a keyboard key combination that maps to an
870870/// [Intent] .
871871///
872+ /// This is similar to but more powerful than the [CallbackShortcuts] widget.
873+ /// Unlike [CallbackShortcuts] , this widget separates key bindings and their
874+ /// implementations. This separation allows [Shortcuts] to have key bindings
875+ /// that adapt to the focused context. For example, the desired action for a
876+ /// deletion intent may be to delete a character in a text input, or to delete
877+ /// a file in a file menu.
878+ ///
872879/// See the article on [Using Actions and
873880/// Shortcuts](https://docs.flutter.dev/development/ui/advanced/actions_and_shortcuts)
874881/// for a detailed explanation.
@@ -903,8 +910,8 @@ class ShortcutManager with Diagnosticable, ChangeNotifier {
903910///
904911/// See also:
905912///
906- /// * [CallbackShortcuts] , a less complicated ( but less flexible) way of
907- /// defining key bindings that just invoke callbacks.
913+ /// * [CallbackShortcuts] , a simpler but less flexible widget that defines key
914+ /// bindings that invoke callbacks.
908915/// * [Intent] , a class for containing a description of a user action to be
909916/// invoked.
910917/// * [Action] , a class for defining an invocation of a user action.
@@ -1038,32 +1045,32 @@ class _ShortcutsState extends State<Shortcuts> {
10381045 }
10391046}
10401047
1041- /// A widget that provides an uncomplicated mechanism for binding a key
1042- /// combination to a specific callback.
1043- ///
1044- /// This is similar to the functionality provided by the [Shortcuts] widget, but
1045- /// instead of requiring a mapping to an [Intent] , and an [Actions] widget
1046- /// somewhere in the widget tree to bind the [Intent] to, it just takes a set of
1047- /// bindings that bind the key combination directly to a [VoidCallback] .
1048+ /// A widget that binds key combinations to specific callbacks.
10481049///
1049- /// Because it is a simpler mechanism, it doesn't provide the ability to disable
1050- /// the callbacks, or to separate the definition of the shortcuts from the
1051- /// definition of the code that is triggered by them (the role that actions play
1052- /// in the [Shortcuts] /[Actions] system).
1050+ /// This is similar to but simpler than the [Shortcuts] widget as it doesn't
1051+ /// require [Intent] s and [Actions] widgets. Instead, it accepts a map
1052+ /// of [ShortcutActivator] s to [VoidCallback] s.
10531053///
1054- /// However, for some applications the complexity and flexibility of the
1055- /// [Shortcuts] and [Actions] mechanism is overkill, and this widget is here for
1056- /// those apps.
1054+ /// Unlike [Shortcuts] , this widget does not separate key bindings and their
1055+ /// implementations. This separation allows [Shortcuts] to have key bindings
1056+ /// that adapt to the focused context. For example, the desired action for a
1057+ /// deletion intent may be to delete a character in a text input, or to delete
1058+ /// a file in a file menu.
10571059///
10581060/// [Shortcuts] and [CallbackShortcuts] can both be used in the same app. As
10591061/// with any key handling widget, if this widget handles a key event then
10601062/// widgets above it in the focus chain will not receive the event. This means
10611063/// that if this widget handles a key, then an ancestor [Shortcuts] widget (or
1062- /// any other key handling widget) will not receive that key, and similarly , if
1064+ /// any other key handling widget) will not receive that key. Similarly , if
10631065/// a descendant of this widget handles the key, then the key event will not
10641066/// reach this widget for handling.
10651067///
1068+ /// See the article on [Using Actions and
1069+ /// Shortcuts](https://docs.flutter.dev/development/ui/advanced/actions_and_shortcuts)
1070+ /// for a detailed explanation.
1071+ ///
10661072/// See also:
1073+ /// * [Shortcuts] , a more powerful widget for defining key bindings.
10671074/// * [Focus] , a widget that defines which widgets can receive keyboard focus.
10681075class CallbackShortcuts extends StatelessWidget {
10691076 /// Creates a const [CallbackShortcuts] widget.
0 commit comments