]> 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)
committerKevin Worth <kworth082@gmail.com>
Fri, 8 May 2020 13:36:39 +0000 (09:36 -0400)
commit4e0139884eb7d6e7f290ec80dd0c51c22dbaa625
tree4c671d1f7d7f8053692d33c66bc5f7fb55c0247d
parent37462cae6ede4e22f8d1a1e9dbb22ec42794bba7
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