إصلاح أخطاء شاشة الكباتن من تحديث الذكاء الاصطناعي

This commit is contained in:
Hamza-Ayed
2026-07-26 13:44:07 +03:00
parent 330dfc6dba
commit e269cb9b70
21 changed files with 72156 additions and 71654 deletions
@@ -14,111 +14,133 @@ class AddStaffPage extends StatelessWidget {
return Scaffold(
backgroundColor: cs.surface,
appBar: AppBar(
title: Text(role == 'admin' ? "إضافة مدير جديد" : "إضافة موظف خدمة عملاء"),
backgroundColor: cs.surface,
elevation: 0,
),
body: SingleChildScrollView(
padding: const EdgeInsets.all(24),
child: Form(
key: controller.formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildSectionTitle("المعلومات الأساسية", cs),
const SizedBox(height: 16),
_buildTextField(
controller: controller.nameController,
label: "الاسم الكامل",
icon: Icons.person_outline,
cs: cs,
),
const SizedBox(height: 16),
_buildTextField(
controller: controller.phoneController,
label: "رقم الهاتف",
icon: Icons.phone_android_outlined,
cs: cs,
keyboardType: TextInputType.phone,
),
const SizedBox(height: 16),
_buildTextField(
controller: controller.emailController,
label: "البريد الإلكتروني",
icon: Icons.email_outlined,
cs: cs,
keyboardType: TextInputType.emailAddress,
),
const SizedBox(height: 16),
_buildTextField(
controller: controller.passwordController,
label: "كلمة المرور",
icon: Icons.lock_outline,
cs: cs,
obscureText: true,
),
const SizedBox(height: 24),
_buildSectionTitle("معلومات إضافية", cs),
const SizedBox(height: 16),
Row(
children: [
Expanded(
child: _buildDropdown(
label: "الجنس",
value: controller.selectedGender,
items: ['Male', 'Female'],
onChanged: (val) => controller.selectedGender = val!,
cs: cs,
body: Column(
children: [
Container(
padding: const EdgeInsets.fromLTRB(16, 50, 16, 16),
child: Row(
children: [
GestureDetector(
onTap: () => Get.back(),
child: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: cs.surfaceContainerHighest,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: cs.outline),
),
),
const SizedBox(width: 16),
Expanded(
child: _buildTextField(
controller: controller.birthdateController,
label: "تاريخ الميلاد",
icon: Icons.calendar_today_outlined,
cs: cs,
hint: "YYYY-MM-DD",
),
),
],
),
const SizedBox(height: 16),
_buildDropdown(
label: "البلد",
value: controller.selectedCountry,
items: const ['Jordan', 'Syria', 'Egypt'],
onChanged: (val) => controller.selectedCountry = val!,
cs: cs,
),
const SizedBox(height: 40),
GetBuilder<StaffController>(
builder: (controller) => SizedBox(
width: double.infinity,
height: 56,
child: ElevatedButton(
onPressed: controller.isLoading ? null : () => controller.registerStaff(),
style: ElevatedButton.styleFrom(
backgroundColor: cs.primary,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
),
child: controller.isLoading
? CircularProgressIndicator(color: cs.onPrimary)
: Text(
"حفظ البيانات",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: cs.onPrimary,
),
),
child: Icon(Icons.arrow_back_ios_new_rounded, color: cs.onSurfaceVariant, size: 16),
),
),
),
],
const SizedBox(width: 12),
Text(role == 'admin' ? "إضافة مدير جديد" : "إضافة موظف خدمة عملاء", style: TextStyle(color: cs.onSurface, fontSize: 18, fontWeight: FontWeight.w700)),
],
),
),
),
Expanded(
child: SingleChildScrollView(
padding: const EdgeInsets.all(24),
child: Form(
key: controller.formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildSectionTitle("المعلومات الأساسية", cs),
const SizedBox(height: 16),
_buildTextField(
controller: controller.nameController,
label: "الاسم الكامل",
icon: Icons.person_outline,
cs: cs,
),
const SizedBox(height: 16),
_buildTextField(
controller: controller.phoneController,
label: "رقم الهاتف",
icon: Icons.phone_android_outlined,
cs: cs,
keyboardType: TextInputType.phone,
),
const SizedBox(height: 16),
_buildTextField(
controller: controller.emailController,
label: "البريد الإلكتروني",
icon: Icons.email_outlined,
cs: cs,
keyboardType: TextInputType.emailAddress,
),
const SizedBox(height: 16),
_buildTextField(
controller: controller.passwordController,
label: "كلمة المرور",
icon: Icons.lock_outline,
cs: cs,
obscureText: true,
),
const SizedBox(height: 24),
_buildSectionTitle("معلومات إضافية", cs),
const SizedBox(height: 16),
Row(
children: [
Expanded(
child: _buildDropdown(
label: "الجنس",
value: controller.selectedGender,
items: ['Male', 'Female'],
onChanged: (val) => controller.selectedGender = val!,
cs: cs,
),
),
const SizedBox(width: 16),
Expanded(
child: _buildTextField(
controller: controller.birthdateController,
label: "تاريخ الميلاد",
icon: Icons.calendar_today_outlined,
cs: cs,
hint: "YYYY-MM-DD",
),
),
],
),
const SizedBox(height: 16),
_buildDropdown(
label: "البلد",
value: controller.selectedCountry,
items: const ['Jordan', 'Syria', 'Egypt'],
onChanged: (val) => controller.selectedCountry = val!,
cs: cs,
),
const SizedBox(height: 40),
GetBuilder<StaffController>(
builder: (controller) => SizedBox(
width: double.infinity,
height: 56,
child: ElevatedButton(
onPressed: controller.isLoading ? null : () => controller.registerStaff(),
style: ElevatedButton.styleFrom(
backgroundColor: cs.primary,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
),
child: controller.isLoading
? CircularProgressIndicator(color: cs.onPrimary)
: Text(
"حفظ البيانات",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: cs.onPrimary,
),
),
),
),
),
],
),
),
),
),
],
),
);
}
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../constant/links.dart';
import '../../../controller/functions/crud.dart';
import '../../widgets/snackbar.dart';
@@ -63,16 +64,38 @@ class _PendingAdminsPageState extends State<PendingAdminsPage> {
return Scaffold(
backgroundColor: cs.surface,
appBar: AppBar(
title: const Text('طلبات الانضمام المعلقة', style: TextStyle(fontWeight: FontWeight.bold)),
backgroundColor: cs.surfaceContainerHighest,
elevation: 0,
body: Column(
children: [
Container(
padding: const EdgeInsets.fromLTRB(16, 50, 16, 16),
child: Row(
children: [
GestureDetector(
onTap: () => Get.back(),
child: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: cs.surfaceContainerHighest,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: cs.outline),
),
child: Icon(Icons.arrow_back_ios_new_rounded, color: cs.onSurfaceVariant, size: 16),
),
),
const SizedBox(width: 12),
Text('طلبات الانضمام المعلقة', style: TextStyle(color: cs.onSurface, fontSize: 18, fontWeight: FontWeight.w700)),
],
),
),
Expanded(
child: _isLoading
? Center(child: CircularProgressIndicator(color: cs.primary))
: _pendingAdmins.isEmpty
? _buildEmptyState(cs)
: _buildList(cs),
),
],
),
body: _isLoading
? Center(child: CircularProgressIndicator(color: cs.primary))
: _pendingAdmins.isEmpty
? _buildEmptyState(cs)
: _buildList(cs),
);
}