chnages were made for the attandence screen
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import '../widgets/login_animation_screen.dart'; // Import the LoginAnimationScreen
|
||||
|
||||
class AttendanceScreen extends StatelessWidget {
|
||||
const AttendanceScreen({super.key});
|
||||
@@ -88,10 +89,6 @@ class AttendanceScreen extends StatelessWidget {
|
||||
top: 70,
|
||||
left: 24,
|
||||
child: _ShadowedCard(
|
||||
child: _FingerButton(
|
||||
icon: "assets/images/login.svg",
|
||||
label: "تسجيل الدخول",
|
||||
),
|
||||
shadow: const [
|
||||
// Strong BLACK shadow bottom-right
|
||||
BoxShadow(
|
||||
@@ -101,6 +98,21 @@ class AttendanceScreen extends StatelessWidget {
|
||||
offset: Offset(5, 5),
|
||||
),
|
||||
],
|
||||
child: _FingerButton(
|
||||
icon: "assets/images/login.svg",
|
||||
label: "تسجيل الدخول",
|
||||
onTap: () {
|
||||
// Navigate to LoginAnimationScreen with success state
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => LoginAnimationScreen(
|
||||
isLogin: true,
|
||||
isSuccess: true, // Set to true for success, false for error
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -109,12 +121,6 @@ class AttendanceScreen extends StatelessWidget {
|
||||
bottom: 10,
|
||||
right: 24,
|
||||
child: _ShadowedCard(
|
||||
child: _FingerButton(
|
||||
icon: "assets/images/logout.svg",
|
||||
label: "تسجيل خروج",
|
||||
),
|
||||
|
||||
// GREEN glow top-left
|
||||
shadow: const [
|
||||
// Strong BLACK shadow bottom-right
|
||||
BoxShadow(
|
||||
@@ -137,6 +143,21 @@ class AttendanceScreen extends StatelessWidget {
|
||||
offset: Offset(5, 5),
|
||||
),
|
||||
],
|
||||
child: _FingerButton(
|
||||
icon: "assets/images/logout.svg",
|
||||
label: "تسجيل خروج",
|
||||
onTap: () {
|
||||
// Navigate to LoginAnimationScreen with success state
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => LoginAnimationScreen(
|
||||
isLogin: false,
|
||||
isSuccess: true, // Set to true for success, false for error
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -176,33 +197,41 @@ class _ShadowedCard extends StatelessWidget {
|
||||
class _FingerButton extends StatelessWidget {
|
||||
final String icon;
|
||||
final String label;
|
||||
final VoidCallback onTap; // Added onTap callback
|
||||
|
||||
const _FingerButton({required this.icon, required this.label});
|
||||
const _FingerButton({
|
||||
required this.icon,
|
||||
required this.label,
|
||||
required this.onTap, // Added this parameter
|
||||
});
|
||||
|
||||
@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,
|
||||
return GestureDetector(
|
||||
onTap: onTap, // Added gesture detection
|
||||
child: 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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user