Commit c423f734 authored by Adam Barth's avatar Adam Barth

Merge pull request #514 from abarth/list_repaint

Make stocks list scrolling 2x faster on the main thread
parents 49fb4923 efbea05e
...@@ -255,6 +255,7 @@ class RenderBlockViewport extends RenderBlockBase { ...@@ -255,6 +255,7 @@ class RenderBlockViewport extends RenderBlockBase {
super(children: children, direction: direction, itemExtent: itemExtent, minExtent: minExtent); super(children: children, direction: direction, itemExtent: itemExtent, minExtent: minExtent);
bool _inCallback = false; bool _inCallback = false;
bool get hasLayer => true;
/// Called during [layout] to determine the blocks children /// Called during [layout] to determine the blocks children
/// ///
......
...@@ -148,7 +148,9 @@ class _HomogeneousViewportElement extends RenderObjectElement<HomogeneousViewpor ...@@ -148,7 +148,9 @@ class _HomogeneousViewportElement extends RenderObjectElement<HomogeneousViewpor
assert(_layoutItemCount != null); assert(_layoutItemCount != null);
List<Widget> newWidgets; List<Widget> newWidgets;
if (_layoutItemCount > 0) if (_layoutItemCount > 0)
newWidgets = widget.builder(this, _layoutFirstIndex, _layoutItemCount); newWidgets = widget.builder(this, _layoutFirstIndex, _layoutItemCount).map((Widget widget) {
return new RepaintBoundary(key: new ValueKey<Key>(widget.key), child: widget);
}).toList();
else else
newWidgets = <Widget>[]; newWidgets = <Widget>[];
_children = updateChildren(_children, newWidgets); _children = updateChildren(_children, newWidgets);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment