user setting screen is finishe

This commit is contained in:
Daniah Ayad Al-sultani
2025-12-10 14:54:00 +03:00
parent 993f396537
commit 1055cd7877
9 changed files with 639 additions and 155 deletions

4
assets/images/ball2.svg Normal file
View File

@@ -0,0 +1,4 @@
<svg width="21" height="26" viewBox="0 0 21 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.5 3C8.51088 3 6.60322 3.79018 5.1967 5.1967C3.79018 6.60322 3 8.51088 3 10.5V20.5H18V10.5C18 8.51088 17.2098 6.60322 15.8033 5.1967C14.3968 3.79018 12.4891 3 10.5 3Z" fill="black" fill-opacity="0.16"/>
<path d="M10.5 3C8.51088 3 6.60322 3.79018 5.1967 5.1967C3.79018 6.60322 3 8.51088 3 10.5V20.5H18V10.5C18 8.51088 17.2098 6.60322 15.8033 5.1967C14.3968 3.79018 12.4891 3 10.5 3ZM10.5 3C10.8315 3 11.1495 2.8683 11.3839 2.63388C11.6183 2.39946 11.75 2.08152 11.75 1.75C11.75 1.41848 11.6183 1.10054 11.3839 0.866116C11.1495 0.631696 10.8315 0.5 10.5 0.5C10.1685 0.5 9.85054 0.631696 9.61612 0.866116C9.3817 1.10054 9.25 1.41848 9.25 1.75C9.25 2.08152 9.3817 2.39946 9.61612 2.63388C9.85054 2.8683 10.1685 3 10.5 3ZM20.5 20.5H0.5M13 23C13 23.663 12.7366 24.2989 12.2678 24.7678C11.7989 25.2366 11.163 25.5 10.5 25.5C9.83696 25.5 9.20107 25.2366 8.73223 24.7678C8.26339 24.2989 8 23.663 8 23" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

4
assets/images/edit.svg Normal file
View File

@@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 17.013L11.413 16.998L21.045 7.45802C21.423 7.08003 21.631 6.57802 21.631 6.04402C21.631 5.51002 21.423 5.00802 21.045 4.63002L19.459 3.04402C18.703 2.28802 17.384 2.29202 16.634 3.04102L7 12.583V17.013ZM18.045 4.45802L19.634 6.04102L18.037 7.62302L16.451 6.03802L18.045 4.45802ZM9 13.417L15.03 7.44402L16.616 9.03002L10.587 15.001L9 15.006V13.417Z" fill="#175B49"/>
<path d="M5 21H19C20.103 21 21 20.103 21 19V10.332L19 12.332V19H8.158C8.132 19 8.105 19.01 8.079 19.01C8.046 19.01 8.013 19.001 7.979 19H5V5H11.847L13.847 3H5C3.897 3 3 3.897 3 5V19C3 20.103 3.897 21 5 21Z" fill="#175B49"/>
</svg>

After

Width:  |  Height:  |  Size: 705 B

3
assets/images/info.svg Normal file
View File

@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9 7H11V5H9M10 18C5.59 18 2 14.41 2 10C2 5.59 5.59 2 10 2C14.41 2 18 5.59 18 10C18 14.41 14.41 18 10 18ZM10 0C8.68678 0 7.38642 0.258658 6.17317 0.761205C4.95991 1.26375 3.85752 2.00035 2.92893 2.92893C1.05357 4.8043 0 7.34784 0 10C0 12.6522 1.05357 15.1957 2.92893 17.0711C3.85752 17.9997 4.95991 18.7362 6.17317 19.2388C7.38642 19.7413 8.68678 20 10 20C12.6522 20 15.1957 18.9464 17.0711 17.0711C18.9464 15.1957 20 12.6522 20 10C20 8.68678 19.7413 7.38642 19.2388 6.17317C18.7362 4.95991 17.9997 3.85752 17.0711 2.92893C16.1425 2.00035 15.0401 1.26375 13.8268 0.761205C12.6136 0.258658 11.3132 0 10 0ZM9 15H11V9H9V15Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 748 B

