userJoinFarm method Null safety
- String farmId
Implementation
Future<bool> userJoinFarm(String farmId) async {
try {
RestOptions options = RestOptions(
path: '/api/user/join_farm',
queryParameters: {"farm_id": farmId},
body: Uint8List.fromList([]),
);
RestOperation restOperation = Amplify.API.post(restOptions: options);
await restOperation.response;
return true;
} catch (e) {
LogManager().addLog('check_farm call failed: $e', screen: runtimeType.toString());
return false;
}
}