Created
September 12, 2015 00:18
-
-
Save abarth/0ea4fd11ae20bc19bdc6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:sky/widgets.dart'; | |
| class Inside extends StatefulComponent { | |
| void syncConstructorArguments(Inside source) { | |
| } | |
| Widget build() { | |
| return new Listener( | |
| onPointerDown: _handlePointerDown, | |
| child: new Container( | |
| decoration: new BoxDecoration( | |
| backgroundColor: new Color(0xFFFFFF00) | |
| ) | |
| ) | |
| ); | |
| } | |
| EventDisposition _handlePointerDown(_) { | |
| setState(() { }); | |
| return EventDisposition.processed; | |
| } | |
| } | |
| class Middle extends StatefulComponent { | |
| Inside child; | |
| Middle({ this.child }); | |
| void syncConstructorArguments(Middle source) { | |
| child = source.child; | |
| } | |
| Widget build() { | |
| return new Listener( | |
| onPointerDown: _handlePointerDown, | |
| child: child | |
| ); | |
| } | |
| EventDisposition _handlePointerDown(_) { | |
| setState(() { }); | |
| return EventDisposition.processed; | |
| } | |
| } | |
| class Outside extends App { | |
| Widget build() { | |
| return new Middle(child: new Inside()); | |
| } | |
| } | |
| void main() { | |
| runApp(new Outside()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment