]> git.cworth.org Git - lmno.games/commitdiff
Put back the Column in main.dart
authorKevin Worth <kworth082@gmail.com>
Sun, 10 May 2020 20:27:16 +0000 (16:27 -0400)
committerCarl Worth <cworth@cworth.org>
Sat, 23 May 2020 13:49:00 +0000 (06:49 -0700)
This is a quasi-revert of e318ede47bc5b8563db84ce2c676c6a9297c860e

...where we took a shortcut by removing a bunch of stuff just to get
things to work, now we're putting it back in the broken state and some
following commits will fix it.

flutterempires/lib/main.dart

index c92508bebecda377b6791f2f163cb0fad09d7f57..a252d45ad6b209e8776a23eb7df1fba938bffe90 100644 (file)
@@ -85,6 +85,58 @@ 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) {