Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @override
- Widget build(BuildContext context) {
- return BaseView<BalanceModel>(
- builder: (context, child, model) {
- print("List ==============> " + model.toString());
- return BusyOverlay(
- show: model.state == ViewState.Busy,
- child: SingleChildScrollView(
- child: Column(
- children: <Widget>[
- FutureBuilder<Map<String, dynamic>>(
- future: model.getPaymentBalance("test"),
- builder: (BuildContext context,
- AsyncSnapshot<Map<String, dynamic>> snapshot) {
- switch (snapshot.connectionState) {
- case ConnectionState.none:
- return Text('Press button to start.');
- case ConnectionState.active:
- case ConnectionState.waiting:
- return Text('Awaiting result...');
- case ConnectionState.done:
- if (snapshot.hasError)
- return Text('Error: ${snapshot.error}');
- return Text('Result: ${snapshot.data}');
- }
- return null; // unreachable
- },
- ),
- ],
- ),
- ),
- );
- },
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement