Index: samples/swarm/swarm_ui_lib/view/PagedViews.dart |
diff --git a/samples/swarm/swarm_ui_lib/view/PagedViews.dart b/samples/swarm/swarm_ui_lib/view/PagedViews.dart |
index bf3074293b68b5887181e26063282b2b3969019d..fe7e691800869c95f50504ac96081dfe51084f6f 100644 |
--- a/samples/swarm/swarm_ui_lib/view/PagedViews.dart |
+++ b/samples/swarm/swarm_ui_lib/view/PagedViews.dart |
@@ -135,7 +135,7 @@ class PagedColumnView extends View { |
// TODO(jmesserly): would be better to not have this code in enterDocument. |
// But we need computedStyle to read our CSS properties. |
void enterDocument() { |
- window.setImmediate(() { |
+ window.immediate.then((_) { |
var style = contentView.node.getComputedStyle(); |
_computeColumnGap(style); |
@@ -183,7 +183,7 @@ class PagedColumnView extends View { |
// The content needs to have its height explicitly set, or columns don't |
// flow to the right correctly. So we copy our own height and set the height |
// of the content. |
- window.setImmediate(() { |
+ window.immediate.then((_) { |
contentView.node.style.height = '${node.offsetHeight}px'; |
}); |
_updatePageCount(null); |
@@ -191,7 +191,7 @@ class PagedColumnView extends View { |
bool _updatePageCount(Callback callback) { |
int pageLength = 1; |
- window.setImmediate(() { |
+ window.immediate.then((_) { |
if (_container.scrollWidth > _container.offsetWidth) { |
pageLength = (_container.scrollWidth / _computePageSize(_container)) |
.ceil().toInt(); |
@@ -216,7 +216,7 @@ class PagedColumnView extends View { |
} |
void _onContentMoved(Event e) { |
- window.setImmediate(() { |
+ window.immediate.then((_) { |
num current = scroller.contentOffset.x; |
int pageSize = _computePageSize(_container); |
pages.current.value = -(current / pageSize).round().toInt(); |
@@ -226,7 +226,7 @@ class PagedColumnView extends View { |
void _snapToPage(Event e) { |
num current = scroller.contentOffset.x; |
num currentTarget = scroller.currentTarget.x; |
- window.setImmediate(() { |
+ window.immediate.then((_) { |
int pageSize = _computePageSize(_container); |
int destination; |
num currentPageNumber = -(current / pageSize).round(); |
@@ -278,7 +278,7 @@ class PagedColumnView extends View { |
} |
void _onPageSelected() { |
- window.setImmediate(() { |
+ window.immediate.then((_) { |
int translate = -pages.target.value * _computePageSize(_container); |
scroller.throwTo(translate, 0); |
}); |