Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.34 KB | None | 0 0
  1.   @override
  2.   Widget build(BuildContext context) {
  3.     return BaseView<BalanceModel>(
  4.       builder: (context, child, model) {
  5.         print("List ==============> " + model.toString());
  6.  
  7.         return BusyOverlay(
  8.           show: model.state == ViewState.Busy,
  9.           child: SingleChildScrollView(
  10.             child: Column(
  11.               children: <Widget>[
  12.                 FutureBuilder<Map<String, dynamic>>(
  13.                   future: model.getPaymentBalance("test"),
  14.                   builder: (BuildContext context,
  15.                       AsyncSnapshot<Map<String, dynamic>> snapshot) {
  16.                     switch (snapshot.connectionState) {
  17.                       case ConnectionState.none:
  18.                         return Text('Press button to start.');
  19.                       case ConnectionState.active:
  20.                       case ConnectionState.waiting:
  21.                         return Text('Awaiting result...');
  22.                       case ConnectionState.done:
  23.                         if (snapshot.hasError)
  24.                           return Text('Error: ${snapshot.error}');
  25.                         return Text('Result: ${snapshot.data}');
  26.                     }
  27.                     return null; // unreachable
  28.                   },
  29.                 ),
  30.               ],
  31.             ),
  32.           ),
  33.         );
  34.       },
  35.     );
  36.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement