Unverified Commit 3e7e01c8 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Remove extraneous InheritedWidget (#104676)

When I removed Shortcuts.of and Shortcuts.maybeOf, I forgot to also remove the associated InheritedWidget. This does that.
parent be7a4227
......@@ -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<Shortcuts> {
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.
///
......
......@@ -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'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment