setAgreement method
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.');
}
}