setAgreement method

Future<void> setAgreement(
  1. Agreement agreement
)

Implementation

Future<void> setAgreement(Agreement agreement) async {
  this.agreement = agreement;
  if (agreement == Agreement.agree) {
    await addSensie(sensie: {
      'whipCount': whips,
      'signal': signal,
      'sensorData': sensorData,
      'flow': flowing,
    });
  }
  final resJSON = await storeSensieRequest(
    whips,
    flowing,
    agreement,
  );
  if (resJSON['data'] != null && resJSON['data']['sensie'] != null) {
    id = resJSON['data']['sensie']['id'];
  } else {
    debugPrint('Error: Invalid response JSON.');
  }
}