2017-06-17 16:45:31 +00:00
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
|
|
|
part of angel_orm.test.models.car;
|
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// Generator: JsonModelGenerator
|
|
|
|
// Target: class _Car
|
|
|
|
// **************************************************************************
|
|
|
|
|
|
|
|
class Car extends _Car {
|
|
|
|
@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
|
|
|
|
List tires;
|
|
|
|
|
|
|
|
Car(
|
|
|
|
{this.make,
|
|
|
|
this.description,
|
|
|
|
this.familyFriendly,
|
|
|
|
this.recalledAt,
|
|
|
|
this.tires});
|
2017-06-17 16:45:31 +00:00
|
|
|
|
|
|
|
factory Car.fromJson(Map data) {
|
|
|
|
return new Car(
|
2017-06-18 04:19:05 +00:00
|
|
|
make: data['make'],
|
|
|
|
description: data['description'],
|
|
|
|
familyFriendly: data['familyFriendly'],
|
|
|
|
recalledAt: data['recalledAt'] is DateTime
|
|
|
|
? data['recalledAt']
|
|
|
|
: (data['recalledAt'] is String
|
|
|
|
? DateTime.parse(data['recalledAt'])
|
2017-06-18 22:40:23 +00:00
|
|
|
: null),
|
|
|
|
tires: data['tires']);
|
2017-06-17 16:45:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
2017-06-18 04:19:05 +00:00
|
|
|
'make': make,
|
|
|
|
'description': description,
|
|
|
|
'familyFriendly': familyFriendly,
|
2017-06-18 22:40:23 +00:00
|
|
|
'recalledAt': recalledAt == null ? null : recalledAt.toIso8601String(),
|
|
|
|
'tires': tires
|
2017-06-17 16:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static Car parse(Map map) => new Car.fromJson(map);
|
|
|
|
}
|