},
),
Spacer(flex: 10),
+ 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(