Repository: flutter
Issue: Directional navigation key binding defaults should be limited to those platforms that use it.
Labels: framework,platform-mac,a: desktop,d: devtools,P2,team-text-input,triaged-text-input

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill our the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

When running the fluter devtools on macos, I'm seeing strange key handling behavior. There are extra key actions that I don't see on flutter web. Some discussion of the issue, with screenshots, is at https://github.com/flutter/devtools/issues/1769. But essentially:

I'm adding row selection and keyboard navigation to a custom widget TreeTable ([built here](https://github.com/flutter/devtools/blob/ae483b098ec65941f457bf545bdc9059f6537231/packages/devtools_app/lib/src/flutter/table.dart#L363)). I'm explicitly [handling the arrow up/down keys](https://github.com/flutter/devtools/blob/ae483b098ec65941f457bf545bdc9059f6537231/packages/devtools_app/lib/src/flutter/table.dart#L427) to move the selection and scroll the view. But on macos I see scrolling that is not caused by my handler, and also a kind of ghost selected row (see the screenshots in https://github.com/flutter/devtools/issues/1769) not caused by me (the color is different than the one I am using). Also, sometimes after clicking on a row the arrow keys will start cycling through the top-level tabs (Inspector, timeline) instead of the rows in the table.

In a nutshell there is some code handling the up/down arrow keys in a way that I don't understand, can't control, and can't predict. It also does not happen when I run via flutter web which leads me to believe it's a bug in the macos platform code.

The PR that introduced keyboard navigation is here: https://github.com/flutter/devtools/pull/1810

## Steps to Reproduce
$git clone git@github.com:flutter/devtools.git
$cd devtools/packages/devtools_app
$flutter run -d macos

1. Enter the url of another running flutter app
2. Click on the "info" tab
3. Click "performance"
4. Record performance data
5. Click on the "call tree" tab
6. Click inside the call tree table
7. navigate up/down with the arrow keys.
8. Compare with the behavior when running with `-d web`

**Expected results:** <!-- what did you want to see? -->
I expect the arrow up/down keys to cause the window to scroll only when the selection reaches the bottom or top of the viewport. I expect there to be only 1 selected row. I expect that pressing the arrow up/down keys should not escape the treetable and start cycling the top-level tabs of the viewport.

**Actual results:** <!-- what did you see? -->
See the examples at https://github.com/flutter/devtools/issues/1769


<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->


```
I captured the logs, but they're really verbose (1600 lines). LMK if there is a better way to provide them besides pasting the whole thing into this issue.
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
gmoothart-macbookpro2:devtools_app gmoothart$ flutter analyze
Analyzing devtools_app...

warning • The include file ../../analysis_options.yaml in /Users/gmoothart/dev/devtools/packages/devtools_app/analysis_options.yaml cannot be found •
       analysis_options.yaml:1:11 • include_file_not_found
   info • Prefer declaring const constructors on `@immutable` classes • bug/lib/main.dart:35:3 • prefer_const_constructors_in_immutables
   info • Prefer const with constant constructors • bug/lib/main.dart:100:13 • prefer_const_constructors
   info • Prefer const with constant constructors • bug/lib/main.dart:113:16 • prefer_const_constructors

4 issues found. (ran in 20.1s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
gmoothart-macbookpro2:devtools_app gmoothart$ flutter doctor -v
[✓] Flutter (Channel master, v1.18.0-6.0.pre.51, on Mac OS X 10.15.3 19D76, locale en-US)
    • Flutter version 1.18.0-6.0.pre.51 at /Users/gmoothart/dev/flutter
    • Framework revision 20803507fd (3 minutes ago), 2020-04-16 14:36:42 -0700
    • Engine revision deef2663ac
    • Dart version 2.8.0 (build 2.8.0-dev.20.0 c9710e5059)

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
      You may also want to add it to your PATH environment variable.


[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4, Build version 11E146
    • CocoaPods version 1.9.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] IntelliJ IDEA Community Edition (version 2019.3.4)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 44.0.3
    • Dart plugin version 193.6911.31

[✓] VS Code (version 1.43.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.4.1

[✓] Connected device (3 available)
    • macOS      • macOS      • darwin-x64     • Mac OS X 10.15.3 19D76
    • Chrome     • chrome     • web-javascript • Google Chrome 80.0.3987.163
    • Web Server • web-server • web-javascript • Flutter Tools

! Doctor found issues in 2 categories.
```

</details>