Just what we need -- another cross-platform mobile framework! Is Flutter ready for prime time? We'll take a tour of the ecosystem and learn enough to be dangerous.
Foo(this.title); Widget build(BuildContext ctx) => FlatButton.icon( icon: Icon(Icons.star), label: Text(title), ...); } Widget has a build method. BuildContext is a hook into the tree.
Color color const Theme( this.color, Widget child, ) : super(child); static Color of(BuildContext ctx) => ctx.inheritFrom(Theme).color; bool updateShouldNotify(Theme old) => old.color != color; } Has a static method, of. Returns the nearest instance, or its data. inheritFrom wires in ctx as a dependency. When Theme rebuilds, notify ctx. Don't need rebuilds? Use ctx.ancestorOfType instead.