fromJson static method

Trait<Object> fromJson(
  1. ShapeId shapeId,
  2. Object? jsonValue
)

Implementation

static Trait fromJson(ShapeId shapeId, Object? jsonValue) {
  if (!serializers.containsKey(shapeId)) {
    // TODO(dnys1): Log
    safePrint('No serializer found for $shapeId');
    return DynamicTrait._(shapeId, jsonValue ?? const <String, Object?>{});
  }
  return serializers[shapeId]!(jsonValue);
}