From: Kevin Worth Date: Thu, 23 Dec 2021 19:48:38 +0000 (-0500) Subject: STASHING CHANGES TO GET THEM OFF HANDROID X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=commitdiff_plain;h=0a1340f010d8945ccb9550d4cf9b688415ac61d5 STASHING CHANGES TO GET THEM OFF HANDROID --- diff --git a/flempires/lib/player.dart b/flempires/lib/player.dart index aa87c84..02df4f2 100644 --- a/flempires/lib/player.dart +++ b/flempires/lib/player.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import 'package:flempires/webService.dart'; import 'package:http/http.dart' as http; class Player { @@ -15,6 +16,34 @@ class Player { ); } +// static Resource> get all { +// +// return Resource( +// url: Constants.HEADLINE_NEWS_URL, +// parse: (response) { +// final result = json.decode(response.body); +// Iterable list = result['articles']; +// return list.map((model) => NewsArticle.fromJson(model)).toList(); +// } +// ); +// +// } + +// static Request> get all (String code) { +// +// } + + static Request> get all { + return Request( + url: 'https://families.cworth.org/api/players', + type: 'Player', + parse: (response) { + final result = json.decode(response.body); + Iterable list = result['players']; + return list.map((model) => Player.fromJson(model)).toList(); + }); + } + static Future fetchFirstPlayer() async { final response = await http.get('https://families.cworth.org/api/players');