}
class _MyHomePageState extends State<MyHomePage> {
- int _counter = 0;
-
Future<Player> futurePlayer;
Future<List<Player>> allPlayers;
allPlayers = Player.fetchAllPlayers();
}
- void _incrementCounter() {
+ void onPressPlusButton() {
setState(() {
- // This call to setState tells the Flutter framework that something has
- // changed in this State, which causes it to rerun the build method below
- // so that the display can reflect the updated values. If we changed
- // _counter without calling setState(), then the build method would not be
- // called again, and so nothing would appear to happen.
- _counter++;
+ // Probably use this to POST player name and character
});
}
),
body: new Container(
margin: const EdgeInsets.only(left: 20.0, right: 20.0),
- child : Center(
+ child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
- Spacer(flex: 10),
+ Spacer(flex: 1),
Text(
'Name:',
style: Theme.of(context).textTheme.headline4,
),
),
floatingActionButton: FloatingActionButton(
- onPressed: _incrementCounter,
+ onPressed: onPressPlusButton,
tooltip: 'Increment',
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.