Taha Tesser
9d971fada1
Fix IconButton doesn't show Tooltip when hovering within the button area but outside the Icon (#153691)
Fixes [Tooltip is not shown consistently on entire IconButton](https://github.com/flutter/flutter/issues/153544)
### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: Scaffold(
body: Center(
child: Row(
spacing: 20.0,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
IconButton(
padding: const EdgeInsets.all(20.0),
icon: const ColoredBox(
color: Color(0xFFFF0000),
child: Icon(Icons.add),
),
onPressed: () {},
tooltip: 'Tooltip',
),
IconButton.filled(
padding: const EdgeInsets.all(20.0),
icon: const ColoredBox(
color: Color(0xFFFF0000),
child: Icon(Icons.add),
),
onPressed: () {},
tooltip: 'Tooltip',
),
IconButton.filledTonal(
padding: const EdgeInsets.all(20.0),
icon: const ColoredBox(
color: Color(0xFFFF0000),
child: Icon(Icons.add),
),
onPressed: () {},
tooltip: 'Tooltip',
),
IconButton.outlined(
padding: const EdgeInsets.all(20.0),
icon: const ColoredBox(
color: Color(0xFFFF0000),
child: Icon(Icons.add),
),
onPressed: () {},
tooltip: 'Tooltip',
),
],
),
),
),
),
);
}
```
</details>
### Before (Hover outside the red box but within the `IconButton`)
<img width="579" alt="Screenshot 2024-08-19 at 15 30 35" src="https://github.com/user-attachments/assets/fd2a65f1-f30d-4907-a2d9-c11dc59efb2b">
### Before (Hover outside the red box but within the `IconButton`)
<img width="579" alt="Screenshot 2024-08-19 at 15 30 09" src="https://github.com/user-attachments/assets/b2b4dba7-4d0a-44c9-b1e1-742a900ffd8a">
### Demo
https://github.com/user-attachments/assets/129eb8ee-e132-45c9-80b7-165486c02951
2024-08-29 07:02:23 +00:00
..
2024-04-09 19:35:07 +00:00
2024-06-13 19:28:21 +00:00
2024-04-09 19:35:07 +00:00
2024-08-02 21:16:24 +00:00
2024-07-01 17:06:54 +00:00
2024-07-08 21:01:56 +00:00
2024-04-25 10:32:45 -07:00
2024-04-25 10:32:45 -07:00
2024-05-28 16:35:29 -07:00
2024-05-28 16:35:29 -07:00
2024-07-01 23:36:32 +00:00
2024-02-28 13:55:50 -08:00
2024-06-21 14:48:41 -07:00
2024-03-19 17:58:13 +00:00
2024-08-28 18:40:05 +00:00
2024-02-28 13:55:50 -08:00
2024-08-02 23:31:07 +00:00
2024-08-22 03:30:22 +00:00
2024-06-12 20:05:10 +00:00
2024-07-29 16:48:06 +00:00
2024-08-05 23:04:48 +00:00
2024-07-30 20:38:06 +00:00
2024-07-08 21:01:56 +00:00
2024-05-10 23:37:05 +00:00
2024-07-30 16:44:08 +00:00
2024-07-30 16:44:08 +00:00
2024-06-13 19:28:21 +00:00
2024-06-20 06:44:11 -07:00
2024-06-14 00:07:48 +00:00
2024-08-15 19:02:23 +00:00
2024-05-28 16:35:29 -07:00
2024-08-22 03:30:22 +00:00
2024-05-30 17:53:03 +00:00
2024-08-26 17:52:08 +00:00
2024-08-28 18:40:05 +00:00
2024-05-10 22:08:59 +00:00
2024-07-08 21:01:56 +00:00
2024-08-29 02:23:19 +00:00
2024-05-15 18:37:07 +00:00
2024-04-08 20:47:13 +00:00
2024-08-23 07:57:08 +00:00
2024-02-28 13:55:50 -08:00
2024-07-31 11:22:26 +00:00
2024-08-02 23:31:07 +00:00
2024-02-28 13:55:50 -08:00
2024-06-12 20:05:10 +00:00
2024-06-12 20:05:10 +00:00
2024-07-30 20:38:06 +00:00
2024-08-02 23:31:07 +00:00
2024-02-28 13:55:50 -08:00
2024-06-13 19:28:21 +00:00
2024-07-31 23:35:24 +00:00
2024-06-12 20:05:10 +00:00
2024-03-19 17:58:13 +00:00
2024-08-29 07:02:23 +00:00
2024-04-24 11:56:32 +00:00
2024-07-15 07:09:09 +00:00
2024-04-09 19:35:07 +00:00
2024-02-07 02:44:21 +00:00
2024-04-09 19:35:07 +00:00
2024-06-12 20:05:10 +00:00
2024-06-13 19:28:21 +00:00
2024-07-08 21:01:56 +00:00
2024-08-26 18:40:55 +00:00
2024-08-28 01:36:20 +00:00
2024-03-19 17:58:16 +00:00
2024-02-21 08:59:24 +00:00
2024-04-03 15:49:38 -07:00
2024-06-12 20:05:10 +00:00
2024-03-19 17:58:13 +00:00
2024-08-07 23:39:24 +00:00
2024-07-11 19:25:18 +00:00
2024-03-11 23:04:57 +00:00
2024-06-12 20:05:10 +00:00
2024-03-19 17:58:13 +00:00
2024-06-12 20:05:10 +00:00
2024-03-19 17:58:13 +00:00
2024-08-22 07:25:34 +00:00
2024-05-28 16:35:29 -07:00
2024-08-02 23:31:07 +00:00
2024-02-28 13:55:50 -08:00
2024-05-28 16:35:29 -07:00
2024-08-28 18:40:05 +00:00
2024-05-28 16:35:29 -07:00
2024-05-28 16:35:29 -07:00
2024-08-20 23:14:15 +00:00
2024-06-20 19:18:21 +00:00
2024-03-27 16:43:10 -07:00
2024-05-20 17:43:03 +00:00
2024-07-30 20:38:06 +00:00
2024-07-24 22:47:55 +00:00
2024-03-19 17:58:13 +00:00
2024-05-28 16:35:29 -07:00
2024-06-12 20:05:10 +00:00
2024-08-23 20:37:24 +00:00
2024-07-30 20:38:06 +00:00
2024-07-31 23:35:24 +00:00
2024-03-13 16:31:50 +00:00
2024-03-19 17:58:13 +00:00
2024-08-01 13:56:04 -07:00
2024-03-19 17:58:13 +00:00
2024-08-06 17:53:03 +00:00
2024-06-12 20:05:10 +00:00
2024-04-24 11:56:32 +00:00
2024-04-24 09:06:17 -07:00
2024-08-14 18:27:14 +00:00
2024-07-15 07:09:09 +00:00
2024-07-01 23:36:32 +00:00
2024-04-15 16:06:07 +00:00
2024-07-31 19:58:04 +00:00
2024-07-30 20:38:06 +00:00
2024-07-16 20:25:09 +00:00
2024-07-16 20:25:09 +00:00
2024-07-26 11:54:28 +00:00
2024-07-26 11:54:28 +00:00
2024-04-17 07:59:07 +00:00
2024-08-02 23:31:07 +00:00
2024-02-28 13:55:50 -08:00
2024-07-08 21:01:56 +00:00
2024-06-18 17:52:21 +00:00
2024-03-01 06:40:47 +00:00
2024-08-14 22:53:36 +00:00
2024-02-28 13:55:50 -08:00
2024-08-23 17:15:36 +00:00
2024-08-23 17:15:36 +00:00
2024-07-11 16:51:35 +00:00
2024-06-12 20:05:10 +00:00
2024-05-18 10:41:56 -07:00
2024-02-23 19:02:22 +00:00
2024-03-28 01:20:55 +00:00
2024-06-12 20:05:10 +00:00
2024-02-21 00:34:11 +00:00