From 58d538aad057038a52e939911f8a33b72f6ea075 Mon Sep 17 00:00:00 2001
From: Kevin Worth <kworth082@gmail.com>
Date: Fri, 8 May 2020 11:01:21 -0400
Subject: [PATCH] Rip out column and just show player list view

This was the easiest thing to do quickly, because a list view does not
play nicely inside of a column widget (can't put a scrollable inside of
a scrollable, sort of thing...)

Eventually, we need to combine the views or make separate screens for
each one.
---
 flutterempires/lib/main.dart | 67 ++++++++----------------------------
 1 file changed, 15 insertions(+), 52 deletions(-)

diff --git a/flutterempires/lib/main.dart b/flutterempires/lib/main.dart
index 5a7981b..ae5441f 100644
--- a/flutterempires/lib/main.dart
+++ b/flutterempires/lib/main.dart
@@ -84,58 +84,21 @@ class _MyHomePageState extends State<MyHomePage> {
       body: new Container(
         margin: const EdgeInsets.only(left: 20.0, right: 20.0),
         child: Center(
-          child: Column(
-            mainAxisAlignment: MainAxisAlignment.center,
-            crossAxisAlignment: CrossAxisAlignment.start,
-            children: <Widget>[
-              Spacer(flex: 1),
-              Text(
-                'Name:',
-                style: Theme.of(context).textTheme.headline4,
-              ),
-              TextField(
-                decoration: InputDecoration(
-                  hintText: 'Enter your (real) name',
-                ),
-              ),
-              Spacer(flex: 1),
-              Text(
-                'Character:',
-                style: Theme.of(context).textTheme.headline4,
-              ),
-              TextField(
-                decoration: InputDecoration(
-                  hintText: 'Enter your empire character name',
-                ),
-              ),
-              Spacer(flex: 1),
-              FutureBuilder<Player>(
-                future: futurePlayer,
-                builder: (context, snapshot) {
-                  if (snapshot.hasData) {
-                    return Text(snapshot.data.name);
-                  } else if (snapshot.hasError) {
-                    return Text("${snapshot.error}");
-                  }
-                  return CircularProgressIndicator();
-                },
-              ),
-              Spacer(flex: 1),
-              FutureBuilder<List<Player>>(
-                future: allPlayers,
-                builder: (context, snapshot) {
-                  if (snapshot.hasData) {
-                    return Text(snapshot.data.length.toString());
-                  } else if (snapshot.hasError) {
-                    return Text("${snapshot.error}");
-                  }
-                  // By default, show a loading spinner.
-                  return CircularProgressIndicator();
-                },
-              ),
-              Spacer(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();
+              }),
         ),
       ),
       floatingActionButton: FloatingActionButton(
-- 
2.45.2