diff --git a/app/Services/WhatsAppProxyService.php b/app/Services/WhatsAppProxyService.php index 6dc1d3a..406ecbd 100644 --- a/app/Services/WhatsAppProxyService.php +++ b/app/Services/WhatsAppProxyService.php @@ -39,7 +39,9 @@ class WhatsAppProxyService $payload = [ "to" => $to, - "message" => $message + "message" => [ + "text" => $message + ] ]; $curl = curl_init(); diff --git a/musadaq-app/lib/features/auth/views/phone_input_view.dart b/musadaq-app/lib/features/auth/views/phone_input_view.dart index 1d96357..2a1e3a8 100644 --- a/musadaq-app/lib/features/auth/views/phone_input_view.dart +++ b/musadaq-app/lib/features/auth/views/phone_input_view.dart @@ -12,54 +12,56 @@ class PhoneInputView extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('تسجيل الدخول')), - body: Padding( - padding: const EdgeInsets.all(24.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const Icon(Icons.security, size: 80, color: Color(0xFF0F4C81)), - const SizedBox(height: 32), - const Text( - 'أهلاً بك في مُصادَق', - style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), - textAlign: TextAlign.center, - ), - const SizedBox(height: 8), - const Text( - 'أدخل رقم هاتفك المسجل في النظام لتسجيل الدخول', - textAlign: TextAlign.center, - style: TextStyle(color: Colors.grey), - ), - const SizedBox(height: 32), - TextField( - controller: phoneController, - keyboardType: TextInputType.phone, - textDirection: TextDirection.ltr, - decoration: InputDecoration( - labelText: 'رقم الهاتف', - prefixIcon: const Icon(Icons.phone), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(12), + body: Center( + child: SingleChildScrollView( + padding: const EdgeInsets.all(24.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const Icon(Icons.security, size: 80, color: Color(0xFF0F4C81)), + const SizedBox(height: 32), + const Text( + 'أهلاً بك في مُصادَق', + style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), + textAlign: TextAlign.center, + ), + const SizedBox(height: 8), + const Text( + 'أدخل رقم هاتفك المسجل في النظام لتسجيل الدخول', + textAlign: TextAlign.center, + style: TextStyle(color: Colors.grey), + ), + const SizedBox(height: 32), + TextField( + controller: phoneController, + keyboardType: TextInputType.phone, + textDirection: TextDirection.ltr, + decoration: InputDecoration( + labelText: 'رقم الهاتف', + prefixIcon: const Icon(Icons.phone), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + ), ), ), - ), - const SizedBox(height: 24), - Obx(() => ElevatedButton( - style: ElevatedButton.styleFrom( - padding: const EdgeInsets.symmetric(vertical: 16), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), + const SizedBox(height: 24), + Obx(() => ElevatedButton( + style: ElevatedButton.styleFrom( + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), ), - ), - onPressed: controller.isLoading.value - ? null - : () => controller.requestOtp(phoneController.text), - child: controller.isLoading.value - ? const CircularProgressIndicator(color: Colors.white) - : const Text('إرسال رمز التحقق', style: TextStyle(fontSize: 16)), - )), - ], + onPressed: controller.isLoading.value + ? null + : () => controller.requestOtp(phoneController.text), + child: controller.isLoading.value + ? const CircularProgressIndicator(color: Colors.white) + : const Text('إرسال رمز التحقق', style: TextStyle(fontSize: 16)), + )), + ], + ), ), ), );