]> git.cworth.org Git - lmno.games/blobdiff - flutterempires/lib/main.dart
Add Expanded to fix the scrollable in a scrollable problem
[lmno.games] / flutterempires / lib / main.dart
index a252d45ad6b209e8776a23eb7df1fba938bffe90..7bb337c1b7b2b35cf158e276443e3d73a07c670f 100644 (file)
@@ -134,24 +134,27 @@ class _MyHomePageState extends State<MyHomePage> {
                   return CircularProgressIndicator();
                 },
               ),
-              Spacer(flex: 10),
+              Expanded(
+                flex: 10,
+              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();
+                  }),
+              ),
             ],
           ),
-          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(