general UI chnages has been made
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'package:coda_project/screens/notifications_screen.dart';
|
||||
import 'package:coda_project/screens/user_settings_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import '../widgets/login_animation.dart';
|
||||
@@ -29,8 +31,21 @@ class AttendanceScreen extends StatelessWidget {
|
||||
'assets/images/ball.svg',
|
||||
],
|
||||
onTap: (index) {
|
||||
// Keep static, no animations
|
||||
// You can navigate or add your logic later
|
||||
if (index == 0) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => UserSettingsScreen(),
|
||||
),
|
||||
);
|
||||
} else if (index == 1) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => NotificationsScreen(),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -143,7 +158,7 @@ class AttendanceScreen extends StatelessWidget {
|
||||
/// LOGOUT BUTTON
|
||||
/// ------------------------------
|
||||
Positioned(
|
||||
bottom: screenHeight * 0.16,
|
||||
bottom: screenHeight * 0.2,
|
||||
right: screenWidth * 0.1,
|
||||
child: _ShadowedCard(
|
||||
shadow: [
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:coda_project/screens/notifications_screen.dart';
|
||||
import 'package:coda_project/screens/user_settings_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../widgets/finance_summary_card.dart';
|
||||
import '../widgets/work_day_card.dart';
|
||||
@@ -47,7 +49,21 @@ class _FinanceScreenState extends State<FinanceScreen> {
|
||||
'assets/images/ball.svg',
|
||||
],
|
||||
onTap: (index) {
|
||||
// Your logic here
|
||||
if (index == 0) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => UserSettingsScreen(),
|
||||
),
|
||||
);
|
||||
} else if (index == 1) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => NotificationsScreen(),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:coda_project/screens/notifications_screen.dart';
|
||||
import 'package:coda_project/screens/user_settings_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -74,9 +76,7 @@ class _HolidayScreenState extends State<HolidayScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: Stack(
|
||||
return Stack(
|
||||
children: [
|
||||
// ---------------------------------------------------------
|
||||
// ⭐ MAIN CONTENT - CUSTOM SCROLL VIEW
|
||||
@@ -90,6 +90,9 @@ class _HolidayScreenState extends State<HolidayScreen> {
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
// First, make sure you have your screens defined
|
||||
|
||||
// Then in your main widget:
|
||||
child: SettingsBar(
|
||||
selectedIndex: 0,
|
||||
showBackButton: false,
|
||||
@@ -98,7 +101,21 @@ class _HolidayScreenState extends State<HolidayScreen> {
|
||||
'assets/images/ball.svg',
|
||||
],
|
||||
onTap: (index) {
|
||||
// do your navigation logic
|
||||
if (index == 0) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => UserSettingsScreen(),
|
||||
),
|
||||
);
|
||||
} else if (index == 1) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => NotificationsScreen(),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -123,7 +140,8 @@ class _HolidayScreenState extends State<HolidayScreen> {
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: activeTab == 1
|
||||
color:
|
||||
activeTab == 1
|
||||
? const Color(0xFF8EFDC2)
|
||||
: const Color(0x9EFFFFFF),
|
||||
),
|
||||
@@ -151,7 +169,8 @@ class _HolidayScreenState extends State<HolidayScreen> {
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: activeTab == 0
|
||||
color:
|
||||
activeTab == 0
|
||||
? const Color(0xFF8EFDC2)
|
||||
: const Color(0x9EFFFFFF),
|
||||
),
|
||||
@@ -187,7 +206,7 @@ class _HolidayScreenState extends State<HolidayScreen> {
|
||||
// ⭐ FLOATING ACTION BUTTONS
|
||||
// ---------------------------------------------------------
|
||||
Positioned(
|
||||
bottom: 60,
|
||||
bottom: 150,
|
||||
right: 20,
|
||||
child: AnimatedSlide(
|
||||
offset: _showActions ? Offset.zero : const Offset(0, 1.3),
|
||||
@@ -232,7 +251,6 @@ class _HolidayScreenState extends State<HolidayScreen> {
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -258,15 +276,12 @@ class _HolidayScreenState extends State<HolidayScreen> {
|
||||
return SliverPadding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||
sliver: SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
delegate: SliverChildBuilderDelegate((context, index) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: _buildLeaveRequestCard(_leaveRequests[index]),
|
||||
);
|
||||
},
|
||||
childCount: _leaveRequests.length,
|
||||
),
|
||||
}, childCount: _leaveRequests.length),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -289,15 +304,12 @@ class _HolidayScreenState extends State<HolidayScreen> {
|
||||
return SliverPadding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||
sliver: SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
delegate: SliverChildBuilderDelegate((context, index) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: _buildAdvanceRequestCard(_advanceRequests[index]),
|
||||
);
|
||||
},
|
||||
childCount: _advanceRequests.length,
|
||||
),
|
||||
}, childCount: _advanceRequests.length),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -333,17 +345,29 @@ class _HolidayScreenState extends State<HolidayScreen> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
_statusCircle(isWaiting, "قيد الانتظار",
|
||||
_statusCircle(
|
||||
isWaiting,
|
||||
"قيد الانتظار",
|
||||
isWaiting ? "assets/images/waiting.svg" : null,
|
||||
const Color(0xFFA58A1B), const Color(0xFFFFDC69)),
|
||||
const Color(0xFFA58A1B),
|
||||
const Color(0xFFFFDC69),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
_statusCircle(isApproved, "موافقة",
|
||||
_statusCircle(
|
||||
isApproved,
|
||||
"موافقة",
|
||||
isApproved ? "assets/images/yes.svg" : null,
|
||||
const Color(0xFF0A8A60), const Color(0xFF00D7A3)),
|
||||
const Color(0xFF0A8A60),
|
||||
const Color(0xFF00D7A3),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
_statusCircle(isDenied, "تم الرفض",
|
||||
_statusCircle(
|
||||
isDenied,
|
||||
"تم الرفض",
|
||||
isDenied ? "assets/images/no.svg" : null,
|
||||
const Color(0xFFE63946), const Color(0xFFE63946)),
|
||||
const Color(0xFFE63946),
|
||||
const Color(0xFFE63946),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -381,28 +405,32 @@ class _HolidayScreenState extends State<HolidayScreen> {
|
||||
|
||||
// REASON ROW
|
||||
Row(
|
||||
textDirection: TextDirection.ltr, // Add this
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
request.reason,
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
child: Text(request.reason, textAlign: TextAlign.right),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
const Text(
|
||||
"السبب:",
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _statusCircle(bool active, String label, String? svg,
|
||||
Color color, Color glow) {
|
||||
Widget _statusCircle(
|
||||
bool active,
|
||||
String label,
|
||||
String? svg,
|
||||
Color color,
|
||||
Color glow,
|
||||
) {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
@@ -411,14 +439,14 @@ class _HolidayScreenState extends State<HolidayScreen> {
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: active ? color : const Color(0xFFD6D6D6),
|
||||
boxShadow: active
|
||||
boxShadow:
|
||||
active
|
||||
? [BoxShadow(color: glow.withOpacity(0.6), blurRadius: 12)]
|
||||
: [],
|
||||
),
|
||||
child: svg != null
|
||||
? Center(
|
||||
child: SvgPicture.asset(svg, width: 18, height: 18),
|
||||
)
|
||||
child:
|
||||
svg != null
|
||||
? Center(child: SvgPicture.asset(svg, width: 18, height: 18))
|
||||
: null,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
|
||||
@@ -123,10 +123,7 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
|
||||
} catch (e) {
|
||||
// Show an error message if something went wrong
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('حدث خطأ: $e'),
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
SnackBar(content: Text('حدث خطأ: $e'), backgroundColor: Colors.red),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -151,10 +148,9 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
|
||||
),
|
||||
|
||||
// Title
|
||||
const SizedBox(height: 30),
|
||||
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
// const SizedBox(height: 30),
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -172,7 +168,7 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 25),
|
||||
const SizedBox(height: 10),
|
||||
//=============================
|
||||
// DROPDOWN: نوع الإجازة
|
||||
//=============================
|
||||
@@ -188,7 +184,7 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 6),
|
||||
const SizedBox(height: 5),
|
||||
|
||||
// Modified dropdown with disabled state
|
||||
Directionality(
|
||||
@@ -306,8 +302,8 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
|
||||
// ---------- TOGGLE ----------
|
||||
AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 250),
|
||||
width: 95,
|
||||
height: 42,
|
||||
width: 75,
|
||||
height: 30,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 4,
|
||||
),
|
||||
@@ -329,8 +325,8 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
|
||||
: Alignment.centerLeft,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 250),
|
||||
width: 40,
|
||||
height: 40,
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
isTimedLeave
|
||||
@@ -461,7 +457,7 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 25),
|
||||
const SizedBox(height: 10),
|
||||
|
||||
// =============================
|
||||
// REASON TEXTFIELD (Two Containers)
|
||||
@@ -484,7 +480,7 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
|
||||
// OUTER BORDER CONTAINER
|
||||
Container(
|
||||
padding: const EdgeInsets.all(
|
||||
15,
|
||||
12,
|
||||
), // border thickness space
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
@@ -496,7 +492,7 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
|
||||
|
||||
// INNER TEXTFIELD CONTAINER
|
||||
child: Container(
|
||||
height: 100,
|
||||
height: 70,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 14,
|
||||
vertical: 10,
|
||||
@@ -525,7 +521,7 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 70),
|
||||
const SizedBox(height: 20),
|
||||
|
||||
// CONFIRM BUTTON
|
||||
Center(
|
||||
@@ -536,8 +532,6 @@ class _RequestLeaveScreenState extends State<RequestLeaveScreen> {
|
||||
onPressed: _saveLeaveRequest, // Call the save method
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 40),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -143,8 +143,8 @@ class _UserSettingsScreenState extends State<UserSettingsScreen> {
|
||||
duration: const Duration(
|
||||
milliseconds: 250,
|
||||
),
|
||||
width: 95,
|
||||
height: 42,
|
||||
width: 75,
|
||||
height: 30,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 4,
|
||||
),
|
||||
@@ -166,8 +166,8 @@ class _UserSettingsScreenState extends State<UserSettingsScreen> {
|
||||
duration: const Duration(
|
||||
milliseconds: 250,
|
||||
),
|
||||
width: 40,
|
||||
height: 40,
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
_notificationsOn
|
||||
|
||||
Reference in New Issue
Block a user