Mimic should track Mimicable more completely

We now have Mimic tracking Mimicable through tree structure changes and while
moving around the screen.

Fixes #751 and #756
This commit is contained in:
Adam Barth
2015-08-24 14:14:46 -07:00
parent d7ed623ea6
commit 7077b1b3d0
3 changed files with 137 additions and 83 deletions

View File

@@ -63,6 +63,13 @@ class ExampleApp extends App {
);
}
Rect _targetRect;
void _handleOverlaySizeChanged(Size size) {
setState(() {
_targetRect = Point.origin & size;
});
}
Widget build() {
List<Widget> cards = new List<Widget>();
for (int i = 0; i < _data.length; ++i) {
@@ -88,10 +95,14 @@ class ExampleApp extends App {
}
)
),
body: new MimicOverlay(
overlay: _overlay,
duration: const Duration(milliseconds: 500),
children: [ new Block(cards) ]
body: new SizeObserver(
callback: _handleOverlaySizeChanged,
child: new MimicOverlay(
overlay: _overlay,
duration: const Duration(milliseconds: 5000),
targetRect: _targetRect,
children: [ new Block(cards) ]
)
)
)
)