@@ -1279,8 +1279,6 @@ class _TagModelType extends ModelType<Tag> {
1279
1279
class PostTags extends Model {
1280
1280
static const classType = const _PostTagsModelType();
1281
1281
final String id;
1282
- final String postID;
1283
- final String tagID;
1284
1282
final Post post;
1285
1283
final Tag tag;
1286
1284
@@ -1293,24 +1291,11 @@ class PostTags extends Model {
1293
1291
}
1294
1292
1295
1293
const PostTags._internal(
1296
- {@required this.id,
1297
- @required this.postID,
1298
- @required this.tagID,
1299
- @required this.post,
1300
- @required this.tag});
1294
+ {@required this.id, @required this.post, @required this.tag});
1301
1295
1302
- factory PostTags(
1303
- {String id,
1304
- @required String postID,
1305
- @required String tagID,
1306
- @required Post post,
1307
- @required Tag tag}) {
1296
+ factory PostTags({String id, @required Post post, @required Tag tag}) {
1308
1297
return PostTags._internal(
1309
- id: id == null ? UUID.getUUID() : id,
1310
- postID: postID,
1311
- tagID: tagID,
1312
- post: post,
1313
- tag: tag);
1298
+ id: id == null ? UUID.getUUID() : id, post: post, tag: tag);
1314
1299
}
1315
1300
1316
1301
bool equals(Object other) {
@@ -1322,8 +1307,6 @@ class PostTags extends Model {
1322
1307
if (identical(other, this)) return true;
1323
1308
return other is PostTags &&
1324
1309
id == other.id &&
1325
- postID == other.postID &&
1326
- tagID == other.tagID &&
1327
1310
post == other.post &&
1328
1311
tag == other.tag;
1329
1312
}
@@ -1337,47 +1320,31 @@ class PostTags extends Model {
1337
1320
1338
1321
buffer.write(\\"PostTags {\\");
1339
1322
buffer.write(\\"id=\\" + \\"$id\\" + \\", \\");
1340
- buffer.write(\\"postID=\\" + \\"$postID\\" + \\", \\");
1341
- buffer.write(\\"tagID=\\" + \\"$tagID\\" + \\", \\");
1342
1323
buffer.write(\\"post=\\" + (post != null ? post.toString() : \\"null\\") + \\", \\");
1343
1324
buffer.write(\\"tag=\\" + (tag != null ? tag.toString() : \\"null\\"));
1344
1325
buffer.write(\\"}\\");
1345
1326
1346
1327
return buffer.toString();
1347
1328
}
1348
1329
1349
- PostTags copyWith(
1350
- {String id, String postID, String tagID, Post post, Tag tag}) {
1330
+ PostTags copyWith({String id, Post post, Tag tag}) {
1351
1331
return PostTags(
1352
- id: id ?? this.id,
1353
- postID: postID ?? this.postID,
1354
- tagID: tagID ?? this.tagID,
1355
- post: post ?? this.post,
1356
- tag: tag ?? this.tag);
1332
+ id: id ?? this.id, post: post ?? this.post, tag: tag ?? this.tag);
1357
1333
}
1358
1334
1359
1335
PostTags.fromJson(Map<String, dynamic> json)
1360
1336
: id = json['id'],
1361
- postID = json['postID'],
1362
- tagID = json['tagID'],
1363
1337
post = json['post'] != null
1364
1338
? Post.fromJson(new Map<String, dynamic>.from(json['post']))
1365
1339
: null,
1366
1340
tag = json['tag'] != null
1367
1341
? Tag.fromJson(new Map<String, dynamic>.from(json['tag']))
1368
1342
: null;
1369
1343
1370
- Map<String, dynamic> toJson() => {
1371
- 'id': id,
1372
- 'postID': postID,
1373
- 'tagID': tagID,
1374
- 'post': post?.toJson(),
1375
- 'tag': tag?.toJson()
1376
- };
1344
+ Map<String, dynamic> toJson() =>
1345
+ {'id': id, 'post': post?.toJson(), 'tag': tag?.toJson()};
1377
1346
1378
1347
static final QueryField ID = QueryField(fieldName: \\"postTags.id\\");
1379
- static final QueryField POSTID = QueryField(fieldName: \\"postID\\");
1380
- static final QueryField TAGID = QueryField(fieldName: \\"tagID\\");
1381
1348
static final QueryField POST = QueryField(
1382
1349
fieldName: \\"post\\",
1383
1350
fieldType: ModelFieldType(ModelFieldTypeEnum.model,
@@ -1393,16 +1360,6 @@ class PostTags extends Model {
1393
1360
1394
1361
modelSchemaDefinition.addField(ModelFieldDefinition.id());
1395
1362
1396
- modelSchemaDefinition.addField(ModelFieldDefinition.field(
1397
- key: PostTags.POSTID,
1398
- isRequired: true,
1399
- ofType: ModelFieldType(ModelFieldTypeEnum.string)));
1400
-
1401
- modelSchemaDefinition.addField(ModelFieldDefinition.field(
1402
- key: PostTags.TAGID,
1403
- isRequired: true,
1404
- ofType: ModelFieldType(ModelFieldTypeEnum.string)));
1405
-
1406
1363
modelSchemaDefinition.addField(ModelFieldDefinition.belongsTo(
1407
1364
key: PostTags.POST,
1408
1365
isRequired: true,
0 commit comments