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

35 lines
931 B
Dart
Raw Normal View History

2018-06-27 05:36:57 +00:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'with_enum.dart';
// **************************************************************************
2018-06-29 04:11:57 +00:00
// SerializerGenerator
2018-06-27 05:36:57 +00:00
// **************************************************************************
abstract class WithEnumSerializer {
static WithEnum fromMap(Map map) {
return new WithEnum(
type: map['type'] is WithEnumType
? map['type']
2018-06-27 05:45:46 +00:00
: (map['type'] is int ? WithEnumType.values[map['type']] : null),
finalList: map['final_list'] as List<int>);
2018-06-27 05:36:57 +00:00
}
static Map<String, dynamic> toMap(WithEnum model) {
2018-06-28 01:58:42 +00:00
if (model == null) {
return null;
}
2018-06-27 05:36:57 +00:00
return {
'type':
2018-06-27 05:45:46 +00:00
model.type == null ? null : WithEnumType.values.indexOf(model.type),
'final_list': model.finalList
2018-06-27 05:36:57 +00:00
};
}
}
abstract class WithEnumFields {
static const String type = 'type';
2018-06-27 05:45:46 +00:00
static const String finalList = 'final_list';
2018-06-27 05:36:57 +00:00
}