From bc56f91be6a4916db56d4562da84a39075871a22 Mon Sep 17 00:00:00 2001 From: Kevin Worth Date: Sun, 10 May 2020 16:27:16 -0400 Subject: [PATCH] Put back the Column in main.dart 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 | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/flutterempires/lib/main.dart b/flutterempires/lib/main.dart index c92508b..a252d45 100644 --- a/flutterempires/lib/main.dart +++ b/flutterempires/lib/main.dart @@ -85,6 +85,58 @@ class _MyHomePageState extends State { body: new Container( margin: const EdgeInsets.only(left: 20.0, right: 20.0), child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 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( + 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>( + 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>( future: allPlayers, builder: (context, snapshot) { -- 2.43.0