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

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

Issue 1183143012: Widgets should be stateful before calling setState (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase 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/button_base.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/widget.dart
diff --git a/sky/sdk/lib/widgets/widget.dart b/sky/sdk/lib/widgets/widget.dart
index 9b4001eff9292b7c84cd71edd81242dc4b024860..4ad23dc9787f4c62beadcbf2ab0ed9c1c8f00c28 100644
--- a/sky/sdk/lib/widgets/widget.dart
+++ b/sky/sdk/lib/widgets/widget.dart
@@ -416,7 +416,7 @@ abstract class Component extends Widget {
void setState(Function fn()) {
assert(!_disqualifiedFromEverAppearingAgain);
- _stateful = true;
+ assert(_stateful);
fn();
if (_isBuilding || _dirty || !_mounted)
return;
@@ -813,6 +813,10 @@ class WidgetSkyBinding extends SkyBinding {
}
abstract class App extends Component {
+
+ // Apps are assumed to be stateful
+ App({ String key }) : super(key: key, stateful: true);
+
void _handleEvent(sky.Event event) {
if (event.type == 'back')
onBack();
« no previous file with comments | « sky/sdk/lib/widgets/button_base.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698