Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ExampleState extends State<Example> {
- bool condition = false;
- @override
- Widget build(BuildContext context) {
- Widget myWidget;
- if (condition) {
- myWidget = Center(child: CircularProgressIndicator());
- } else {
- myWidget = Center(child: Text("Un testo"));
- }
- return Scaffold(
- body: myWidget,
- floatingActionButton: FloatingActionButton(
- onPressed: () {
- setState(() {
- condition = true;
- });
- },
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement