]> git.cworth.org Git - lmno.games/commitdiff
Move the FutureBuilder into the Column (does not work)
authorKevin Worth <kworth082@gmail.com>
Sun, 10 May 2020 20:28:53 +0000 (16:28 -0400)
committerCarl Worth <cworth@cworth.org>
Sat, 23 May 2020 13:49:00 +0000 (06:49 -0700)
Again, this is a commit to get us back to the broken state before more
properly fixing things.

flutterempires/lib/main.dart

index a252d45ad6b209e8776a23eb7df1fba938bffe90..0685857d349cbfc925164ef09e61647a81b157ab 100644 (file)
@@ -135,23 +135,24 @@ class _MyHomePageState extends State<MyHomePage> {
                 },
               ),
               Spacer(flex: 10),
+              FutureBuilder<List<Player>>(
+                  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<List<Player>>(
-              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(