KeyStyleSpec.fromJson constructor

KeyStyleSpec.fromJson(
  1. Object? json
)

Implementation

factory KeyStyleSpec.fromJson(Object? json) {
  final j = _map(json, 'KeyStyleSpec');
  int optional(String k) => j[k] == null ? 0 : _int(j, k);
  return KeyStyleSpec(
    kind: _enumByName(KeyStyleKind.values, j['kind'], 'style kind'),
    outlineWidthCdp: _int(j, 'outlineWidthCdp'),
    extrudeDepthCdp: _int(j, 'extrudeDepthCdp'),
    shadowOffsetCdp: _int(j, 'shadowOffsetCdp'),
    shadowBlurCdp: _int(j, 'shadowBlurCdp'),
    opacityPermille: _int(j, 'opacityPermille'),
    edgeShadePermille: _int(j, 'edgeShadePermille'),
    stateLayerPermille: _int(j, 'stateLayerPermille'),
    frostPermille: optional('frostPermille'),
    highlightPermille: optional('highlightPermille'),
    refractionPermille: optional('refractionPermille'),
  );
}