platform/test/models/car.g.dart

46 lines
1.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.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;
Car({this.make, this.description, this.familyFriendly, this.recalledAt});
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-17 16:45:31 +00:00
: null));
}
Map<String, dynamic> toJson() => {
2017-06-18 04:19:05 +00:00
'make': make,
'description': description,
'familyFriendly': familyFriendly,
'recalledAt': recalledAt == null ? null : recalledAt.toIso8601String()
2017-06-17 16:45:31 +00:00
};
static Car parse(Map map) => new Car.fromJson(map);
}