Last active
September 6, 2022 20:22
-
-
Save ilopX/87ea46a56f846163e49eeca3c5215a66 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
| final column = OutVar<Column>(); | |
| init( | |
| Center( | |
| child: Column( | |
| outVar: column, | |
| space: 20, | |
| align: Align.start, | |
| children: [ | |
| Box( | |
| width: 100, | |
| height: 100, | |
| color: 'LightSalmon', | |
| onClick: (self) { | |
| (self as Box); | |
| self.width += 40; | |
| if (self.width > 800) { | |
| self.width = 100; | |
| } | |
| }, | |
| ), | |
| Box( | |
| width: 200, | |
| height: 100, | |
| color: 'LightSkyBlue', | |
| onClick: (_) { | |
| column.space += 5; | |
| if (column.space > 100) { | |
| column.space = 1; | |
| } | |
| }, | |
| ), | |
| Box( | |
| width: 80, | |
| height: 100, | |
| color: 'SlateGrey', | |
| onClick: (_) { | |
| column.add( | |
| Box( | |
| width: 200, | |
| height: 10, | |
| color: 'SlateGrey' | |
| ), | |
| ); | |
| }, | |
| ), | |
| Box( | |
| width: 400, | |
| height: 50, | |
| color: 'MediumAquaMarine', | |
| onClick: (_) { | |
| if (column.align == Align.start) { | |
| column.align = Align.center; | |
| } else { | |
| column.align = Align.start; | |
| } | |
| } | |
| ), | |
| ], | |
| ), | |
| ), | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
