Tooltip update can cause assert (#7338)

We were trying to update the tooltip overlay entry, but that cannot work
because the overlay entry might have already built. Instead, we keep the
old value.

Fixes #7151
This commit is contained in:
Adam Barth
2017-01-04 16:08:29 -08:00
committed by GitHub
parent 3176921d16
commit 86e5fce61a
3 changed files with 70 additions and 28 deletions

View File

@@ -267,6 +267,26 @@ class WidgetController {
});
}
/// Dispatch a pointer down / pointer up sequence (with a delay of
/// [kLongPressTimeout] + [kPressTimeout] between the two events) at the
/// center of the given widget, assuming it is exposed. If the center of the
/// widget is not exposed, this might send events to another
/// object.
Future<Null> longPress(Finder finder, { int pointer: 1 }) {
return longPressAt(getCenter(finder), pointer: pointer);
}
/// Dispatch a pointer down / pointer up sequence at the given location with
/// a delay of [kLongPressTimeout] + [kPressTimeout] between the two events.
Future<Null> longPressAt(Point location, { int pointer: 1 }) {
return TestAsyncUtils.guard(() async {
TestGesture gesture = await startGesture(location, pointer: pointer);
await pump(kLongPressTimeout + kPressTimeout);
await gesture.up();
return null;
});
}
/// Attempts a fling gesture starting from the center of the given
/// widget, moving the given distance, reaching the given velocity.
///