platform/angel_serialize_generator/test/models/book.serializer.g.dart

47 lines
1.3 KiB
Dart
Raw Normal View History

// GENERATED CODE - DO NOT MODIFY BY HAND
part of angel_serialize.test.models.book;
// **************************************************************************
// Generator: SerializerGenerator
// **************************************************************************
2018-02-28 01:10:57 +00:00
abstract class BookSerializer {
2018-02-28 02:10:43 +00:00
static Book fromMap(Map map,
{String id,
String author,
String title,
String description,
int pageCount,
2018-03-05 06:18:46 +00:00
List<double> notModels,
2018-02-28 02:10:43 +00:00
DateTime createdAt,
DateTime updatedAt}) {
return new Book(
id: map['id'],
author: map['author'],
title: map['title'],
description: map['description'],
pageCount: map['page_count'],
2018-03-05 06:18:46 +00:00
notModels: map['not_models'],
2018-02-28 02:10:43 +00:00
createdAt: map['created_at'] != null
? DateTime.parse(map['created_at'])
: null,
updatedAt: map['updated_at'] != null
? DateTime.parse(map['updated_at'])
: null);
}
2018-02-28 01:41:19 +00:00
static Map<String, dynamic> toMap(Book model) {
2018-02-28 01:10:57 +00:00
return {
2018-02-28 01:41:19 +00:00
'id': model.id,
'author': model.author,
'title': model.title,
'description': model.description,
'page_count': model.pageCount,
2018-03-05 06:18:46 +00:00
'not_models': model.notModels,
2018-02-28 02:10:43 +00:00
'created_at': model.createdAt?.toIso8601String(),
'updated_at': model.updatedAt?.toIso8601String()
2018-02-28 01:10:57 +00:00
};
}
}