KeyShapeSpec.fromJson constructor

KeyShapeSpec.fromJson(
  1. Object? json
)

Implementation

factory KeyShapeSpec.fromJson(Object? json) {
  final j = _map(json, 'KeyShapeSpec');
  return KeyShapeSpec(
    kind: _enumByName(KeyShapeKind.values, j['kind'], 'shape kind'),
    cornerPermille: _int(j, 'cornerPermille'),
    m3eShape: j['m3eShape'] == null
        ? null
        : _enumByName(M3eShape.values, j['m3eShape'], 'm3e shape'),
    morphTo: j['morphTo'] == null
        ? null
        : _enumByName(KeyShapeKind.values, j['morphTo'], 'morph target'),
    morphCornerPermille: _intOrNull(j, 'morphCornerPermille'),
    operatorKind: j['operatorKind'] == null
        ? null
        : _enumByName(KeyShapeKind.values, j['operatorKind'], 'op shape'),
    operatorM3eShape: j['operatorM3eShape'] == null
        ? null
        : _enumByName(M3eShape.values, j['operatorM3eShape'], 'op m3e'),
  );
}