Repository: flutter
Issue: Proposal to Allow IconButton to receive focus
Labels: c: new feature,framework,f: material design,c: proposal,f: focus,team-design,triaged-design

<!-- 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 out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Use case
In my app I have something like this:

```
  @override
  Widget build(BuildContext context) {
    return Row(
      children: <Widget>[
        Expanded(
          child: TextField(
            focusNode: _textFocusNode,
            controller: _textEditingController,
            onChanged: (value) {
              setState(() {
                _sendButtonEnabled = value.trim().isNotEmpty;
              });
            },
          )
        ),
        IconButton(
          focusNode: _sendButtonFocusNode,
          icon: const Icon(Icons.send),
          onPressed: _sendButtonEnabled && !widget.messagesLoading.value ? () async {
            // Do stuff
          } : null,
        )
      ]
    );
  }
```

Think of it like the text input for a chat app. The problem is that when the `IconButton` is pressed on a physical device, the keyboard goes away until the `TextField` is tapped again. I would like some way to keep the keyboard in place if the send button is tapped, and make it go away if the screen is tapped anywhere else. 

The "make it go away" part works just fine. However calling `_textEditingController.requestFocus()` at the top of the `onPressed` function has resulted in the keyboard going away and coming back immediately - a sort of "bouncing" behaviour. To resolve this I tried to give a `focusNode` to the `IconButton`, then use `_textFocusNode.addListener` to request focus back to the textfield. This results in no bouncing effect, but then the app cannot distinguish whether the user has tapped on the send button or just anywhere else on the screen that isn't the textfield.

By experimenting with `_sendButtonFocusNode.addListener` I have found that _sendButtonFocusNode is actually never focused. Within the listener I simply call `_sendButtonFocusNode.hasFocus` and every time it runs it's false. Which is strange to me, because it seems that I should be able to focus this widget whenever the user taps on it, and focus should remain on this widget until the user taps something else.

<!--
     Please tell us the problem you are running into that led to you wanting
     a new feature.

     Is your feature request related to a problem? Please give a clear and
     concise description of what the problem is.

     Describe the alternative solutions you've considered. Is there a package
     on pub.dev/flutter that already solves this?
-->

## Proposal

<!--
     Briefly but precisely describe what you would like Flutter to be able to do.

     Consider attaching something showing what you are imagining:
      * images
      * videos
      * code samples

     Does this have to be provided by Flutter directly, or can it be provided
     by a package on pub.dev/flutter? If so, maybe consider implementing and
     publishing such a package rather than filing a bug.
-->

If `_sendButtonFocusNode` was able to receive focus, I could simply do something like this inside of `_textFocusNode.addListener`:

```
if (_sendButtonFocusNode.hasFocus) {
  _textEditingController.requestFocus();
}
```

I find it confusing that I'm able to give a `focusNode` to `IconButton` if the widget can never actually take focus. Maybe it's the case that something else about `_sendButtonFocusNode` is changing, triggering the listener? But I wasn't able to find documentation explaining what else about a focusNode can change.

I'm also not sure if this issue only applies to `IconButton` or if there are other widgets that are never focusable, despite having a `focusNode` field.