Map<String, Object?> toMap() => <String, Object?>{ 'state': state.wireName, 'retryable': isRetryable, if (reason != null) 'reason': reason, };