+ 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();
+ },
+ ),