]> git.cworth.org Git - lmno.games/commit
Add initState to start the async call to fetch player
authorKevin Worth <kworth082@gmail.com>
Mon, 4 May 2020 00:21:31 +0000 (20:21 -0400)
committerCarl Worth <cworth@cworth.org>
Sat, 23 May 2020 13:49:00 +0000 (06:49 -0700)
commit6382d12f524932ff1d26957e86428047714b128c
tree4c671d1f7d7f8053692d33c66bc5f7fb55c0247d
parent584dc2906ede9ec4b39a7870b5875154b0968ed3
Add initState to start the async call to fetch player

initState is a good place to do asynchronous calls that we just
need to happen one time at the beginning.

So, in initStart we fetch the player and put it in a Future, and then
when (each and every time) build gets called, it uses what has
been fetched or shows the spinner if the fetch hasn't completed
successfully yet.
flutterempires/lib/main.dart