View File

@@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 18C1.45 18 0.979333 17.8043 0.588 17.413C0.196667 17.0217 0.000666667 16.5507 0 16V2C0 1.45 0.196 0.979333 0.588 0.588C0.98 0.196667 1.45067 0.000666667 2 0H8C8.28333 0 8.521 0.0960001 8.713 0.288C8.905 0.48 9.00067 0.717333 9 1C8.99933 1.28267 8.90333 1.52033 8.712 1.713C8.52067 1.90567 8.28333 2.00133 8 2H2V16H8C8.28333 16 8.521 16.096 8.713 16.288C8.905 16.48 9.00067 16.7173 9 17C8.99933 17.2827 8.90333 17.5203 8.712 17.713C8.52067 17.9057 8.28333 18.0013 8 18H2ZM14.175 10H7C6.71667 10 6.47933 9.904 6.288 9.712C6.09667 9.52 6.00067 9.28267 6 9C5.99933 8.71733 6.09533 8.48 6.288 8.288C6.48067 8.096 6.718 8 7 8H14.175L12.3 6.125C12.1167 5.94167 12.025 5.71667 12.025 5.45C12.025 5.18333 12.1167 4.95 12.3 4.75C12.4833 4.55 12.7167 4.44567 13 4.437C13.2833 4.42833 13.525 4.52433 13.725 4.725L17.3 8.3C17.5 8.5 17.6 8.73333 17.6 9C17.6 9.26667 17.5 9.5 17.3 9.7L13.725 13.275C13.525 13.475 13.2877 13.571 13.013 13.563C12.7383 13.555 12.5007 13.4507 12.3 13.25C12.1167 13.05 12.0293 12.8127 12.038 12.538C12.0467 12.2633 12.1423 12.034 12.325 11.85L14.175 10Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,75 @@
import 'package:flutter/material.dart';
import '../widgets/app_background.dart';
import '../widgets/settings_bar.dart';
class AboutScreen extends StatelessWidget {
const AboutScreen({super.key});
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: AppBackground(
child: Column(
children: [
/// -------------------- SETTINGS BAR --------------------
SettingsBar(
selectedIndex: 0,
onTap: (_) {},
showBackButton: true,
onBackTap: () => Navigator.pop(context),
iconPaths: const [],
),
const SizedBox(height: 12),
/// -------------------- CENTER CONTENT --------------------
///
Expanded(
child: Center(
child: Align(
alignment: Alignment.topCenter,
child: Directionality(
textDirection: TextDirection.rtl,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
"عن الشركة",
style: TextStyle(
fontSize: 26,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
const SizedBox(height: 12),
Container(
width: 200,
height: 1,
color: Color(0x8732C599),
),
const SizedBox(height: 14),
const Text(
"نص",
style: TextStyle(
fontSize: 18,
color: Colors.white70,
),
),
],
),
),
),
),
),
],
),
),
),
);
}
}

View File

