startData method

Future<void> startData()

Implementation

Future<void> startData() async {
  if (host == null || port == null) return;
  final url = Uri.parse('http://$host:$port/start');

  try {
    final response = await http.post(
      url,
      body: jsonEncode({'start': "start"}),
      headers: {'Content-Type': 'application/json'},
    );

      connected = true;

  } catch (e) {
    print('Error sending: $e');
  }
  notifyListeners();
}