Update: 2026-05-06 03:09:37

This commit is contained in:
Hamza-Ayed
2026-05-06 03:09:37 +03:00
parent d9d2edac47
commit 13c2f75432
2 changed files with 50 additions and 46 deletions

View File

@@ -39,7 +39,9 @@ class WhatsAppProxyService
$payload = [ $payload = [
"to" => $to, "to" => $to,
"message" => $message "message" => [
"text" => $message
]
]; ];
$curl = curl_init(); $curl = curl_init();

View File

@@ -12,54 +12,56 @@ class PhoneInputView extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text('تسجيل الدخول')), appBar: AppBar(title: const Text('تسجيل الدخول')),
body: Padding( body: Center(
padding: const EdgeInsets.all(24.0), child: SingleChildScrollView(
child: Column( padding: const EdgeInsets.all(24.0),
mainAxisAlignment: MainAxisAlignment.center, child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.center,
children: [ crossAxisAlignment: CrossAxisAlignment.stretch,
const Icon(Icons.security, size: 80, color: Color(0xFF0F4C81)), children: [
const SizedBox(height: 32), const Icon(Icons.security, size: 80, color: Color(0xFF0F4C81)),
const Text( const SizedBox(height: 32),
'أهلاً بك في مُصادَق', const Text(
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), 'أهلاً بك في مُصادَق',
textAlign: TextAlign.center, style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
), textAlign: TextAlign.center,
const SizedBox(height: 8), ),
const Text( const SizedBox(height: 8),
'أدخل رقم هاتفك المسجل في النظام لتسجيل الدخول', const Text(
textAlign: TextAlign.center, 'أدخل رقم هاتفك المسجل في النظام لتسجيل الدخول',
style: TextStyle(color: Colors.grey), textAlign: TextAlign.center,
), style: TextStyle(color: Colors.grey),
const SizedBox(height: 32), ),
TextField( const SizedBox(height: 32),
controller: phoneController, TextField(
keyboardType: TextInputType.phone, controller: phoneController,
textDirection: TextDirection.ltr, keyboardType: TextInputType.phone,
decoration: InputDecoration( textDirection: TextDirection.ltr,
labelText: 'رقم الهاتف', decoration: InputDecoration(
prefixIcon: const Icon(Icons.phone), labelText: 'رقم الهاتف',
border: OutlineInputBorder( prefixIcon: const Icon(Icons.phone),
borderRadius: BorderRadius.circular(12), border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
),
), ),
), ),
), const SizedBox(height: 24),
const SizedBox(height: 24), Obx(() => ElevatedButton(
Obx(() => ElevatedButton( style: ElevatedButton.styleFrom(
style: ElevatedButton.styleFrom( padding: const EdgeInsets.symmetric(vertical: 16),
padding: const EdgeInsets.symmetric(vertical: 16), shape: RoundedRectangleBorder(
shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12),
borderRadius: BorderRadius.circular(12), ),
), ),
), onPressed: controller.isLoading.value
onPressed: controller.isLoading.value ? null
? null : () => controller.requestOtp(phoneController.text),
: () => controller.requestOtp(phoneController.text), child: controller.isLoading.value
child: controller.isLoading.value ? const CircularProgressIndicator(color: Colors.white)
? const CircularProgressIndicator(color: Colors.white) : const Text('إرسال رمز التحقق', style: TextStyle(fontSize: 16)),
: const Text('إرسال رمز التحقق', style: TextStyle(fontSize: 16)), )),
)), ],
], ),
), ),
), ),
); );