Repository navigation
Description
Steps to reproduce
- Register an
Actionfor a customIntentsubtype via anActionswidget:Actions( actions: <Type, Action<Intent>>{ MyIntent: CallbackAction<MyIntent>(onInvoke: (intent) { ... }), }, child: ..., )
- Further down the tree, resolve a callback with:
final callback = Actions.handler(context, MyIntent(...));
callbackis alwaysnull, even though a matchingActionsancestor exists.
Expected results
Actions.handler<T>() finds the registered Action<T> for the intent's runtime type and returns a working VoidCallback, as it did before 3.47.0.
Actual results
Actions.handler always returns null.
Root cause
Actions.handler (packages/flutter/lib/src/widgets/actions.dart) was changed by #180883 ("Fix some type checks in the Actions widget") from:
static VoidCallback? handler<T extends Intent>(BuildContext context, T intent) {
final Action<T>? action = Actions.maybeFind<T>(context);
...
}to:
static VoidCallback? handler<T extends Intent>(BuildContext context, T intent) {
final Action<Intent>? action = Actions.maybeFind(context);
...
}The new call no longer passes an explicit type argument <T> nor the intent: parameter. Dart's downward type inference resolves maybeFind's type parameter from the declared local variable type (Action<Intent>?), so it infers T = Intent instead of the caller's actual intent type. Inside maybeFind -> _getActionForIntent<T>, the lookup key becomes:
actionsMarker.actions[intent?.runtimeType ?? T]Since intent was never forwarded, this evaluates to actionsMarker.actions[Intent] (the literal Intent type) instead of the registered subtype key (e.g. MyIntent). Apps register actions keyed by their concrete Intent subtype, not by Intent itself, so the lookup always misses and Actions.handler returns null universally, for any intent type.
Actions.invoke / Actions.maybeInvoke are unaffected, since they forward intent directly to _getActionForIntent.
Suggested fix
Forward the intent and type explicitly in Actions.handler:
static VoidCallback? handler<T extends Intent>(BuildContext context, T intent) {
final Action<Intent>? action = Actions.maybeFind<T>(context, intent: intent);
...
}Flutter/Dart/Device info
Flutter 3.47.0 • channel stable • revision 4cf24164269a5ebf0c16a028a00727d0e77bbb05
Engine • revision 5f77625673248ee5846fbcaf5d3e1a3878386fd7
Dart 3.13.0
Regressed by commit f7689c7 (#180883), first shipped in 3.47.0-0.1.pre, present in 3.47.0 stable.
Activity
suryaKommana2662 commentedon Aug 13, 2026
@adam-langley-minrisk Thanks for the detailed report. I was able to reproduce the issue on Flutter 3.47.0. With the reproduction below, Actions.handler returns null, and the terminal prints:
Actions.handler returned: nullI also tested the same reproduction on Flutter 3.44.8, where I was unable to reproduce the issue and Actions.handler returned a non-null callback as expected.
Here is the reproduction code I used:
Flutter Doctor Output
Fix Actions.handler to forward the intent type to maybeFind
TomKrauss commentedon Aug 19, 2026
This is breaking a large part of my application with Flutter 3.47. Please merge PR #191052 as soon as possible.
Fix Actions.handler to forward the intent type to maybeFind (flutter#…
Work around broken Actions.handler on Flutter 3.47
Fix Actions.handler to forward the intent type to maybeFind (flutter#…
[CP-stable]Fix Actions.handler to forward the intent type to maybeFind (
github-actions commentedon Sep 3, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.