@@ -1,6 +1,7 @@
import 'package:coda_project/screens/user_settings_screen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../screens/notifications_screen.dart';
import '../widgets/app_background.dart';
import '../widgets/floatingnavbar.dart';
import '../widgets/settings_bar.dart';
@@ -43,25 +44,37 @@ class _MainPageState extends State<MainPage> {
child: SafeArea(
child: Column(
children: [
SettingsBar(
selectedIndex: _settingsIndex,
onTap: (index) {
setState(() {
_settingsIndex = index;
});
SettingsBar(
selectedIndex: _settingsIndex,
onTap: (index) {
setState(() {
_settingsIndex = index;
});
// 🟢 If user clicked the first icon (user.svg), open settings screen
if (index == 0) {
Navigator.push(
context,
MaterialPageRoute(builder: (_) => const UserSettingsScreen()),
);
}
},
showBackButton: false,
iconPaths: _settingsIconPaths,
),
// 🟢 If user clicked the first icon (user.svg), open settings screen
if (index == 0) {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => const UserSettingsScreen(),
),
);
}
// 🔔 Ball icon → Notifications screen
if (index == 1) {
Navigator.push(
context,
MaterialPageRoute(
builder:
(_) => const NotificationsScreen(), // placeholder
),
);
}
},
showBackButton: false,
iconPaths: _settingsIconPaths,
),
// Main content area
Expanded(
@@ -69,7 +82,6 @@ class _MainPageState extends State<MainPage> {
),
// const SizedBox(height: 20),
Floatingnavbar(
items: _navItems,
selectedIndex: _currentIndex,

View File

@@ -0,0 +1,139 @@
import 'package:flutter/material.dart';
import '../widgets/app_background.dart';
import '../widgets/settings_bar.dart';
class NotificationsScreen extends StatelessWidget {
const NotificationsScreen({super.key});
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: AppBackground(
child: Column(
children: [
/// -------------------- SETTINGS BAR --------------------
SettingsBar(
selectedIndex: 0,
onTap: (_) {},
showBackButton: true,
onBackTap: () => Navigator.pop(context),
iconPaths: const [],
),
const SizedBox(height: 12),
/// -------------------- CONTENT --------------------
Expanded(
child: Directionality(
textDirection: TextDirection.rtl,
child: Column(
children: [
/// Title
Padding(
padding: const EdgeInsets.only(right: 40),
child: Align(
alignment: Alignment.topRight,
child: const Text(
"الأشعارات",
style: TextStyle(
fontSize: 26,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(height: 20),
/// -------------------- NOTIFICATION CARD --------------------
Padding(
padding: const EdgeInsets.symmetric(horizontal: 22),
child: Container(
padding: const EdgeInsets.all(18),
decoration: BoxDecoration(
color: const Color(0xFFEFFFFA),
borderRadius: BorderRadius.circular(20),
boxShadow: const [
BoxShadow(
color: Colors.black26,
blurRadius: 12,
offset: Offset(0, 6),
),
],
),
child: Stack(
children: [
/// ✅ DATE — TOP LEFT
const Positioned(
top: 0,
left: 0,
child: Text(
"2025.12.1",
style: TextStyle(
fontSize: 12,
color: Color(0x9E000000),
fontWeight: FontWeight.w900,
),
),
),
/// ✅ MAIN CONTENT — RTL
Align(
alignment: Alignment.centerRight,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
const Text(
"عنوان الاشعار",
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
// const SizedBox(height: 6),
/// ✅ DETAILS WITH GREEN LINE
Row(
mainAxisSize: MainAxisSize.min,
children: [
// Green line
Container(
width: 20,
height: 2,
color: Color(0xFF025A42),
),
SizedBox(width: 8),
Text(
"تفاصيل الاشعار",
style: TextStyle(
fontSize: 16,
color: Colors.black87,
),
),
],
),
],
),
),
],
),
),
),
],
),
),
),
],
),
),
),
);
}
}

View File

@@ -2,191 +2,260 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../widgets/app_background.dart';
import '../widgets/settings_bar.dart';
import '../screens/about_screen.dart';
import '../screens/auth_screen.dart';
import '../widgets/change_password_modal.dart';
class UserSettingsScreen extends StatelessWidget {
class UserSettingsScreen extends StatefulWidget {
const UserSettingsScreen({super.key});
@override
State<UserSettingsScreen> createState() => _UserSettingsScreenState();
}
class _UserSettingsScreenState extends State<UserSettingsScreen> {
bool _notificationsOn = false;
@override
Widget build(BuildContext context) {
return Directionality(
textDirection: TextDirection.rtl,
return SafeArea(
child: Scaffold(
body: AppBackground(
child: SafeArea(
child: Column(
children: [
/// -------------------- SETTINGS BAR --------------------
Directionality(
textDirection: TextDirection.ltr, // KEEP LOGO LEFT, BACK RIGHT
child: SettingsBar(
selectedIndex: 0,
onTap: (_) {},
showBackButton: true,
onBackTap: () => Navigator.pop(context),
iconPaths: const [],
),
SettingsBar(
selectedIndex: 0,
onTap: (_) {},
showBackButton: true,
onBackTap: () => Navigator.pop(context),
iconPaths: const [],
),
const SizedBox(height: 10),
/// -------------------- PAGE TITLE --------------------
const Text(
"الإعدادات",
style: TextStyle(
fontSize: 26,
color: Colors.white,
fontWeight: FontWeight.bold,
Padding(
padding: const EdgeInsets.only(right: 40),
child: Align(
alignment: Alignment.topRight,
child: const Text(
"الإعدادات",
style: TextStyle(
fontSize: 26,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(height: 20),
/// -------------------- FORM CONTAINER --------------------
Expanded(
child: Center(
child: Stack(
clipBehavior: Clip.none,
children: [
/// Outer border container
Container(
width: MediaQuery.of(context).size.width * 0.85,
decoration: BoxDecoration(
color: const Color(0xFFEEFFFA), // LIGHT GREEN FIXED
borderRadius: BorderRadius.circular(28),
border: Border.all(
color: const Color(0xDD00C28E),
width: 1,
Padding(
padding: const EdgeInsets.only(bottom: 40),
child: Container(
width: MediaQuery.of(context).size.width * 0.85,
height: MediaQuery.of(context).size.height * 0.62,
decoration: BoxDecoration(
color: const Color(0xF3EEFFFA),
borderRadius: BorderRadius.circular(10),
boxShadow: const [
BoxShadow(
color: Colors.black26,
blurRadius: 30,
offset: Offset(0, 20),
),
],
),
boxShadow: const [
BoxShadow(
color: Colors.black26,
blurRadius: 8,
offset: Offset(0, 4),
),
],
),
padding: const EdgeInsets.symmetric(
horizontal: 18,
vertical: 40,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SizedBox(height: 55),
padding: const EdgeInsets.symmetric(
horizontal: 22,
vertical: 55,
),
child: Column(
children: [
const SizedBox(height: 10),
/// -------------------- USER NAME --------------------
const Center(
child: Text(
/// -------------------- USER NAME --------------------
const Text(
"اسم الموظف",
style: TextStyle(
fontSize: 20,
fontSize: 25,
fontWeight: FontWeight.bold,
color: Colors.black87,
),
),
),
const SizedBox(height: 4),
const SizedBox(height: 6),
GestureDetector(
onTap: () {},
child: Center(
/// ✅ CLICKABLE + UNDERLINED
GestureDetector(
onTap: () {
showDialog(
context: context,
barrierDismissible: true,
builder:
(_) => const ChangePasswordModal(),
);
},
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
"تغيير كلمة المرور",
style: TextStyle(
fontSize: 13,
fontSize: 15,
color: Colors.black54,
decoration: TextDecoration.underline,
decorationThickness: 1.5,
),
),
const SizedBox(width: 4),
const SizedBox(width: 6),
SvgPicture.asset(
"assets/images/edit.svg",
width: 16,
height: 16,
width: 22,
height: 22,
),
],
),
),
),
const SizedBox(height: 18),
const SizedBox(height: 20),
/// -------------------- NOTIFICATION SWITCH --------------------
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Switch(
value: true,
activeColor: const Color(0xFF177046),
inactiveThumbColor: Colors.black,
onChanged: (v) {},
),
/// RTL text on right, icon on left
Row(
children: [
const Text(
"الإشعارات",
style: TextStyle(
fontSize: 16,
color: Colors.black87,
/// -------------------- NOTIFICATION SWITCH --------------------
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
setState(() {
_notificationsOn = !_notificationsOn;
});
},
child: AnimatedContainer(
duration: const Duration(
milliseconds: 250,
),
width: 95,
height: 42,
padding: const EdgeInsets.symmetric(
horizontal: 4,
),
decoration: BoxDecoration(
color:
_notificationsOn
? const Color(0xFF0A6B4A)
: const Color(0xFFB5B5B5),
borderRadius: BorderRadius.circular(
40,
),
),
child: Align(
alignment:
_notificationsOn
? Alignment.centerRight
: Alignment.centerLeft,
child: AnimatedContainer(
duration: const Duration(
milliseconds: 250,
),
width: 40,
height: 40,
decoration: BoxDecoration(
color:
_notificationsOn
? const Color(0xFF12BE85)
: const Color(0xFF0F0F0F),
shape: BoxShape.circle,
boxShadow: const [
BoxShadow(
color: Color(0x2D000000),
blurRadius: 6,
offset: Offset(0, 2),
),
],
),
),
),
),
const SizedBox(width: 8),
SvgPicture.asset(
"assets/images/notification.svg",
width: 22,
),
Row(
children: [
const Text(
"الإشعارات",
style: TextStyle(
fontSize: 16,
color: Colors.black87,
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 8),
SvgPicture.asset(
"assets/images/ball2.svg",
width: 22,
),
],
),
],
),
_divider(),
_settingsRow(
label: "عن الشركة",
icon: "assets/images/info.svg",
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => const AboutScreen(),
),
],
),
],
),
);
},
),
_buildDivider(),
_divider(),
_buildSettingsRow(
label: "عن الشركة",
icon: "assets/images/info.svg",
onTap: () {},
),
_buildDivider(),
_buildSettingsRow(
label: "تسجيل خروج",
icon: "assets/images/logout.svg",
onTap: () {},
),
_buildDivider(),
_buildSettingsRow(
label: "إجازات الموظفين",
icon: "assets/images/holiday.svg",
onTap: () {},
),
],
_settingsRow(
label: "تسجيل خروج",
icon: "assets/images/logout2.svg",
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => const AuthScreen(),
),
);
},
),
],
),
),
),
/// -------------------- USER AVATAR --------------------
/// -------------------- AVATAR --------------------
Positioned(
top: -45,
top: -55,
left: 0,
right: 0,
child: Center(
child: Container(
width: 105,
height: 105,
width: 120,
height: 120,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: const Color(0xFFE1E1E1),
border: Border.all(
color: const Color(0xFF177046),
width: 6,
color: const Color(0xFF2D5E50),
width: 12,
),
),
),
@@ -204,39 +273,44 @@ class UserSettingsScreen extends StatelessWidget {
);
}
// Divider line
Widget _buildDivider() {
Widget _divider() {
return Container(
width: double.infinity,
height: 1,
color: const Color(0xFF008864),
margin: const EdgeInsets.symmetric(vertical: 12),
height: 1.2,
color: const Color(0xFFB5DECC),
);
}
// RTL Settings row (text right, icon left)
Widget _buildSettingsRow({
Widget _settingsRow({
required String label,
required String icon,
required VoidCallback onTap,
}) {
return GestureDetector(
onTap: onTap,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
/// ICON on LEFT — RTL
SvgPicture.asset(icon, width: 22),
/// TEXT on RIGHT — RTL
Text(
label,
style: const TextStyle(
fontSize: 16,
color: Colors.black87,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 6),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const SizedBox(width: 24),
Row(
children: [
Text(
label,
style: const TextStyle(
fontSize: 18,
color: Colors.black,
fontWeight: FontWeight.w600,
),
),
const SizedBox(width: 10),
SvgPicture.asset(icon, width: 23),
],
),
),
],
],
),
),
);
}

View File

@@ -0,0 +1,170 @@
import 'package:flutter/material.dart';
import '../widgets/onboarding_button.dart';
class ChangePasswordModal extends StatefulWidget {
const ChangePasswordModal({super.key});
@override
State<ChangePasswordModal> createState() => _ChangePasswordModalState();
}
class _ChangePasswordModalState extends State<ChangePasswordModal> {
bool _oldObscure = true;
// bool _newObscure = true;
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
final screenWidth = screenSize.width;
final screenHeight = screenSize.height;
final formWidth =
screenWidth > 600 ? screenWidth * 0.5 : screenWidth * 0.88;
final labelFontSize = screenWidth > 600 ? 18.0 : 16.0;
final fieldFontSize = screenWidth > 600 ? 18.0 : 16.0;
final verticalPadding = screenHeight > 800 ? 38.0 : 28.0;
final fieldSpacing = screenHeight > 800 ? 30.0 : 20.0;
final buttonSpacing = screenHeight > 800 ? 80.0 : 60.0;
return Material(
color: Colors.transparent,
child: Stack(
children: [
/// ✅ DARK TRANSPARENT OVERLAY (NO BLUR)
Positioned.fill(child: Container(color: const Color(0x80000000))),
/// ---------- MODAL ----------
Center(
child: Directionality(
textDirection: TextDirection.rtl,
child: Container(
width: formWidth,
padding: EdgeInsets.symmetric(
horizontal: 25,
vertical: verticalPadding,
),
decoration: BoxDecoration(
color: const Color(0xFFEEFFFA),
borderRadius: BorderRadius.circular(10),
boxShadow: const [
BoxShadow(
color: Colors.black26,
blurRadius: 10,
offset: Offset(0, 5),
),
],
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
/// ---------- OLD PASSWORD ----------
Align(
alignment: Alignment.centerRight,
child: Text(
"كلمة المرور السابقة",
style: TextStyle(
fontSize: labelFontSize,
fontWeight: FontWeight.w600,
color: Colors.black87,
),
),
),
const SizedBox(height: 8),
_buildField(
hint: "أدخل كلمة المرور",
obscure: _oldObscure,
fontSize: fieldFontSize,
hasEye: true, // ✅ eye here
onEyeTap:
() => setState(() => _oldObscure = !_oldObscure),
),
SizedBox(height: fieldSpacing),
/// ---------- NEW PASSWORD ----------
Align(
alignment: Alignment.centerRight,
child: Text(
"كلمة المرور الجديدة",
style: TextStyle(
fontSize: labelFontSize,
fontWeight: FontWeight.w600,
color: Colors.black87,
),
),
),
const SizedBox(height: 8),
_buildField(
hint: "كلمة المرور",
obscure: false,
fontSize: fieldFontSize,
hasEye: false,
onEyeTap: () {}, // unused
),
SizedBox(height: buttonSpacing),
Center(
child: OnboardingButton(
text: "حفظ التغيير",
backgroundColor: const Color(0xEE23574A),
onPressed: () {
Navigator.pop(context);
},
),
),
],
),
),
),
),
],
),
);
}
Widget _buildField({
required String hint,
required bool obscure,
required double fontSize,
required bool hasEye,
required VoidCallback onEyeTap,
}) {
return Container(
decoration: BoxDecoration(
color: const Color(0xDEDEDEDE),
borderRadius: BorderRadius.circular(7),
boxShadow: const [
BoxShadow(color: Colors.black26, blurRadius: 6, offset: Offset(0, 2)),
],
),
child: TextField(
obscureText: obscure,
textAlign: TextAlign.right,
style: TextStyle(fontSize: fontSize),
decoration: InputDecoration(
hintText: hint,
hintStyle: const TextStyle(color: Colors.black54),
border: InputBorder.none,
contentPadding: const EdgeInsets.symmetric(
vertical: 16,
horizontal: 16,
),
suffixIcon:
hasEye
? IconButton(
icon: Icon(
obscure ? Icons.visibility_off : Icons.visibility,
color: Colors.black54,
),
onPressed: onEyeTap,
)
: null,
),
),
);
}
}