sendMessage static method

Future<String> sendMessage(
  1. String message
)

Implementation

static Future<String> sendMessage(String message) async {
  try {
    final response = await http.get(
      Uri.parse('$baseUrl/$message'),
    );

    if (response.statusCode == 200) {
      return response.body;
    } else {
      throw Exception('فشل في إرسال الرسالة');
    }
  } catch (e) {
    throw Exception('خطأ في الاتصال: $e');
  }
}