Re-land: Add support for Tooltip hover (#31699)

This is a re-land of #31561, after fixing performance regressions.

Added change listening to the MouseTracker so that the Listener and tooltip can react to whether or not a mouse is connected at all. Added a change check to make sure Listener only repaints when something changed.

Fixes #22817
This commit is contained in:
Greg Spencer
2019-05-03 13:00:36 -07:00
committed by GitHub
parent 3bd1737c0e
commit 11e0a725d4
11 changed files with 486 additions and 87 deletions

View File

@@ -9,6 +9,7 @@ import '../common.dart';
const int _kNumIters = 10000;
void main() {
assert(false, "Don't run benchmarks in checked mode! Use 'flutter run --release'.");
final Stopwatch watch = Stopwatch();
print('RRect contains benchmark...');
watch.start();

View File

@@ -10,6 +10,7 @@ import 'data/velocity_tracker_data.dart';
const int _kNumIters = 10000;
void main() {
assert(false, "Don't run benchmarks in checked mode! Use 'flutter run --release'.");
final VelocityTracker tracker = VelocityTracker();
final Stopwatch watch = Stopwatch();
print('Velocity tracker benchmark...');

View File

@@ -34,7 +34,7 @@ class BenchmarkingBinding extends LiveTestWidgetsFlutterBinding {
}
Future<void> main() async {
assert(false); // don't run this in checked mode! Use --release.
assert(false, "Don't run benchmarks in checked mode! Use 'flutter run --release'.");
stock_data.StockData.actuallyFetchData = false;
final Stopwatch wallClockWatch = Stopwatch();

View File

@@ -14,7 +14,7 @@ import '../common.dart';
const Duration kBenchmarkTime = Duration(seconds: 15);
Future<void> main() async {
assert(false); // don't run this in checked mode! Use --release.
assert(false, "Don't run benchmarks in checked mode! Use 'flutter run --release'.");
stock_data.StockData.actuallyFetchData = false;
// We control the framePolicy below to prevent us from scheduling frames in

View File

@@ -15,6 +15,7 @@ import '../common.dart';
const Duration kBenchmarkTime = Duration(seconds: 15);
Future<void> main() async {
assert(false, "Don't run benchmarks in checked mode! Use 'flutter run --release'.");
stock_data.StockData.actuallyFetchData = false;
// We control the framePolicy below to prevent us from scheduling frames in