-
Notifications
You must be signed in to change notification settings - Fork 27.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Tooltip default vertical padding #103395
Add Tooltip default vertical padding #103395
Conversation
c7a2e1e
to
6a87f87
Compare
Hi! I believe this is a breaking change and won't be able to land before preliminary work. Also, this PR would benefit from a table with screenshots showing the resulting tooltip under various combinations (mobile/desktop, non-wrapping, wrapping). |
6a87f87
to
01e656c
Compare
Hey! Code sample for screenshotsimport 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key, this.dark = false, this.useMaterial3 = true});
final bool dark;
final bool useMaterial3;
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
themeMode: dark ? ThemeMode.dark : ThemeMode.light,
theme: ThemeData(
useMaterial3: useMaterial3,
brightness: Brightness.light,
colorSchemeSeed: const Color(0xff6750a4),
),
darkTheme: ThemeData(
useMaterial3: useMaterial3,
brightness: Brightness.dark,
colorSchemeSeed: const Color(0xff6750a4),
),
home: const Example(),
);
}
}
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Tooltip Sample'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Column(
children: <Widget>[
const SizedBox(height: 5),
Container(
color: Colors.green[100],
child: const Tooltip(
message: "Non-wrapping Tooltip",
triggerMode: TooltipTriggerMode.tap,
showDuration: Duration(seconds: 5),
preferBelow: false,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Tap me to display\na non wrapping Tooltip',
textAlign: TextAlign.center,
),
),
),
),
],
),
Column(
children: <Widget>[
const SizedBox(height: 5),
Container(
color: Colors.green[100],
child: const Tooltip(
message: "Wrapping\nTooltip",
triggerMode: TooltipTriggerMode.tap,
showDuration: Duration(seconds: 5),
preferBelow: false,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Tap me to display\na wrapping Tooltip',
textAlign: TextAlign.center,
),
),
),
),
],
),
],
),
),
);
}
}
I also updated the PR with a vertical padding of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice. Let's see what testing says
01e656c
to
31f37de
Compare
Description
This PR add a Tooltip default vertical padding for developper convenience.
see #86170 (comment)
@guidezpl
After investigating various solutions to not rely on vertical padding, I reached the conclusion that setting a default vertical padding is the best candidate :
Related Issue
Fixes #86170
Tests
Update 3 tests.