platform/packages/client/test/shared.dart
Tobe O 998aa62303 Add 'packages/client/' from commit '180edbc46a556f6d572c3b4ade4b396a31a1bc42'
git-subtree-dir: packages/client
git-subtree-mainline: ae0afd3408
git-subtree-split: 180edbc46a
2020-02-15 18:28:35 -05:00

28 lines
652 B
Dart

import 'package:angel_model/angel_model.dart';
class Postcard extends Model {
String location;
String message;
Postcard({String id, this.location, this.message}) {
this.id = id;
}
factory Postcard.fromJson(Map data) => new Postcard(
id: data['id'].toString(),
location: data['location'].toString(),
message: data['message'].toString());
@override
bool operator ==(other) {
if (!(other is Postcard)) return false;
return id == other.id &&
location == other.location &&
message == other.message;
}
Map toJson() {
return {'id': id, 'location': location, 'message': message};
}
}