toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
      'type': type.wire,
      'timestamp': timestamp.toUtc().toIso8601String(),
      if (reader != null) 'reader': reader!.toJson(),
      if (encryptedPayload != null)
        'encryptedPayload': encryptedPayload!.toJson(),
      if (arqcPayload != null) 'arqcPayload': arqcPayload!.toJson(),
      if (result != null) 'result': result!.toJson(),
      if (message != null) 'message': message,
      if (batteryPercent != null) 'batteryPercent': batteryPercent,
      if (error != null) 'error': error!.toJson(),
    };