From b34b7ef1ccb4e97c24bf3debf3abd4e515e6375a Mon Sep 17 00:00:00 2001 From: Kevin Worth Date: Sun, 10 May 2020 16:28:53 -0400 Subject: [PATCH] Move the FutureBuilder into the Column (does not work) Again, this is a commit to get us back to the broken state before more properly fixing things. --- flutterempires/lib/main.dart | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/flutterempires/lib/main.dart b/flutterempires/lib/main.dart index a252d45..0685857 100644 --- a/flutterempires/lib/main.dart +++ b/flutterempires/lib/main.dart @@ -135,23 +135,24 @@ class _MyHomePageState extends State { }, ), Spacer(flex: 10), + FutureBuilder>( + future: allPlayers, + builder: (context, snapshot) { + if (snapshot.hasData) { + return ListView.builder( + itemCount: snapshot.data.length, + itemBuilder: (context, index) { + return ListTile( + title: Text( + snapshot.data[index].name.toString())); + }); + } else if (snapshot.hasError) { + return Text("${snapshot.error}"); + } + return CircularProgressIndicator(); + }), ], ), - child: FutureBuilder>( - future: allPlayers, - builder: (context, snapshot) { - if (snapshot.hasData) { - return ListView.builder( - itemCount: snapshot.data.length, - itemBuilder: (context, index) { - return ListTile( - title: Text(snapshot.data[index].name.toString())); - }); - } else if (snapshot.hasError) { - return Text("${snapshot.error}"); - } - return CircularProgressIndicator(); - }), ), ), floatingActionButton: FloatingActionButton( -- 2.43.0