Repository: flutter
Issue: Flutter_lints, unawaited_futures rule does not trigger in switch statements
Labels: waiting for customer response,in triage

### Steps to reproduce

We are using the flutter_lint package in our project. Recently we noticed, that, when we have mixed Future and sync return values in a switch statement, dart "sets" the return value as sync. However, the futures are then not marked as "unawaited" by the linter rule, as expected. 

1. Turn on the unawaited_futures rule
2. Create a Method with a Future return type, which returns the result of a switch statement (=> notation).
3. Make it so, that at least one case points to a Future, and one not.

### Expected results

It is expected, that the Future in the switch statement triggers the unawaited_futures linter rule. I guess it is implicitly unawaited by the switch. This is a potential bug, and the linter rule can help to identify it.

### Actual results

The linter does not mark the future as unawaited.

### Code sample

<details open><summary>Code sample</summary>

```dart
class Test {
  void doSomethingSync() {}

  Future<void> doSomethingAsync() async {
    Future<void>.value(); // linter rule unawaited_futures is triggered by this
  }

  void onlySyncSwitch(TestOption option) {
    final result = switch (option) {
      TestOption.optionA => doSomethingSync(),
      TestOption.optionB => doSomethingSync(),
    };
    return result; // result is void
  }

  Future<void> onlyAsyncSwitch(TestOption option) {
    final result = switch (option) {
      TestOption.optionA => doSomethingAsync(),
      TestOption.optionB => doSomethingAsync(),
    };
    return result; // result is Future<void>
  }

  Future<void> mixedSyncAndAsyncSwitch(TestOption option) async {
    final result = switch (option) {
      TestOption.optionA => doSomethingSync(),
      TestOption.optionB =>
        doSomethingAsync(), // expect that unawaited_futures triggers, but it does not.
    };
    return result; // result is void
  }
}

enum TestOption {
  optionA,
  optionB,
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

![Image](https://github.com/user-attachments/assets/cb389535-cd35-43b8-ad93-65a1db9eb2ee)

</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 [user-branch], 3.24.2, on macOS 14.6.1 23G93 darwin-arm64, locale de-DE)
    ! Flutter version 3.24.2 on channel [user-branch] at /Users/user/sdk/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] IntelliJ IDEA Community Edition (version 2023.3.3)
[✓] IntelliJ IDEA Community Edition (version 2021.1)
[✓] VS Code (version 1.90.2)

```

</details>