Index: sky/framework/components/scrollable.dart |
diff --git a/sky/framework/components/scrollable.dart b/sky/framework/components/scrollable.dart |
index 36bbaffef4c62953cb79a407ec1fa9d6d67b343a..49310c1e3d3281d20e4b8c8a5ea445dde3114ca0 100644 |
--- a/sky/framework/components/scrollable.dart |
+++ b/sky/framework/components/scrollable.dart |
@@ -22,13 +22,21 @@ abstract class ScrollClient { |
} |
abstract class Scrollable extends Component { |
- ScrollBehavior scrollBehavior; |
- double get scrollOffset => _scrollOffset; |
double _scrollOffset = 0.0; |
+ double get scrollOffset => _scrollOffset; |
+ |
+ ScrollBehavior _scrollBehavior; |
+ ScrollBehavior createScrollBehavior(); |
+ ScrollBehavior get scrollBehavior { |
+ if (_scrollBehavior == null) |
+ _scrollBehavior = createScrollBehavior(); |
+ return _scrollBehavior; |
+ } |
+ |
Simulation _simulation; |
- Scrollable({Object key, this.scrollBehavior}) : super(key: key) { |
+ Scrollable({Object key}) : super(key: key) { |
onDidUnmount(_stopSimulation); |
} |