Update: 2026-06-12 20:40:40
This commit is contained in:
@@ -41,6 +41,7 @@ class _AdminLoginPageState extends State<AdminLoginPage>
|
||||
|
||||
Future<void> _submit() async {
|
||||
final password = _passwordController.text.trim();
|
||||
final phone = _phoneController.text.trim();
|
||||
|
||||
if (password.isEmpty) {
|
||||
Get.snackbar('خطأ', 'يرجى إدخال كلمة المرور');
|
||||
@@ -50,7 +51,7 @@ class _AdminLoginPageState extends State<AdminLoginPage>
|
||||
setState(() => _isLoading = true);
|
||||
|
||||
final otpHelper = Get.find<OtpHelper>();
|
||||
bool success = await otpHelper.loginWithPassword(password);
|
||||
bool success = await otpHelper.loginWithPassword(password, phone);
|
||||
|
||||
if (success) {
|
||||
Get.offAll(() => const AdminHomePage());
|
||||
@@ -194,6 +195,55 @@ class _AdminLoginPageState extends State<AdminLoginPage>
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// ── Field label (Phone) ─────────────────────────────
|
||||
const Row(
|
||||
children: [
|
||||
Icon(Icons.phone_android_rounded,
|
||||
color: _C.accent, size: 16),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'رقم الهاتف (لأول دخول فقط)',
|
||||
style: TextStyle(
|
||||
color: _C.textSec,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.3,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
// ── Phone field ─────────────────────────────
|
||||
TextFormField(
|
||||
controller: _phoneController,
|
||||
keyboardType: TextInputType.phone,
|
||||
style: const TextStyle(
|
||||
color: _C.textPrimary,
|
||||
fontSize: 16,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: '07XXXXXXXX',
|
||||
hintStyle: const TextStyle(color: _C.textSec),
|
||||
filled: true,
|
||||
fillColor: _C.inputBg,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: const BorderSide(
|
||||
color: _C.border, width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: const BorderSide(
|
||||
color: _C.accent, width: 1.5),
|
||||
),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 16, vertical: 16),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
// ── Field label (Password) ─────────────────────────────
|
||||
const Row(
|
||||
@@ -319,7 +369,32 @@ class _AdminLoginPageState extends State<AdminLoginPage>
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
const SizedBox(height: 30),
|
||||
|
||||
// ── Register Link ───────────────────────────────────────────
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
'ليس لديك حساب مشرف؟',
|
||||
style: TextStyle(color: _C.textSec, fontSize: 14),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.toNamed('/register'); // أو الانتقال المباشر للصفحة
|
||||
},
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: _C.accent,
|
||||
textStyle: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
child: const Text('تسجيل حساب جديد'),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user