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

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

Issue 1209413006: Fix padding on Sky home screen scrollable list (Closed) Base URL: git@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/widgets/card.dart ('k') | no next file » | 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 18a4109540c2fa3f9a96fd2980549f0a52eb2188..01ac4f9ac362941f2f4aa4269ff6ad3cbfb0d629 100644
--- a/sky/sdk/lib/widgets/fixed_height_scrollable.dart
+++ b/sky/sdk/lib/widgets/fixed_height_scrollable.dart
@@ -12,7 +12,9 @@ import 'scrollable.dart';
abstract class FixedHeightScrollable extends Scrollable {
- FixedHeightScrollable({ String key, this.itemHeight, Color backgroundColor })
+ final EdgeDims padding;
+
+ FixedHeightScrollable({ String key, this.itemHeight, Color backgroundColor, this.padding })
: super(key: key, backgroundColor: backgroundColor) {
assert(itemHeight != null);
}
@@ -32,7 +34,10 @@ abstract class FixedHeightScrollable extends Scrollable {
void set itemCount (int value) {
if (_itemCount != value) {
_itemCount = value;
- scrollBehavior.contentsHeight = itemHeight * _itemCount;
+ double contentsHeight = itemHeight * _itemCount;
+ if (padding != null)
+ contentsHeight += padding.top + padding.bottom;
+ scrollBehavior.contentsHeight = contentsHeight;
}
}
@@ -76,7 +81,10 @@ abstract class FixedHeightScrollable extends Scrollable {
child: new ClipRect(
child: new Transform(
transform: transform,
- child: new Block(items)
+ child: new Container(
+ padding: padding,
+ child: new Block(items)
+ )
)
)
);
« no previous file with comments | « sky/sdk/lib/widgets/card.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698