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

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

Issue 1234863004: Remove redundant setState() calls around scroll behaviour updates. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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/sdk/lib/widgets/scrollable_viewport.dart
diff --git a/sky/sdk/lib/widgets/scrollable_viewport.dart b/sky/sdk/lib/widgets/scrollable_viewport.dart
index 1c0195d39e6cc7b0e0a161c2a34c3213dc4a0a2d..c7ed2adc02a6189a561211c52d2c911ae9dc156d 100644
--- a/sky/sdk/lib/widgets/scrollable_viewport.dart
+++ b/sky/sdk/lib/widgets/scrollable_viewport.dart
@@ -23,16 +23,12 @@ class ScrollableViewport extends Scrollable {
double _viewportHeight = 0.0;
double _childHeight = 0.0;
void _handleViewportSizeChanged(Size newSize) {
- setState(() {
- _viewportHeight = newSize.height;
- _updateScrollBehaviour();
- });
+ _viewportHeight = newSize.height;
+ _updateScrollBehaviour();
}
void _handleChildSizeChanged(Size newSize) {
- setState(() {
- _childHeight = newSize.height;
- _updateScrollBehaviour();
- });
+ _childHeight = newSize.height;
+ _updateScrollBehaviour();
}
void _updateScrollBehaviour() {
scrollBehavior.contentsSize = _childHeight;

Powered by Google App Engine
This is Rietveld 408576698