toJson method

  1. @override
Map<String, Object?> toJson()
override

Implementation

@override
Map<String, Object?> toJson() => {
  'kind': 'commands',
  'commands': [
    for (final command in commands)
      <String, Object?>{
        'verb': command.verb.name,
        if (command.c1 != null) 'c1': command.c1!.toJson(),
        if (command.c2 != null) 'c2': command.c2!.toJson(),
        if (command.verb != PathVerb.close) 'p': command.p.toJson(),
      },
  ],
};