]> git.cworth.org Git - lmno.games/commitdiff
Add class RegisteredUser with name and character attributes
authorKevin Worth <kworth082@gmail.com>
Sun, 3 May 2020 02:40:48 +0000 (22:40 -0400)
committerCarl Worth <cworth@cworth.org>
Sat, 23 May 2020 13:49:00 +0000 (06:49 -0700)
This data model will be used when POSTing to /register

See:
    git://git.cworth.org/git/empires-api/api.text
    at commit 0411bdc

flutterempires/lib/registered_user.dart [new file with mode: 0644]

diff --git a/flutterempires/lib/registered_user.dart b/flutterempires/lib/registered_user.dart
new file mode 100644 (file)
index 0000000..4e1a2ab
--- /dev/null
@@ -0,0 +1,13 @@
+class RegisteredUser {
+  final String name;
+  final String character;
+
+  RegisteredUser({this.name, this.character});
+
+  factory RegisteredUser.fromJson(Map<String, dynamic> json) {
+    return RegisteredUser(
+      name: json['name'],
+      character: json['character'],
+    );
+  }
+}