toJson method

Map<String, Object?> toJson()

The canonical JSON map the CLI prints verbatim.

Implementation

Map<String, Object?> toJson() => switch (this) {
  TapFound() => {'result': 'found', 'tapped': true},
  TapDisabled() => {'result': 'disabled', 'tapped': false},
  TapNotFound() => {'result': 'notFound', 'tapped': false},
  TapError(:final message) => {
    'result': 'error',
    'tapped': false,
    'message': message,
  },
};