diff --git a/packages/flutter/lib/src/widgets/shortcuts.dart b/packages/flutter/lib/src/widgets/shortcuts.dart index a5d84f4a37dd..2179da4d4421 100644 --- a/packages/flutter/lib/src/widgets/shortcuts.dart +++ b/packages/flutter/lib/src/widgets/shortcuts.dart @@ -860,7 +860,7 @@ class Shortcuts extends StatefulWidget { /// If this widget was created with [Shortcuts.manager], then /// [ShortcutManager.shortcuts] will be used as the source for shortcuts. If /// the unnamed constructor is used, this manager will be null, and a - /// default-constructed `ShortcutsManager` will be used. + /// default-constructed [ShortcutManager] will be used. final ShortcutManager? manager; /// {@template flutter.widgets.shortcuts.shortcuts} @@ -944,29 +944,11 @@ class _ShortcutsState extends State { debugLabel: '$Shortcuts', canRequestFocus: false, onKey: _handleOnKey, - child: _ShortcutsMarker( - manager: manager, - child: widget.child, - ), + child: widget.child, ); } } -class _ShortcutsMarker extends InheritedWidget { - const _ShortcutsMarker({ - required this.manager, - required super.child, - }) : assert(manager != null), - assert(child != null); - - final ShortcutManager manager; - - @override - bool updateShouldNotify(_ShortcutsMarker oldWidget) { - return manager != oldWidget.manager; - } -} - /// A widget that provides an uncomplicated mechanism for binding a key /// combination to a specific callback. /// diff --git a/packages/flutter/test/material/debug_test.dart b/packages/flutter/test/material/debug_test.dart index 554393780a5d..ef90ff95c038 100644 --- a/packages/flutter/test/material/debug_test.dart +++ b/packages/flutter/test/material/debug_test.dart @@ -187,7 +187,6 @@ void main() { ' MediaQuery\n' ' _MediaQueryFromWindow\n' ' _ShortcutRegistrarMarker\n' - ' _ShortcutsMarker\n' ' Semantics\n' ' _FocusMarker\n' ' Focus\n' @@ -200,19 +199,16 @@ void main() { ' _ActionsMarker\n' ' Actions\n' '${kIsWeb - ? ' _ShortcutsMarker\n' - ' Semantics\n' + ? ' Semantics\n' ' _FocusMarker\n' ' Focus\n' ' Shortcuts\n' : ''}' - ' _ShortcutsMarker\n' ' Semantics\n' ' _FocusMarker\n' ' Focus\n' ' Shortcuts\n' ' DefaultTextEditingShortcuts\n' - ' _ShortcutsMarker\n' ' Semantics\n' ' _FocusMarker\n' ' Focus\n'