Stracture of the request leave and advance was made

This commit is contained in:
Daniah Ayad Al-sultani
2025-12-06 12:21:48 +03:00
parent 08132b52a9
commit d789bcdc88
5 changed files with 320 additions and 93 deletions

View File

@@ -81,9 +81,7 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
child: SafeArea(
child: Column(
children: [
// =============================
// TOP NAV BAR
// =============================
// In your RequestLeaveScreen's build method, replace the SettingsBar with this:
SettingsBar(
selectedIndex: -1,
onTap: (_) {},
@@ -104,9 +102,10 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Align(
alignment: Alignment.topRight,
child: const Text(
// Fixed alignment for "طلب أجازة"
const Align(
alignment: Alignment.topRight, // Changed to centerRight
child: Text(
"طلب أجازة ",
style: TextStyle(
color: Colors.white,
@@ -134,72 +133,86 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
const SizedBox(height: 6),
// Modified dropdown with disabled state
Directionality(
textDirection:
TextDirection.rtl, // <<< CHANGE DIRECTION HERE
child: Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 20),
height: 58,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
boxShadow: const [
BoxShadow(
color: Color(0x22000000),
blurRadius: 8,
offset: Offset(0, 3),
textDirection: TextDirection.rtl,
child: Opacity(
opacity: isTimedLeave ? 0.45 : 1.0,
child: IgnorePointer(
ignoring: isTimedLeave,
child: Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(
horizontal: 20,
),
],
),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
value: leaveType,
icon: const Icon(
Icons.keyboard_arrow_down_rounded,
color: Colors.black,
size: 28,
height: 58,
decoration: BoxDecoration(
color:
isTimedLeave
? Colors.grey[300]
: Colors.white,
borderRadius: BorderRadius.circular(14),
boxShadow: const [
BoxShadow(
color: Color(0x22000000),
blurRadius: 8,
offset: Offset(0, 3),
),
],
),
style: const TextStyle(
color: Colors.black,
fontSize: 17,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
value: leaveType,
icon: const Icon(
Icons.keyboard_arrow_down_rounded,
color: Colors.black,
size: 28,
),
style: const TextStyle(
color: Colors.black,
fontSize: 17,
),
isExpanded: true,
onChanged:
isTimedLeave
? null
: (value) {
setState(() => leaveType = value!);
},
items: [
DropdownMenuItem(
value: "إجازة مرضية ",
child: Directionality(
textDirection: TextDirection.rtl,
child: Align(
alignment: Alignment.centerRight,
child: Text("إجازة مرضية "),
),
),
),
DropdownMenuItem(
value: "إجازة مدفوعة",
child: Directionality(
textDirection: TextDirection.rtl,
child: Align(
alignment: Alignment.centerRight,
child: Text("إجازة مدفوعة"),
),
),
),
DropdownMenuItem(
value: "إجازة غير مدفوعة",
child: Directionality(
textDirection: TextDirection.rtl,
child: Align(
alignment: Alignment.centerRight,
child: Text("إجازة غير مدفوعة"),
),
),
),
],
),
),
isExpanded: true,
onChanged: (value) {
setState(() => leaveType = value!);
},
items: [
DropdownMenuItem(
value: "إجازة مرضية ",
child: Directionality(
textDirection: TextDirection.rtl,
child: Align(
alignment: Alignment.centerRight,
child: Text("إجازة مرضية "),
),
),
),
DropdownMenuItem(
value: "إجازة مدفوعة",
child: Directionality(
textDirection: TextDirection.rtl,
child: Align(
alignment: Alignment.centerRight,
child: Text("إجازة مدفوعة"),
),
),
),
DropdownMenuItem(
value: "إجازة غير مدفوعة",
child: Directionality(
textDirection: TextDirection.rtl,
child: Align(
alignment: Alignment.centerRight,
child: Text("إجازة غير مدفوعة"),
),
),
),
],
),
),
),
@@ -417,24 +430,35 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
color: const Color(0xFFEAEAEA),
borderRadius: BorderRadius.circular(12),
),
child: TextField(
controller: reasonController,
maxLines: 5,
decoration: const InputDecoration(
border: InputBorder.none,
hintText: "",
// Added Directionality to fix text direction
child: Directionality(
textDirection: TextDirection.rtl,
child: TextField(
controller: reasonController,
maxLines: 5,
textAlign:
TextAlign
.right, // Added this to align text to the right
decoration: const InputDecoration(
border: InputBorder.none,
hintText:
"اكتب السبب", // Added placeholder text
hintStyle: TextStyle(color: Colors.grey),
),
),
),
),
),
const SizedBox(height: 40),
const SizedBox(height: 70),
// CONFIRM BUTTON
Center(
child: OnboardingButton(
child: // In your RequestLeaveScreen's build method
OnboardingButton(
text: "تأكيد الطلب",
backgroundColor: const Color(0xFFD1FEF0),
textColor: Colors.black, // Changed to black
onPressed: () {},
),
),
@@ -535,10 +559,8 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
case 4:
return "الخميس";
case 5:
return "الجمعة";
case 6:
return "السبت";
case 7:
case 6:
return "الأحد";
default:
return "";