platform/angel_serialize_generator/test/models/has_map.dart

17 lines
466 B
Dart
Raw Normal View History

2019-01-07 01:38:04 +00:00
import 'dart:convert';
import 'package:angel_serialize/angel_serialize.dart';
import 'package:collection/collection.dart';
import 'package:meta/meta.dart';
part 'has_map.g.dart';
Map _fromString(v) => json.decode(v.toString()) as Map;
String _toString(Map v) => json.encode(v);
@Serializable(autoIdAndDateFields: false)
abstract class _HasMap {
@SerializableField(
serializer: #_toString, deserializer: #_fromString, isNullable: false)
Map get value;
}