platform/angel_serialize_generator/test/models/has_map.dart
2019-01-09 14:25:05 -05:00

19 lines
478 B
Dart

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
abstract class _HasMap {
@SerializableField(
serializer: #_toString,
deserializer: #_fromString,
isNullable: false,
serializesTo: String)
Map get value;
}