afterSerialize method
Object?
afterSerialize(
- Object? object,
- FullType specifiedType
)
override
Implementation
@override // _ -> Value -> (Map) | _ -> Json -> _
Object? afterSerialize(Object? object, FullType specifiedType) {
if (object is int && specifiedType.root == DateTime) {
return fs.Timestamp.fromMicrosecondsSinceEpoch(object);
} else if (object is Iterable && specifiedType.root == geoPointConfig.type) {
final iterator = object.iterator;
final latitude = _serializeValue(iterator, geoPointConfig.latitudeName);
final longitude = _serializeValue(iterator, geoPointConfig.longitudeName);
return latitude is double && longitude is double ? fs.GeoPoint(latitude, longitude) : object;
}
return object;
}