Created
May 10, 2024 17:01
-
-
Save yjbanov/57965b689d86d9bd62906e1ee31693ac 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
@widget Counter { | |
final int initialValue; | |
@state { | |
int count = initialValue; | |
String buttonLabel = 'Increment'; | |
} | |
Widget build(context) { | |
return Column(children: [ | |
Text('$greeting, ${state.count}!'), | |
GestureDetector( | |
onTap: () { | |
state.count++; | |
}, | |
child: Text(state.buttonLabel), | |
), | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment