forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
AppBar
back button doesn't navigate back when using `TooltipTri…
…ggerMode.tap` in the `TooltipTheme` (flutter#155822) Fixes [AppBar BackButton Tooltip interferes with clicking button when TooltipThemeData set to TooltipTriggerMode.tap](flutter#152315) ### Description `TooltipTheme` with `triggerMode: TooltipTriggerMode.tap` prevents user from navigating back when tapping on the back button. `triggerMode: TooltipTriggerMode.tap` shouldn't interrupted the back button navigation back callback. ### Code sample <details> <summary>expand to view the code sample</summary> ```dart import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @OverRide Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData( tooltipTheme: const TooltipThemeData(triggerMode: TooltipTriggerMode.tap), ), home: Scaffold( appBar: AppBar( title: const Text('Sample'), ), body: Builder(builder: (context) { return Center( child: ElevatedButton( onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => const SecondScreen(), ), ); }, child: const Text('Go to Second Screen'), ), ); }), ), ); } } class SecondScreen extends StatelessWidget { const SecondScreen({super.key}); @OverRide Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Second Screen'), ), body: const Center( child: Tooltip( message: 'This is the second screen', child: Text('Tap to show tooltip'), ), ), ); } } ``` </details> ### Before https://github.com/user-attachments/assets/ed2020f0-aef8-40f9-be05-55ff80e42e5d ### After https://github.com/user-attachments/assets/8d65f9f8-d15d-453f-955f-e5d92f8a04e8
- Loading branch information
1 parent
5d06db6
commit 8ea38a7
Showing
3 changed files
with
150 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters