LazyBlock docs and physics

This patch adds dartdoc to LazyBlock. Also, this patch fixes the scrolling
physics of LazyBlock. Previously, we updated a running simulation only when the
change in scroll behavior changed the current scroll offset. Now we update
running simulations every time the behavior changes because the simulation
might depend on quantities other than the current scroll offset.
This commit is contained in:
Adam Barth
2016-04-06 12:36:54 -07:00
parent 0bf68cc5cb
commit 6fd6859793
11 changed files with 162 additions and 53 deletions

View File

@@ -418,7 +418,7 @@ class CardCollectionState extends State<CardCollection> {
);
} else {
cardCollection = new LazyBlock(
delegate: new LazyBlockBuilder(_buildCard),
delegate: new LazyBlockBuilder(builder: _buildCard),
snapOffsetCallback: _snapToCenter ? _toSnapOffset : null
);
}

View File

@@ -130,7 +130,7 @@ class CardBuilder extends LazyBlockDelegate {
class OverlayGeometryAppState extends State<OverlayGeometryApp> {
List<CardModel> cardModels;
Map<MarkerType, Point> markers = new Map<MarkerType, Point>();
double markersScrollOffset;
double markersScrollOffset = 0.0;
ScrollListener scrollListener;
@override