sentUserData method
Implementation
Future<void> sentUserData({required String userId}) async {
if (host == null || port == null) return;
final url = Uri.parse('http://$host:$port/sentUserData');
try {
final response = await http.post(
url,
body: jsonEncode({'start': userId}),
headers: {'Content-Type': 'application/json'},
);
print('Response: ${response.body}');
connected = true;
} catch (e) {
print('Error sending: $e');
}
notifyListeners();
}