Update: 2026-05-06 02:59:42
This commit is contained in:
67
musadaq-app/lib/features/auth/views/otp_verify_view.dart
Normal file
67
musadaq-app/lib/features/auth/views/otp_verify_view.dart
Normal file
@@ -0,0 +1,67 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../controllers/auth_controller.dart';
|
||||
|
||||
class OtpVerifyView extends StatelessWidget {
|
||||
OtpVerifyView({super.key});
|
||||
|
||||
final AuthController controller = Get.find<AuthController>();
|
||||
final TextEditingController otpController = TextEditingController();
|
||||
|
||||
@override
|
||||
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 Text(
|
||||
'تم إرسال رمز التحقق إلى رقمك',
|
||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Obx(() => Text(
|
||||
controller.phone.value,
|
||||
textDirection: TextDirection.ltr,
|
||||
style: const TextStyle(fontSize: 18, color: Colors.grey),
|
||||
textAlign: TextAlign.center,
|
||||
)),
|
||||
const SizedBox(height: 32),
|
||||
TextField(
|
||||
controller: otpController,
|
||||
keyboardType: TextInputType.number,
|
||||
textAlign: TextAlign.center,
|
||||
maxLength: 6,
|
||||
style: const TextStyle(fontSize: 24, letterSpacing: 8),
|
||||
decoration: InputDecoration(
|
||||
counterText: '',
|
||||
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),
|
||||
),
|
||||
),
|
||||
onPressed: controller.isLoading.value
|
||||
? null
|
||||
: () => controller.verifyOtp(otpController.text),
|
||||
child: controller.isLoading.value
|
||||
? const CircularProgressIndicator(color: Colors.white)
|
||||
: const Text('تحقق', style: TextStyle(fontSize: 16)),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
67
musadaq-app/lib/features/auth/views/phone_input_view.dart
Normal file
67
musadaq-app/lib/features/auth/views/phone_input_view.dart
Normal file
@@ -0,0 +1,67 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../controllers/auth_controller.dart';
|
||||
|
||||
class PhoneInputView extends StatelessWidget {
|
||||
PhoneInputView({super.key});
|
||||
|
||||
final AuthController controller = Get.put(AuthController());
|
||||
final TextEditingController phoneController = TextEditingController();
|
||||
|
||||
@override
|
||||
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),
|
||||
),
|
||||
),
|
||||
),
|
||||
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)),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user