last changes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import '../widgets/login_animation.dart';
|
||||
import '../widgets/login_animation.dart';
|
||||
import '../widgets/settings_bar.dart';
|
||||
|
||||
class AttendanceScreen extends StatelessWidget {
|
||||
const AttendanceScreen({super.key});
|
||||
@@ -11,9 +12,33 @@ class AttendanceScreen extends StatelessWidget {
|
||||
textDirection: TextDirection.rtl,
|
||||
child: Stack(
|
||||
children: [
|
||||
|
||||
/// ------------------------------
|
||||
/// SETTINGS BAR (STATIC)
|
||||
/// ------------------------------
|
||||
SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: SettingsBar(
|
||||
selectedIndex: 0,
|
||||
showBackButton: false,
|
||||
iconPaths: [
|
||||
'assets/images/user.svg',
|
||||
'assets/images/ball.svg',
|
||||
],
|
||||
onTap: (index) {
|
||||
// Keep static, no animations
|
||||
// You can navigate or add your logic later
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/// ------------------------------
|
||||
/// GREETING TEXT
|
||||
/// ------------------------------
|
||||
Positioned(
|
||||
top: 10,
|
||||
top: 70, // moved down because settings bar now exists
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Center(
|
||||
@@ -24,58 +49,52 @@ class AttendanceScreen extends StatelessWidget {
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white,
|
||||
shadows: [
|
||||
Shadow(color: const Color(0x42000000), blurRadius: 6),
|
||||
Shadow(color: Color(0x42000000), blurRadius: 6),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/// ------------------------------
|
||||
/// MAIN CARD AREA
|
||||
/// ------------------------------
|
||||
Positioned(
|
||||
top: 100,
|
||||
top: 160, // pushed down because of settings bar + greeting
|
||||
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(
|
||||
BoxShadow(
|
||||
color: Color(0x1F2B2B2B),
|
||||
blurRadius: 5,
|
||||
spreadRadius: 0,
|
||||
offset: Offset(10, -10),
|
||||
),
|
||||
|
||||
// BOTTOM-LEFT GREEN GLOW
|
||||
const BoxShadow(
|
||||
BoxShadow(
|
||||
color: Color(0xABCECECE),
|
||||
blurRadius: 5,
|
||||
spreadRadius: 2,
|
||||
offset: Offset(-2, 5),
|
||||
),
|
||||
|
||||
// LIGHT GLOBAL GLOW
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(148, 2, 70, 35),
|
||||
blurRadius: 80,
|
||||
offset: const Offset(0, 10),
|
||||
offset: Offset(0, 10),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
/// FRONT MAIN RECTANGLE
|
||||
Container(
|
||||
height: 420,
|
||||
width: 260,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0x92757575),
|
||||
color: Color(0x92757575),
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
),
|
||||
),
|
||||
@@ -84,13 +103,14 @@ class AttendanceScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
|
||||
/// ===== LOGIN BUTTON (TOP-LEFT) =====
|
||||
/// ------------------------------
|
||||
/// LOGIN BUTTON
|
||||
/// ------------------------------
|
||||
Positioned(
|
||||
top: 70,
|
||||
top: 130,
|
||||
left: 24,
|
||||
child: _ShadowedCard(
|
||||
shadow: const [
|
||||
// Strong BLACK shadow bottom-right
|
||||
shadow: [
|
||||
BoxShadow(
|
||||
color: Color(0x62000000),
|
||||
blurRadius: 10,
|
||||
@@ -102,14 +122,12 @@ class AttendanceScreen extends StatelessWidget {
|
||||
icon: "assets/images/login.svg",
|
||||
label: "تسجيل الدخول",
|
||||
onTap: () {
|
||||
// Navigate to LoginAnimationScreen with error state
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder:
|
||||
(context) => LoginAnimationScreen(
|
||||
isLogin: true,
|
||||
isSuccess: false,
|
||||
),
|
||||
builder: (_) => LoginAnimationScreen(
|
||||
isLogin: true,
|
||||
isSuccess: false,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -117,21 +135,20 @@ class AttendanceScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
|
||||
/// ===== LOGOUT BUTTON (BOTTOM-RIGHT) =====
|
||||
/// ------------------------------
|
||||
/// LOGOUT BUTTON
|
||||
/// ------------------------------
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
bottom: 60,
|
||||
right: 24,
|
||||
child: _ShadowedCard(
|
||||
shadow: const [
|
||||
// Strong BLACK shadow bottom-right
|
||||
shadow: [
|
||||
BoxShadow(
|
||||
color: Color(0xABCECECE),
|
||||
blurRadius: 5,
|
||||
spreadRadius: 3,
|
||||
offset: Offset(-6, -6),
|
||||
),
|
||||
|
||||
// LIGHT GLOBAL GLOW
|
||||
BoxShadow(
|
||||
color: Color(0x92014221),
|
||||
blurRadius: 10,
|
||||
@@ -148,14 +165,12 @@ class AttendanceScreen extends StatelessWidget {
|
||||
icon: "assets/images/logout.svg",
|
||||
label: "تسجيل خروج",
|
||||
onTap: () {
|
||||
// Navigate to LoginAnimationScreen with error state
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder:
|
||||
(context) => LoginAnimationScreen(
|
||||
isLogin: false,
|
||||
isSuccess: true,
|
||||
),
|
||||
builder: (_) => LoginAnimationScreen(
|
||||
isLogin: false,
|
||||
isSuccess: true,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -168,7 +183,10 @@ class AttendanceScreen extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// Wrapper that applies custom layered shadows BEHIND each card
|
||||
/// ---------------------------------------------
|
||||
/// SHADOW WRAPPER
|
||||
/// ---------------------------------------------
|
||||
|
||||
class _ShadowedCard extends StatelessWidget {
|
||||
final Widget child;
|
||||
final List<BoxShadow> shadow;
|
||||
@@ -179,7 +197,6 @@ class _ShadowedCard extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
/// BACK SHADOW LAYER
|
||||
Container(
|
||||
height: 160,
|
||||
width: 160,
|
||||
@@ -188,44 +205,46 @@ class _ShadowedCard extends StatelessWidget {
|
||||
boxShadow: shadow,
|
||||
),
|
||||
),
|
||||
|
||||
/// FRONT CARD
|
||||
child,
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// ---------------------------------------------
|
||||
/// BUTTON WIDGET
|
||||
/// ---------------------------------------------
|
||||
|
||||
class _FingerButton extends StatelessWidget {
|
||||
final String icon;
|
||||
final String label;
|
||||
final VoidCallback onTap; // Added onTap callback
|
||||
final VoidCallback onTap;
|
||||
|
||||
const _FingerButton({
|
||||
required this.icon,
|
||||
required this.label,
|
||||
required this.onTap, // Added this parameter
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap, // Added gesture detection
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
height: 160,
|
||||
width: 160,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFEAFBF3),
|
||||
color: Color(0xFFEAFBF3),
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset(icon, width: 62, height: 62),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(height: 10),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.black,
|
||||
|
||||
Reference in New Issue
Block a user