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

Unified Diff: sky/sdk/lib/widgets/fixed_height_scrollable.dart

Issue 1216323002: Add a TabNavigator to the Stocks demo (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « sky/sdk/lib/editing/editable_text.dart ('k') | sky/tests/examples/stocks-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/fixed_height_scrollable.dart
diff --git a/sky/sdk/lib/widgets/fixed_height_scrollable.dart b/sky/sdk/lib/widgets/fixed_height_scrollable.dart
index 01ac4f9ac362941f2f4aa4269ff6ad3cbfb0d629..1a0997cf7f1ce1e7f1971e643ce2fda49c1b65f9 100644
--- a/sky/sdk/lib/widgets/fixed_height_scrollable.dart
+++ b/sky/sdk/lib/widgets/fixed_height_scrollable.dart
@@ -49,6 +49,14 @@ abstract class FixedHeightScrollable extends Scrollable {
});
}
+ bool scrollTo(double newScrollOffset) {
+ if (_height != null && _height > 0.0) {
+ double maxScrollOffset = math.max(0.0, itemCount * itemHeight - _height);
+ newScrollOffset = math.min(newScrollOffset, maxScrollOffset);
+ }
+ return super.scrollTo(newScrollOffset);
+ }
+
Widget buildContent() {
var itemShowIndex = 0;
var itemShowCount = 0;
« no previous file with comments | « sky/sdk/lib/editing/editable_text.dart ('k') | sky/tests/examples/stocks-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698