Repository: flutter
Issue: [Linux] FocusableActionDetector not working
Labels: a: text input,framework,platform-linux,a: desktop,P3,fyi-text-input,team-linux,triaged-linux

### Steps to reproduce

1. Create a new Flutter project.
2. Add a FocusableActionDetector in a widget.
3. Configure specific keyboard actions within the FocusableActionDetector.
4. Run the application on Linux and Windows.
5. Observe that the keyboard actions work on Windows but not on Linux.

### Expected results

The keyboard actions configured in the FocusableActionDetector should work consistently across all platforms, including Linux.

### Actual results

On Linux, the keyboard actions within the FocusableActionDetector are not being triggered, while they work as expected on Windows.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  void _decrementCounter() {
    setState(() {
      _counter--;
    });
  }

  void keyboardActions(EventShortcutsIntent intent) async {
    switch (intent.type) {
      case EEventType.increment:
        _incrementCounter();
        break;
      case EEventType.decrement:
        _decrementCounter();
        break;
    }
  }

  @override
  Widget build(BuildContext context) {
    return FocusableActionDetector(
      shortcuts: getEventShortcuts(),
      actions: <Type, Action<EventShortcutsIntent>>{
        EventShortcutsIntent: CallbackAction<EventShortcutsIntent>(
          onInvoke: keyboardActions,
        ),
      },
      autofocus: true,
      descendantsAreFocusable: true,
      child: Scaffold(
        appBar: AppBar(
          backgroundColor: Theme
              .of(context)
              .colorScheme
              .inversePrimary,
          title: Text(widget.title),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              const Text(
                'You have pushed the button this many times:',
              ),
              Text(
                '$_counter',
                style: Theme
                    .of(context)
                    .textTheme
                    .headlineMedium,
              ),
            ],
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: _incrementCounter,
          tooltip: 'Increment',
          child: const Icon(Icons.add),
        ),
      ),
    );
  }
}



Map<LogicalKeySet, Intent> getEventShortcuts() {
  return <LogicalKeySet, Intent>{
    LogicalKeySet(LogicalKeyboardKey.control, LogicalKeyboardKey.keyA): const EventShortcutsIntent.increment(),
    LogicalKeySet(LogicalKeyboardKey.control, LogicalKeyboardKey.keyB): const EventShortcutsIntent.decrement(),
  };
}

enum EEventType {
  increment, decrement;
}

class EventShortcutsIntent extends Intent {
  final EEventType type;

  const EventShortcutsIntent({required this.type});

  const EventShortcutsIntent.increment() : type = EEventType.increment;
  const EventShortcutsIntent.decrement() : type = EEventType.decrement;
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>


https://github.com/flutter/flutter/assets/66748755/b7735b78-451a-4134-b30b-d697dbb8fdc7


</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.22.2, on Ubuntu 24.04 LTS 6.8.0-35-generic,
    locale en_US.UTF-8)
    • Flutter version 3.22.2 on channel stable at
      /home/fernando-dev/apps/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (8 days ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/fernando-dev/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /home/fernando-dev/apps/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 18.1.3 (1)
    • cmake version 3.28.3
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[✓] Android Studio (version 2023.3)
    • Android Studio at /home/fernando-dev/apps/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.10+0-17.0.10b1087.21-11572160)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.1)
    • IntelliJ at /home/fernando-dev/apps/intellij
    • Flutter plugin version 80.0.2
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 24.04 LTS
      6.8.0-35-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 125.0.6422.141

[✓] Network resources
    • All expected network resources are available.

• No issues found!

```

</details>