Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. //...........................................
  2. body: FutureBuilder<String>(
  3. future: fetchJoke(),
  4. builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
  5. switch (snapshot.connectionState) {
  6. case ConnectionState.none:
  7. case ConnectionState.active:
  8. case ConnectionState.waiting:
  9. return Center(child: CircularProgressIndicator());
  10. case ConnectionState.done:
  11. return Center(
  12. child: Text(snapshot.hasError ? snapshot.error : snapshot.data,
  13. style: TextStyle(fontSize: 22.0)),
  14. );
  15. }
  16. },
  17. ),
  18. //...........................................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement