@@ -1092,30 +1092,25 @@ class _FocusableActionDetectorState extends State<FocusableActionDetector> {
10921092
10931093 @override
10941094 Widget build (BuildContext context) {
1095- final Map <Type , Action <Intent >> actions = widget.enabled && widget.actions != null
1096- ? widget.actions
1097- : const < Type , Action <Intent >> {};
1098- final Map <LogicalKeySet , Intent > shortcuts = widget.enabled && widget.shortcuts != null
1099- ? widget.shortcuts
1100- : const < LogicalKeySet , Intent > {};
1101-
1102- return Actions (actions: actions,
1103- child: Shortcuts (
1104- shortcuts: shortcuts,
1105- child: MouseRegion (
1106- onEnter: _handleMouseEnter,
1107- onExit: _handleMouseExit,
1108- cursor: widget.mouseCursor,
1109- child: Focus (
1110- focusNode: widget.focusNode,
1111- autofocus: widget.autofocus,
1112- canRequestFocus: _canRequestFocus,
1113- onFocusChange: _handleFocusChange,
1114- child: widget.child,
1115- ),
1116- ),
1095+ Widget child = MouseRegion (
1096+ onEnter: _handleMouseEnter,
1097+ onExit: _handleMouseExit,
1098+ cursor: widget.mouseCursor,
1099+ child: Focus (
1100+ focusNode: widget.focusNode,
1101+ autofocus: widget.autofocus,
1102+ canRequestFocus: _canRequestFocus,
1103+ onFocusChange: _handleFocusChange,
1104+ child: widget.child,
11171105 ),
11181106 );
1107+ if (widget.enabled && widget.actions != null && widget.actions.isNotEmpty) {
1108+ child = Actions (actions: widget.actions, child: child);
1109+ }
1110+ if (widget.enabled && widget.shortcuts != null && widget.shortcuts.isNotEmpty) {
1111+ child = Shortcuts (shortcuts: widget.shortcuts, child: child);
1112+ }
1113+ return child;
11191114 }
11201115}
11211116
0 commit comments