Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Unified Diff: sky/framework/components/scrollable.dart

Issue 1097373002: [Effen] Prevent scrolling past the bottom of a scrollable list. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Move the creation of the OverscrollBehavior class to FixedHeightScrollable, since we already assumeā€¦ Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698