deserialize method

  1. @override
RRect deserialize(
  1. dynamic value,
  2. DogEngine engine
)
override

Deserializes the given value from a DogNativeCodec native value.

Implementation

@override
RRect deserialize(value, DogEngine engine) {
  var map = readAsMap(value, engine);
  final rect = map.read<Rect>("dimensions");
  final borderRadius = map.read<BorderRadius>("radii");
  return RRect.fromRectAndCorners(
    rect,
    topLeft: borderRadius.topLeft,
    topRight: borderRadius.topRight,
    bottomLeft: borderRadius.bottomLeft,
    bottomRight: borderRadius.bottomRight,
  );
}