From 2609f7bf8edf9148978d86374069e478f9b8e247 Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Fri, 16 Oct 2015 10:06:10 -0700 Subject: [PATCH] OMG I've been running with checking turned off. Fixed scrollbar assertion failures. --- examples/widgets/scrollbar.dart | 7 ++++++- packages/flutter/lib/src/widgets/scrollable.dart | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/widgets/scrollbar.dart b/examples/widgets/scrollbar.dart index b488467a24..eaf38a1933 100644 --- a/examples/widgets/scrollbar.dart +++ b/examples/widgets/scrollbar.dart @@ -23,7 +23,12 @@ class ScrollbarAppState extends State { return new ScrollableList( items: new List.generate(_itemCount, (int i) => i), itemExtent: _itemExtent, - itemBuilder: (BuildContext _, int i) => new Text('Item ${dd.format(i)}', style: Theme.of(context).text.title), + itemBuilder: (_, int i) { + return new Text('Item ${dd.format(i)}', + key: new ValueKey(i), + style: Theme.of(context).text.title + ); + }, scrollableListPainter: _scrollbarPainter ); } diff --git a/packages/flutter/lib/src/widgets/scrollable.dart b/packages/flutter/lib/src/widgets/scrollable.dart index 614323154a..f53a82cadc 100644 --- a/packages/flutter/lib/src/widgets/scrollable.dart +++ b/packages/flutter/lib/src/widgets/scrollable.dart @@ -434,7 +434,6 @@ abstract class ScrollableListPainter extends Painter { double _scrollOffset = 0.0; void set scrollOffset (double value) { assert(value != null); - assert(value >= 0.0 && value <= 1.0); if (_scrollOffset == value) return; _scrollOffset = value;