From 893153993716d14aa37813af19fd7dff83f70af3 Mon Sep 17 00:00:00 2001 From: Kevin Worth Date: Sun, 3 May 2020 22:39:44 -0400 Subject: [PATCH] Change fetchPlayer to fetchFirstPlayer Initially I was going to fix the logic in this method to fit the name, but instead - for the time being - I'll simply make the name more accurately describe what the method is doing. --- flutterempires/lib/main.dart | 2 +- flutterempires/lib/player.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flutterempires/lib/main.dart b/flutterempires/lib/main.dart index 816b13e..e313be1 100644 --- a/flutterempires/lib/main.dart +++ b/flutterempires/lib/main.dart @@ -58,7 +58,7 @@ class _MyHomePageState extends State { @override void initState() { super.initState(); - futurePlayer = Player.fetchPlayer(); + futurePlayer = Player.fetchFirstPlayer(); } void _incrementCounter() { diff --git a/flutterempires/lib/player.dart b/flutterempires/lib/player.dart index c25a53b..36d7ced 100644 --- a/flutterempires/lib/player.dart +++ b/flutterempires/lib/player.dart @@ -15,7 +15,7 @@ class Player { ); } - static Future fetchPlayer() async { + static Future fetchFirstPlayer() async { final response = await http.get('https://families.cworth.org/api/players'); if (response.statusCode == 200) { -- 2.43.0