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

Unified Diff: sky/examples/fn/widgets/item.dart

Issue 971183002: Initial commit of Effen reactive framework experiment for Sky (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/examples/fn/widgets/inksplash.dart ('k') | sky/examples/fn/widgets/menudivider.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/fn/widgets/item.dart
diff --git a/sky/examples/fn/widgets/item.dart b/sky/examples/fn/widgets/item.dart
new file mode 100644
index 0000000000000000000000000000000000000000..692cc50a815f432d1025cd93a0129e55adf27049
--- /dev/null
+++ b/sky/examples/fn/widgets/item.dart
@@ -0,0 +1,41 @@
+library item;
+
+import 'dart:sky' as sky;
+import 'fn.dart';
+import 'widgets.dart';
+
+enum Color { RED, GREEN }
+
+class Item extends Component {
+
+ String label;
+
+ Color _color = Color.GREEN;
+
+ Item({ Object key, this.label }) : super(key: key);
+
+ Node render() {
+ return new Container(
+ children: [
+ new Radio(
+ onChanged: changed,
+ value: Color.GREEN,
+ groupValue: _color
+ ),
+ new Radio(
+ onChanged: changed,
+ value: Color.RED,
+ groupValue: _color
+ ),
+
+ new Text("$label: ${Color.values[_color.index]}")
+ ]
+ );
+ }
+
+ void changed(Object value) {
+ setState(() {
+ _color = value;
+ });
+ }
+}
« no previous file with comments | « sky/examples/fn/widgets/inksplash.dart ('k') | sky/examples/fn/widgets/menudivider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698