platform/angel_orm_generator/test/models/car.g.dart

79 lines
2 KiB
Dart
Raw Normal View History

2017-06-17 16:45:31 +00:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of angel_orm.generator.models.car;
2017-06-17 16:45:31 +00:00
// **************************************************************************
// Generator: JsonModelGenerator
// **************************************************************************
class Car extends _Car {
2017-06-24 21:21:32 +00:00
@override
String id;
2017-06-17 16:45:31 +00:00
@override
2017-06-18 04:19:05 +00:00
String make;
2017-06-17 16:45:31 +00:00
@override
2017-06-18 04:19:05 +00:00
String description;
2017-06-17 16:45:31 +00:00
@override
2017-06-18 04:19:05 +00:00
bool familyFriendly;
2017-06-17 16:45:31 +00:00
2017-06-18 04:19:05 +00:00
@override
DateTime recalledAt;
2017-06-18 22:40:23 +00:00
@override
2017-06-24 21:21:32 +00:00
DateTime createdAt;
@override
DateTime updatedAt;
2017-06-18 22:40:23 +00:00
Car(
2017-06-24 21:21:32 +00:00
{this.id,
this.make,
2017-06-18 22:40:23 +00:00
this.description,
this.familyFriendly,
this.recalledAt,
2017-06-24 21:21:32 +00:00
this.createdAt,
this.updatedAt});
2017-06-17 16:45:31 +00:00
factory Car.fromJson(Map data) {
return new Car(
2017-06-24 21:21:32 +00:00
id: data['id'],
2017-06-18 04:19:05 +00:00
make: data['make'],
description: data['description'],
2017-06-24 21:21:32 +00:00
familyFriendly: data['family_friendly'],
recalledAt: data['recalled_at'] is DateTime
? data['recalled_at']
: (data['recalled_at'] is String
? DateTime.parse(data['recalled_at'])
: null),
createdAt: data['created_at'] is DateTime
? data['created_at']
: (data['created_at'] is String
? DateTime.parse(data['created_at'])
2017-06-18 22:40:23 +00:00
: null),
2017-06-24 21:21:32 +00:00
updatedAt: data['updated_at'] is DateTime
? data['updated_at']
: (data['updated_at'] is String
? DateTime.parse(data['updated_at'])
: null));
2017-06-17 16:45:31 +00:00
}
Map<String, dynamic> toJson() => {
2017-06-24 21:21:32 +00:00
'id': id,
2017-06-18 04:19:05 +00:00
'make': make,
'description': description,
2017-06-24 21:21:32 +00:00
'family_friendly': familyFriendly,
'recalled_at': recalledAt == null ? null : recalledAt.toIso8601String(),
'created_at': createdAt == null ? null : createdAt.toIso8601String(),
'updated_at': updatedAt == null ? null : updatedAt.toIso8601String()
2017-06-17 16:45:31 +00:00
};
static Car parse(Map map) => new Car.fromJson(map);
2017-07-10 21:49:00 +00:00
Car clone() {
return new Car.fromJson(toJson());
}
2017-06-17 16:45:31 +00:00
}