-
-
Save abbath0767/3c372b27b641263b9366583bd56a41f4 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
class TestWidget extends StatefulWidget{ | |
@override | |
State<StatefulWidget> createState() => TestState(); | |
} | |
class TestState extends State<TestWidget> { | |
String _text; | |
@override | |
Widget build(BuildContext context) { | |
if (_text == null) | |
_text = "Empty"; | |
return Text(_text); | |
} | |
void updateText(String newText) { | |
setState(() { | |
this._text = newText; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment