Add Tooltip default vertical padding#103395
Merged
fluttergithubbot merged 1 commit intoflutter:masterfrom May 19, 2022
Merged
Conversation
c7a2e1e to
6a87f87
Compare
Member
|
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
Contributor
Author
|
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 |
guidezpl
approved these changes
May 18, 2022
Member
guidezpl
left a comment
There was a problem hiding this comment.
LGTM, nice. Let's see what testing says
01e656c to
31f37de
Compare
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
May 19, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
May 19, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
May 19, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
May 21, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 30, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Aug 30, 2022
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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.