SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. //...........................................
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top