67 lines
2 KiB
Dart
67 lines
2 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of angel_serialize.test.models.book;
|
|
|
|
// **************************************************************************
|
|
// Generator: SerializerGenerator
|
|
// **************************************************************************
|
|
|
|
abstract class BookSerializer {
|
|
static Book fromMap(Map map) {
|
|
return new Book(
|
|
id: map['id'] as String,
|
|
author: map['author'] as String,
|
|
title: map['title'] as String,
|
|
description: map['description'] as String,
|
|
pageCount: map['page_count'] as int,
|
|
notModels: map['not_models'] as List<double>,
|
|
camelCaseString: map['camelCase'] as String,
|
|
createdAt: map['created_at'] != null
|
|
? (map['created_at'] is DateTime
|
|
? (map['created_at'] as DateTime)
|
|
: DateTime.parse(map['created_at']))
|
|
: null,
|
|
updatedAt: map['updated_at'] != null
|
|
? (map['updated_at'] is DateTime
|
|
? (map['updated_at'] as DateTime)
|
|
: DateTime.parse(map['updated_at']))
|
|
: null);
|
|
}
|
|
|
|
static Map<String, dynamic> toMap(Book model) {
|
|
if (model == null) {
|
|
return null;
|
|
}
|
|
return {
|
|
'id': model.id,
|
|
'author': model.author,
|
|
'title': model.title,
|
|
'description': model.description,
|
|
'page_count': model.pageCount,
|
|
'not_models': model.notModels,
|
|
'camelCase': model.camelCaseString,
|
|
'created_at': model.createdAt?.toIso8601String(),
|
|
'updated_at': model.updatedAt?.toIso8601String()
|
|
};
|
|
}
|
|
}
|
|
|
|
abstract class BookFields {
|
|
static const String id = 'id';
|
|
|
|
static const String author = 'author';
|
|
|
|
static const String title = 'title';
|
|
|
|
static const String description = 'description';
|
|
|
|
static const String pageCount = 'page_count';
|
|
|
|
static const String notModels = 'not_models';
|
|
|
|
static const String camelCaseString = 'camelCase';
|
|
|
|
static const String createdAt = 'created_at';
|
|
|
|
static const String updatedAt = 'updated_at';
|
|
}
|