Advertisement
Guest User

Untitled

a guest
Jul 8th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.52 KB | None | 0 0
  1. class ExampleState extends State<Example> {
  2.  
  3.   bool condition = false;
  4.  
  5.   @override
  6.   Widget build(BuildContext context) {
  7.     Widget myWidget;
  8.     if (condition) {
  9.       myWidget = Center(child: CircularProgressIndicator());
  10.     } else {
  11.       myWidget = Center(child: Text("Un testo"));
  12.     }
  13.     return Scaffold(
  14.       body: myWidget,
  15.       floatingActionButton: FloatingActionButton(
  16.         onPressed: () {
  17.           setState(() {
  18.             condition = true;
  19.           });
  20.         },
  21.       ),
  22.     );
  23.   }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement