From 5c48fc280c77ceb150795da7087d54ec4634a43d Mon Sep 17 00:00:00 2001 From: Daniah Ayad Al-sultani <148902945+Cactuskiller@users.noreply.github.com> Date: Tue, 2 Dec 2025 13:11:11 +0300 Subject: [PATCH] attendence screen is fixed --- assets/images/login.svg | 4 + assets/images/logout.svg | 4 + lib/screens/attendence_screen.dart | 211 +++++++++++++++++++++++++++-- lib/widgets/FloatingNavBar.dart | 10 +- 4 files changed, 211 insertions(+), 18 deletions(-) create mode 100644 assets/images/login.svg create mode 100644 assets/images/logout.svg diff --git a/assets/images/login.svg b/assets/images/login.svg new file mode 100644 index 0000000..95a8c87 --- /dev/null +++ b/assets/images/login.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/logout.svg b/assets/images/logout.svg new file mode 100644 index 0000000..76fc47e --- /dev/null +++ b/assets/images/logout.svg @@ -0,0 +1,4 @@ + + + + diff --git a/lib/screens/attendence_screen.dart b/lib/screens/attendence_screen.dart index 2376fc0..d1fc582 100644 --- a/lib/screens/attendence_screen.dart +++ b/lib/screens/attendence_screen.dart @@ -1,24 +1,209 @@ -// lib/screens/attendance_screen.dart import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; class AttendanceScreen extends StatelessWidget { const AttendanceScreen({super.key}); @override Widget build(BuildContext context) { - return Container( - // This is where your attendance content will go - // For now, it's just a placeholder - child: const Center( - child: Text( - 'Attendance Content', - style: TextStyle( - color: Colors.white, - fontSize: 24, - fontWeight: FontWeight.bold, + return Directionality( + textDirection: TextDirection.rtl, + child: Stack( + children: [ + /// GREETING TEXT + Positioned( + top: 10, + left: 0, + right: 0, + child: Center( + child: Text( + "صباح الخير, محمد", + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.w600, + color: Colors.white, + shadows: [ + Shadow( + color: const Color(0x42000000), + blurRadius: 6, + ), + ], + ), + ), + ), ), - ), + Positioned( + top: 100, + left: 0, + right: 0, + child: Center( + child: Stack( + children: [ + /// BACK SHADOW LAYER + Container( + height: 420, + width: 260, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(32), + boxShadow: [ + // TOP-RIGHT BLACK FADE + const BoxShadow( + color: Color(0x1F2B2B2B), + blurRadius: 5, + spreadRadius: 0, + offset: Offset(10, -10), + ), + + // BOTTOM-LEFT GREEN GLOW + const BoxShadow( + color: Color.fromARGB(171, 206, 206, 206), + blurRadius: 5, + spreadRadius: 2, + offset: Offset(-2, 5), + ), + + // LIGHT GLOBAL GLOW + BoxShadow( + color: const Color(0x5532C59A), + blurRadius: 80, + offset: const Offset(0, 10), + ), + ], + ), + ), + + /// FRONT MAIN RECTANGLE + Container( + height: 420, + width: 260, + decoration: BoxDecoration( + color: const Color(0x92757575), + borderRadius: BorderRadius.circular(32), + ), + ), + ], + ), + ), + ), + + /// ===== LOGIN BUTTON (TOP-LEFT) ===== + Positioned( + top: 70, + left: 24, + child: _ShadowedCard( + child: _FingerButton( + icon: "assets/images/login.svg", + label: "تسجيل الدخول", + ), + shadow: const [ + // Strong BLACK shadow bottom-right + BoxShadow( + color: Color(0x99000000), + blurRadius: 10, + spreadRadius: 5, + offset: Offset(5, 5), + ), + ], + ), + ), + + /// ===== LOGOUT BUTTON (BOTTOM-RIGHT) ===== + Positioned( + bottom: 10, + right: 24, + child: _ShadowedCard( + child: _FingerButton( + icon: "assets/images/logout.svg", + label: "تسجيل خروج", + ), + shadow: const [ + // GREEN glow top-left + BoxShadow( + color: Color(0x5FEEFFFA), + blurRadius: 5, + spreadRadius: 1, + offset: Offset(-5, -5), + ), + + // Soft dark bottom shadow + BoxShadow( + color: Color(0x44000000), + blurRadius: 25, + offset: Offset(0, 14), + ), + ], + ), + ), + ], ), ); } -} \ No newline at end of file +} + +/// Wrapper that applies custom layered shadows BEHIND each card +class _ShadowedCard extends StatelessWidget { + final Widget child; + final List shadow; + + const _ShadowedCard({ + required this.child, + required this.shadow, + }); + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + /// BACK SHADOW LAYER + Container( + height: 160, + width: 160, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(32), + boxShadow: shadow, + ), + ), + + /// FRONT CARD + child, + ], + ); + } +} + +class _FingerButton extends StatelessWidget { + final String icon; + final String label; + + const _FingerButton({ + required this.icon, + required this.label, + }); + + @override + Widget build(BuildContext context) { + return Container( + height: 160, + width: 160, + decoration: BoxDecoration( + color: const Color(0xFFEAFBF3), + borderRadius: BorderRadius.circular(32), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgPicture.asset(icon, width: 62, height: 62), + const SizedBox(height: 10), + Text( + label, + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + color: Colors.black, + ), + ), + ], + ), + ); + } +} diff --git a/lib/widgets/FloatingNavBar.dart b/lib/widgets/FloatingNavBar.dart index 77c2713..73b1cdd 100644 --- a/lib/widgets/FloatingNavBar.dart +++ b/lib/widgets/FloatingNavBar.dart @@ -26,11 +26,11 @@ class Floatingnavbar extends StatelessWidget { final bottomPadding = MediaQuery.of(context).padding.bottom; return Container( - height: 85, + height: 70, margin: EdgeInsets.only( bottom: 10 + bottomPadding, // Add system padding to our margin - left: 25, - right: 25, + left: 28, + right: 28, ), decoration: BoxDecoration( color: (const Color(0xFFE9E9E9)), @@ -80,8 +80,8 @@ class _NavBarItemTile extends StatelessWidget { children: [ SvgPicture.asset( item.iconPath, - width: 37, - height: 37, + width: 30, + height: 30, colorFilter: ColorFilter.mode( isSelected ? const Color(0xFF177046) : Colors.black, BlendMode.srcIn,