attendence login/logout has been implemented
This commit is contained in:
@@ -123,135 +123,143 @@ class _AuthFormState extends State<AuthForm> {
|
||||
textDirection: TextDirection.rtl,
|
||||
child: FocusScope(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// Border container - decorative element behind the form
|
||||
Container(
|
||||
width: borderWidth,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: formHeight + 40,
|
||||
maxHeight:
|
||||
formHeight + 80, // Allows shrinking when keyboard opens
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// Border container - decorative element behind the form
|
||||
Container(
|
||||
width: borderWidth,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: formHeight + 40,
|
||||
maxHeight:
|
||||
formHeight + 80, // Allows shrinking when keyboard opens
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
border: Border.all(color: const Color(0xDD00C28E), width: 1),
|
||||
),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(32),
|
||||
border: Border.all(color: const Color(0xDD00C28E), width: 1),
|
||||
),
|
||||
),
|
||||
|
||||
// Main form container
|
||||
Container(
|
||||
width: formWidth,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: horizontalPadding,
|
||||
vertical: verticalPadding,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFEEFFFA),
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Colors.black26,
|
||||
blurRadius: 10,
|
||||
offset: Offset(0, 5),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
/// Title
|
||||
Center(
|
||||
child: Text(
|
||||
"تسجيل دخول",
|
||||
style: TextStyle(
|
||||
fontSize: titleFontSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black87,
|
||||
),
|
||||
// Main form container
|
||||
Container(
|
||||
width: formWidth,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: horizontalPadding,
|
||||
vertical: verticalPadding,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFEEFFFA),
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Colors.black26,
|
||||
blurRadius: 10,
|
||||
offset: Offset(0, 5),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: verticalSpacing),
|
||||
|
||||
/// Phone Number Label
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
"رقم الهاتف",
|
||||
style: TextStyle(
|
||||
fontSize: labelFontSize,
|
||||
color: Colors.black87,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
_buildField(
|
||||
controller: _phoneNumberController,
|
||||
hint: "رقم الهاتف",
|
||||
obscure: false,
|
||||
keyboardType: TextInputType.phone,
|
||||
focusNode: _phoneNumberFocusNode,
|
||||
textInputAction: TextInputAction.next,
|
||||
onSubmitted: (_) {
|
||||
// Move focus to password field when next is pressed
|
||||
FocusScope.of(context).requestFocus(_passwordFocusNode);
|
||||
},
|
||||
fontSize: fieldFontSize,
|
||||
),
|
||||
|
||||
SizedBox(height: fieldSpacing),
|
||||
|
||||
/// Password Label
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
"كلمة المرور",
|
||||
style: TextStyle(
|
||||
fontSize: labelFontSize,
|
||||
color: Colors.black87,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
_buildField(
|
||||
controller: _passwordController,
|
||||
hint: "كلمة المرور",
|
||||
obscure: _obscure,
|
||||
hasEye: true,
|
||||
focusNode: _passwordFocusNode,
|
||||
textInputAction: TextInputAction.done,
|
||||
onSubmitted: (_) => _handleLogin(),
|
||||
fontSize: fieldFontSize,
|
||||
),
|
||||
|
||||
SizedBox(height: buttonSpacing), // Responsive spacing
|
||||
|
||||
BlocBuilder<LoginBloc, LoginState>(
|
||||
builder: (context, state) {
|
||||
final isLoading = state is LoginLoading;
|
||||
return Center(
|
||||
child: OnboardingButton(
|
||||
text: isLoading ? "جاري تسجيل الدخول..." : "تسجيل دخول",
|
||||
backgroundColor: const Color.fromARGB(239, 35, 87, 74),
|
||||
onPressed: isLoading ? null : _handleLogin,
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
/// Title
|
||||
Center(
|
||||
child: Text(
|
||||
"تسجيل دخول",
|
||||
style: TextStyle(
|
||||
fontSize: titleFontSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black87,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: bottomSpacing),
|
||||
],
|
||||
SizedBox(height: verticalSpacing),
|
||||
|
||||
/// Phone Number Label
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
"رقم الهاتف",
|
||||
style: TextStyle(
|
||||
fontSize: labelFontSize,
|
||||
color: Colors.black87,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
_buildField(
|
||||
controller: _phoneNumberController,
|
||||
hint: "رقم الهاتف",
|
||||
obscure: false,
|
||||
keyboardType: TextInputType.phone,
|
||||
focusNode: _phoneNumberFocusNode,
|
||||
textInputAction: TextInputAction.next,
|
||||
onSubmitted: (_) {
|
||||
// Move focus to password field when next is pressed
|
||||
FocusScope.of(context).requestFocus(_passwordFocusNode);
|
||||
},
|
||||
fontSize: fieldFontSize,
|
||||
),
|
||||
|
||||
SizedBox(height: fieldSpacing),
|
||||
|
||||
/// Password Label
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
"كلمة المرور",
|
||||
style: TextStyle(
|
||||
fontSize: labelFontSize,
|
||||
color: Colors.black87,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
_buildField(
|
||||
controller: _passwordController,
|
||||
hint: "كلمة المرور",
|
||||
obscure: _obscure,
|
||||
hasEye: true,
|
||||
focusNode: _passwordFocusNode,
|
||||
textInputAction: TextInputAction.done,
|
||||
onSubmitted: (_) => _handleLogin(),
|
||||
fontSize: fieldFontSize,
|
||||
),
|
||||
|
||||
SizedBox(height: buttonSpacing), // Responsive spacing
|
||||
|
||||
BlocBuilder<LoginBloc, LoginState>(
|
||||
builder: (context, state) {
|
||||
final isLoading = state is LoginLoading;
|
||||
return Center(
|
||||
child: OnboardingButton(
|
||||
text:
|
||||
isLoading
|
||||
? "جاري تسجيل الدخول..."
|
||||
: "تسجيل دخول",
|
||||
backgroundColor: const Color.fromARGB(
|
||||
239,
|
||||
35,
|
||||
87,
|
||||
74,
|
||||
),
|
||||
onPressed: isLoading ? null : _handleLogin,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
SizedBox(height: bottomSpacing),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user