mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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