mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Merge pull request #514 from abarth/list_repaint
Make stocks list scrolling 2x faster on the main thread
This commit is contained in:
commit
c423f734ab
@ -255,6 +255,7 @@ class RenderBlockViewport extends RenderBlockBase {
|
||||
super(children: children, direction: direction, itemExtent: itemExtent, minExtent: minExtent);
|
||||
|
||||
bool _inCallback = false;
|
||||
bool get hasLayer => true;
|
||||
|
||||
/// Called during [layout] to determine the blocks children
|
||||
///
|
||||
|
||||
@ -148,7 +148,9 @@ class _HomogeneousViewportElement extends RenderObjectElement<HomogeneousViewpor
|
||||
assert(_layoutItemCount != null);
|
||||
List<Widget> newWidgets;
|
||||
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
|
||||
newWidgets = <Widget>[];
|
||||
_children = updateChildren(_children, newWidgets);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user