toJson method

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

Implementation

@override
Map<String, Object?> toJson() => {
  'call': method,
  if (target != null) 'on': target!.toJson(),
  if (positional.isNotEmpty)
    'positional': [for (final p in positional) p.toJson()],
  if (named.isNotEmpty)
    'named': {for (final e in named.entries) e.key: e.value.toJson()},
  if (result != null) 'result': result!.toJson(),
};