ui changes added
This commit is contained in:
parent
3dd2aa40fe
commit
8bf645c65b
@ -99,31 +99,35 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
double mywidth = MediaQuery.of(context).size.width;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
padding: const EdgeInsets.only(left: 16.0,right: 16.0,top: 5.0,bottom: 5.0),
|
||||
child: ListView(
|
||||
children: [
|
||||
Container(
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(30.0),
|
||||
border: Border.all(width: 1, color: Color(0xFFAA8E83)),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 12.0),
|
||||
child: TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: "Search",
|
||||
hintStyle: TextStyle(color: Color(0xFF898C81)),
|
||||
prefixIcon: Image.asset(
|
||||
MiscIconAssetPath.search,
|
||||
width: 20,
|
||||
height: 20,
|
||||
width: 15,
|
||||
height: 10,
|
||||
),
|
||||
border: InputBorder.none,
|
||||
contentPadding:
|
||||
EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0),
|
||||
EdgeInsets.symmetric(vertical: 8.0, horizontal: 18.0),
|
||||
),
|
||||
),
|
||||
),),
|
||||
),
|
||||
SizedBox(
|
||||
height: myheight / 35,
|
||||
height: myheight / 40,
|
||||
),
|
||||
...homePageData.map<Widget>((mainTopic) {
|
||||
String colorPattern = mainTopic['color_pattern'];
|
||||
@ -144,7 +148,7 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
},
|
||||
title: mainTopic['main_topic'],
|
||||
titleBackgroundColor: backgroundColor,
|
||||
children: _buildSubTopics(mainTopic['sub_topics'] ?? [], mywidth,
|
||||
children: _buildSubTopics(mainTopic['sub_topics'] ?? [], mywidth,myheight,
|
||||
borderColor, colorPattern, mainTopic['main_topic']),
|
||||
);
|
||||
}),
|
||||
@ -153,7 +157,7 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> _buildSubTopics(List<dynamic> subTopics, double myWidth,
|
||||
List<Widget> _buildSubTopics(List<dynamic> subTopics, double myWidth,myheight,
|
||||
Color borderColor, String colorPattern, mainTopic) {
|
||||
print('colorPattern123 $borderColor');
|
||||
// Sort sub-topics based on `sub_topic_list_order`
|
||||
@ -193,7 +197,8 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
// Calculate width: full width for one item, half for two items
|
||||
final cardWidth = rowItems.length == 1
|
||||
? myWidth
|
||||
: (myWidth - 16) / 2; // Subtract spacing for padding
|
||||
: (myWidth - 16) / 2.6; // Subtract spacing for padding
|
||||
|
||||
|
||||
return Expanded(
|
||||
child: Padding(
|
||||
@ -209,7 +214,7 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
borderColor,
|
||||
colorPattern,
|
||||
cardWidth,
|
||||
mainTopic // Pass the calculated width
|
||||
mainTopic// Pass the calculated width
|
||||
),
|
||||
),
|
||||
);
|
||||
@ -222,13 +227,14 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
|
||||
Widget buildCategoryTitle(String title, Color color) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
padding: const EdgeInsets.only(top: 1.2,bottom: 1.2),
|
||||
// padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Center(
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
@ -259,6 +265,7 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
Color boldColor,
|
||||
colorPattern,
|
||||
double mywidth,
|
||||
|
||||
String mainTopic) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
@ -283,27 +290,30 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
||||
color: Colors.white, // Background color
|
||||
border: Border.all(
|
||||
color: bordercolor, // Border color
|
||||
width: 2, // Border width
|
||||
width: 1, // Border width
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(12), // Optional: Rounded corners
|
||||
),
|
||||
padding: const EdgeInsets.all(3.0),
|
||||
padding: const EdgeInsets.only(top: 3.0, bottom: 3.0, left: 5.0, right: 5.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: robotoRegular11,
|
||||
),
|
||||
SizedBox(height: 0.2),
|
||||
|
||||
|
||||
SizedBox(height: 0.1),
|
||||
Text(subtitle, textAlign: TextAlign.center, style: subtitleStyle),
|
||||
SizedBox(height: 0.7),
|
||||
SizedBox(height: 0.3),
|
||||
Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontSize: 20,
|
||||
color: boldColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@ -355,12 +365,17 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () => widget.onTap(widget.index),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, // Ensuring the background outside the rounded container is white
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: widget.titleBackgroundColor,
|
||||
borderRadius: BorderRadius.all(Radius.circular(35))),
|
||||
borderRadius: BorderRadius.all(Radius.circular(35))
|
||||
),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16, bottom: 10, top: 10, right: 10),
|
||||
left: 16, bottom: 5, top: 5, right: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@ -368,8 +383,8 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
|
||||
widget.title,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
@ -382,6 +397,7 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
ClipRRect(
|
||||
child: AnimatedContainer(
|
||||
@ -410,4 +426,4 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:pocketbase/pocketbase.dart';
|
||||
import 'package:uae_stat/config/my_router.dart';
|
||||
import 'package:uae_stat/domain/use_cases/language.dart';
|
||||
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart';
|
||||
import 'package:uae_stat/presentation/Screens/profilepage.dart';
|
||||
import 'package:uae_stat/presentation/components/space.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
@ -209,7 +210,7 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
||||
children: [
|
||||
// SizedBox(height: screenHeight / 7),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
alignment: Alignment.topLeft,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
|
||||
@ -222,52 +223,134 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
||||
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16,left: 16,bottom: 16,right: 1), // Add margin for positioning
|
||||
width: 30, // Circle diameter
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[300], // Circle color
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
margin: EdgeInsets.only(top: 10,left: 1,bottom: 16,right: 1), // Add margin for positioning
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
size: 20, // Icon size
|
||||
color: Colors.white, // Icon color
|
||||
// Icons.close,
|
||||
Icons.arrow_back_ios,
|
||||
size: 28, // Icon size
|
||||
color: Colors.black, // Icon color
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: screenHeight / 6),
|
||||
SizedBox(height: screenHeight / 30),
|
||||
|
||||
Text(
|
||||
// "Create New Password",
|
||||
AppLocalizations.of(context)!.create_new_password,
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 26,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
),
|
||||
SizedBox(height: screenHeight / 35),
|
||||
SizedBox(height: 10),
|
||||
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: 'Your New Password Must Be Different\n',
|
||||
style: TextStyle(fontSize: 15,fontWeight: FontWeight.w700, color: Color(0xFF898C81)),
|
||||
),
|
||||
TextSpan(
|
||||
text: 'from Previously Used Password',
|
||||
style: TextStyle(fontSize: 15, color: Color(0xFF898C81), fontWeight: FontWeight.w700),
|
||||
),
|
||||
],
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
TextFormField(
|
||||
obscureText: _obscureOldPassword,
|
||||
decoration: InputDecoration(
|
||||
// hintText: 'Enter old password',
|
||||
hintText: AppLocalizations.of(context)!.old_password,
|
||||
prefixIcon: Icon(Icons.lock, color: Colors.blue),
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
_obscureOldPassword
|
||||
? Icons.visibility_off
|
||||
: Icons.visibility,
|
||||
color: Colors.blue,
|
||||
// prefixIcon: Icon(Icons.lock, color: Colors.blue),
|
||||
hintStyle: TextStyle(
|
||||
color: Color(0xFFC3C6CB),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Roboto'
|
||||
),
|
||||
prefixIconConstraints:
|
||||
const BoxConstraints(
|
||||
maxWidth: 25 + 16 + 10,
|
||||
maxHeight: 25 + (8 * 2),
|
||||
),
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsetsDirectional
|
||||
.only(
|
||||
start: 16,
|
||||
end: 10,
|
||||
),
|
||||
child: Image.asset(
|
||||
MiscIconAssetPath.lock,
|
||||
fit: BoxFit.fitHeight,
|
||||
height: 25,
|
||||
width: 25,
|
||||
color: MyTheme.topicColor(
|
||||
IndicatorTopic.economy)
|
||||
.shade300,
|
||||
),),
|
||||
suffixIcon: IconButton(
|
||||
// icon: Icon(
|
||||
// _obscureOldPassword
|
||||
// ? Icons.visibility_off
|
||||
// : Icons.visibility,
|
||||
// color: Colors.blue,
|
||||
// ),
|
||||
|
||||
icon: Image.asset(
|
||||
_obscureOldPassword
|
||||
? MiscIconAssetPath
|
||||
.visibilityOff
|
||||
: MiscIconAssetPath.visibleOn,
|
||||
|
||||
color: Color(
|
||||
0xFF9EA2A9,), // Apply color if needed, but keep in mind `Image.asset` might not support color directly.
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
|
||||
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_obscureOldPassword = !_obscureOldPassword;
|
||||
});
|
||||
},
|
||||
),
|
||||
border: OutlineInputBorder(),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: MyTheme.topicColor(
|
||||
IndicatorTopic.economy)
|
||||
.shade400,
|
||||
width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: Colors.deepPurple,
|
||||
width: 2), // Focused border
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: Color(0xFFb22222),
|
||||
width: 1), // Error border
|
||||
),
|
||||
focusedErrorBorder:
|
||||
OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: Color(0xFFb22222),
|
||||
width:
|
||||
1), // Match the error color
|
||||
),
|
||||
),
|
||||
validator: _validateOldPassword,
|
||||
onChanged: (value) => _oldPassword = value,
|
||||
@ -278,21 +361,93 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
||||
decoration: InputDecoration(
|
||||
// hintText: 'Enter new password',
|
||||
hintText: AppLocalizations.of(context)!.enter_new_password,
|
||||
prefixIcon: Icon(Icons.lock, color: Colors.blue),
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
_obscureNewPassword
|
||||
? Icons.visibility_off
|
||||
: Icons.visibility,
|
||||
color: Colors.blue,
|
||||
// prefixIcon: Icon(Icons.lock, color: Colors.blue),
|
||||
hintStyle: TextStyle(
|
||||
color: Color(0xFFC3C6CB),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Roboto'
|
||||
),
|
||||
prefixIconConstraints:
|
||||
const BoxConstraints(
|
||||
maxWidth: 25 + 16 + 10,
|
||||
maxHeight: 25 + (8 * 2),
|
||||
),
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsetsDirectional
|
||||
.only(
|
||||
start: 16,
|
||||
end: 10,
|
||||
),
|
||||
child: Image.asset(
|
||||
MiscIconAssetPath.lock,
|
||||
fit: BoxFit.fitHeight,
|
||||
height: 25,
|
||||
width: 25,
|
||||
color: MyTheme.topicColor(
|
||||
IndicatorTopic.economy)
|
||||
.shade300,
|
||||
),
|
||||
),
|
||||
|
||||
suffixIcon: IconButton(
|
||||
// icon: Icon(
|
||||
// _obscureNewPassword
|
||||
// ? Icons.visibility_off
|
||||
// : Icons.visibility,
|
||||
// color: Colors.blue,
|
||||
// ),
|
||||
|
||||
icon: Image.asset(
|
||||
_obscureNewPassword
|
||||
? MiscIconAssetPath
|
||||
.visibilityOff
|
||||
: MiscIconAssetPath.visibleOn,
|
||||
|
||||
color: Color(
|
||||
0xFF9EA2A9), // Apply color if needed, but keep in mind `Image.asset` might not support color directly.
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
|
||||
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_obscureNewPassword = !_obscureNewPassword;
|
||||
});
|
||||
},
|
||||
),
|
||||
border: OutlineInputBorder(),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: MyTheme.topicColor(
|
||||
IndicatorTopic.economy)
|
||||
.shade400,
|
||||
width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: Colors.deepPurple,
|
||||
width: 2), // Focused border
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: Color(0xFFb22222),
|
||||
width: 1), // Error border
|
||||
),
|
||||
focusedErrorBorder:
|
||||
OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: Color(0xFFb22222),
|
||||
width:
|
||||
1), // Match the error color
|
||||
),
|
||||
),
|
||||
validator: _validateNewPassword,
|
||||
),
|
||||
@ -302,13 +457,51 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
||||
decoration: InputDecoration(
|
||||
// hintText: 'Confirm new password',
|
||||
hintText: AppLocalizations.of(context)!.confirm_new_password,
|
||||
prefixIcon: Icon(Icons.lock, color: Colors.blue),
|
||||
hintStyle: TextStyle(
|
||||
color: Color(0xFFC3C6CB),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Roboto'
|
||||
),
|
||||
prefixIconConstraints:
|
||||
const BoxConstraints(
|
||||
maxWidth: 25 + 16 + 10,
|
||||
maxHeight: 25 + (8 * 2),
|
||||
),
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsetsDirectional
|
||||
.only(
|
||||
start: 16,
|
||||
end: 10,
|
||||
),
|
||||
child: Image.asset(
|
||||
MiscIconAssetPath.lock,
|
||||
fit: BoxFit.fitHeight,
|
||||
height: 25,
|
||||
width: 25,
|
||||
color: MyTheme.topicColor(
|
||||
IndicatorTopic.economy)
|
||||
.shade300,
|
||||
),
|
||||
),
|
||||
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
_obscureConfirmPassword
|
||||
? Icons.visibility_off
|
||||
: Icons.visibility,
|
||||
color: Colors.blue,
|
||||
// icon: Icon(
|
||||
// _obscureConfirmPassword
|
||||
// ? Icons.visibility_off
|
||||
// : Icons.visibility,
|
||||
// color: Colors.blue,
|
||||
// ),
|
||||
|
||||
icon: Image.asset(
|
||||
_obscureConfirmPassword
|
||||
? MiscIconAssetPath
|
||||
.visibilityOff
|
||||
: MiscIconAssetPath.visibleOn,
|
||||
|
||||
color: Color(
|
||||
0xFF9EA2A9), // Apply color if needed, but keep in mind `Image.asset` might not support color directly.
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
@ -316,7 +509,39 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
||||
});
|
||||
},
|
||||
),
|
||||
border: OutlineInputBorder(),
|
||||
// border: OutlineInputBorder(),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: MyTheme.topicColor(
|
||||
IndicatorTopic.economy)
|
||||
.shade400,
|
||||
width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: Colors.deepPurple,
|
||||
width: 2), // Focused border
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: Color(0xFFb22222),
|
||||
width: 1), // Error border
|
||||
),
|
||||
focusedErrorBorder:
|
||||
OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
borderSide: BorderSide(
|
||||
color: Color(0xFFb22222),
|
||||
width:
|
||||
1), // Match the error color
|
||||
),
|
||||
),
|
||||
validator: _validateConfirmPassword,
|
||||
),
|
||||
@ -360,7 +585,7 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
||||
SizedBox(height: screenHeight / 5),
|
||||
Center(
|
||||
child: Container(
|
||||
height: screenHeight / 12,
|
||||
height: screenHeight / 16,
|
||||
width: screenWidth / 2.5,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
@ -443,11 +668,11 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: screenHeight / 5),
|
||||
SizedBox(height: screenHeight / 12),
|
||||
Center(
|
||||
child: Container(
|
||||
height: screenHeight / 8,
|
||||
width: screenWidth / 2,
|
||||
height: screenHeight / 1,
|
||||
width: screenWidth / 2.5,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/splash_screen/logo.png"),
|
||||
@ -460,4 +685,4 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -381,7 +381,7 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: screenheight / 8),
|
||||
SizedBox(height: screenheight / 4),
|
||||
buildIconContainer(
|
||||
Icons.report, Color(0xFF7DAFBC)),
|
||||
SizedBox(height: 20),
|
||||
@ -409,11 +409,20 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
SizedBox(height: 10),
|
||||
ElevatedButton(
|
||||
onPressed: () => {context.go('/')},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Color(0xFFAA8E83), // Background color
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12), // Border radius
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Go to Login', 'اذهب إلى تسجيل الدخول'),
|
||||
context.translate('Go to Login', 'اذهب إلى تسجيل الدخول'),
|
||||
style: TextStyle(
|
||||
color: Colors.white, // Text color
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: screenheight / 5),
|
||||
Center(
|
||||
child: Container(
|
||||
@ -1197,4 +1206,4 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -218,8 +218,43 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
initialDate: initialDate,
|
||||
firstDate: firstDate,
|
||||
lastDate: lastDate,
|
||||
builder: (context, child) {
|
||||
return Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
dialogBackgroundColor: Colors.white, // Background color of the date picker
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: ButtonStyle(
|
||||
shape: WidgetStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12.0), // Rounded corners
|
||||
)),
|
||||
),
|
||||
),
|
||||
datePickerTheme: DatePickerThemeData(
|
||||
confirmButtonStyle: ButtonStyle(
|
||||
backgroundColor: WidgetStateProperty.all(Color(0xFFAA8E83)), // OK button background color
|
||||
foregroundColor: WidgetStateProperty.all(Colors.white), // OK button text color
|
||||
minimumSize: WidgetStateProperty.all(Size(150, 50)),
|
||||
shape: WidgetStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12.0), // Rounded corners
|
||||
)),
|
||||
),
|
||||
cancelButtonStyle: ButtonStyle(
|
||||
// backgroundColor: WidgetStateProperty.all(Colors.white), // Cancel button background color
|
||||
foregroundColor: WidgetStateProperty.all(Color(0xFFAA8E83)), // Cancel button text color
|
||||
minimumSize: WidgetStateProperty.all(Size(150, 50)),
|
||||
shape: WidgetStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12.0), // Rounded corners
|
||||
side: const BorderSide(color: Color(0xFFAA8E83), width: 2), // Outline color
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: child!,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
if (pickedDate != null && pickedDate != _selectedDate) {
|
||||
setState(() {
|
||||
_selectedDate = pickedDate;
|
||||
@ -356,30 +391,55 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
'Logout',
|
||||
'تسجيل الخروج',
|
||||
),
|
||||
style: TextStyle(color: Color(0xFF898C81),fontWeight: FontWeight.w700),
|
||||
),
|
||||
content: Text(
|
||||
context.translate(
|
||||
'Are you sure you want to logout?',
|
||||
'هل أنت متأكد أنك تريد تسجيل الخروج؟',
|
||||
),
|
||||
style: TextStyle(color:Color(0xFF898C81)),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(), // Close dialog
|
||||
style: TextButton.styleFrom(
|
||||
// backgroundColor:
|
||||
// Color(0xFFAA8E83), // Set background color
|
||||
side: BorderSide(color: Color(0xFFAA8E83), width: 2),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0), // Set text color
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Cancel',
|
||||
'إلغاء',
|
||||
),
|
||||
style: TextStyle(
|
||||
color: Color(0xFFAA8E83), // Text color
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => logout(context), // Exit the app
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor:
|
||||
Color(0xFFAA8E83), // Set background color
|
||||
// foregroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10.0), // Set text color
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
context.translate(
|
||||
'Logout',
|
||||
'تسجيل الخروج',
|
||||
),
|
||||
style: TextStyle(
|
||||
color: Colors.white, // Text color
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -409,438 +469,442 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
AppLocalizations.of(context)!.my_profile,
|
||||
style: TextStyle(color: Color(0xFF985400)),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
context.go('/');
|
||||
},
|
||||
child: Text(
|
||||
'Logout',
|
||||
style: TextStyle(color: Colors.orange),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.logout, color: Colors.black),
|
||||
onPressed: () {},
|
||||
),
|
||||
],
|
||||
// actions: [
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// context.go('/');
|
||||
// },
|
||||
// child: Text(
|
||||
// 'Logout',
|
||||
// style: TextStyle(color: Colors.orange),
|
||||
// ),
|
||||
// ),
|
||||
// IconButton(
|
||||
// icon: Icon(Icons.logout, color: Colors.black),
|
||||
// onPressed: () {},
|
||||
// ),
|
||||
// ],
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 20.0, bottom: 20.0, left: 25, right: 25),
|
||||
child: Column(
|
||||
children: [
|
||||
// CircleAvatar(
|
||||
// radius: 50,
|
||||
// backgroundImage: _profileImage != null
|
||||
// ? FileImage(_profileImage!)
|
||||
// : AssetImage("assets/edit_profile/profile.png")
|
||||
// as ImageProvider,
|
||||
// child: Align(
|
||||
// alignment: Alignment.bottomRight,
|
||||
// child: GestureDetector(
|
||||
// onTap: _pickImage, // Call `_pickImage` on tap
|
||||
// child: CircleAvatar(
|
||||
// radius: 15,
|
||||
// backgroundColor: Colors.white,
|
||||
// child: Icon(
|
||||
// Icons.camera_alt,
|
||||
// size: 15,
|
||||
// color: Colors.grey,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 20.0, bottom: 20.0, left: 25, right: 25),
|
||||
child: Column(
|
||||
children: [
|
||||
// CircleAvatar(
|
||||
// radius: 50,
|
||||
// backgroundImage: _profileImage != null
|
||||
// ? FileImage(_profileImage!)
|
||||
// : AssetImage("assets/edit_profile/profile.png")
|
||||
// as ImageProvider,
|
||||
// child: Align(
|
||||
// alignment: Alignment.bottomRight,
|
||||
// child: GestureDetector(
|
||||
// onTap: _pickImage, // Call `_pickImage` on tap
|
||||
// child: CircleAvatar(
|
||||
// radius: 15,
|
||||
// backgroundColor: Colors.white,
|
||||
// child: Icon(
|
||||
// Icons.camera_alt,
|
||||
// size: 15,
|
||||
// color: Colors.grey,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// CircleAvatar with the profile image
|
||||
CircleAvatar(
|
||||
radius: 50,
|
||||
backgroundImage: _profileImage != null
|
||||
? FileImage(_profileImage!)
|
||||
: AssetImage("assets/edit_profile/profile.png")
|
||||
as ImageProvider,
|
||||
child: Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: GestureDetector(
|
||||
onTap: _pickImage, // Call `_pickImage` on tap
|
||||
child: CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundColor: Colors.white,
|
||||
child: Icon(
|
||||
Icons.camera_alt,
|
||||
size: 15,
|
||||
color: Colors.grey,
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// CircleAvatar with the profile image
|
||||
CircleAvatar(
|
||||
radius: 50,
|
||||
backgroundImage: _profileImage != null
|
||||
? FileImage(_profileImage!)
|
||||
: AssetImage("assets/edit_profile/profile.png")
|
||||
as ImageProvider,
|
||||
child: Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: GestureDetector(
|
||||
onTap: _pickImage, // Call `_pickImage` on tap
|
||||
child: CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundColor: Colors.white,
|
||||
child: Icon(
|
||||
Icons.camera_alt,
|
||||
size: 15,
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Conditional loader that shows when _isLoading is true
|
||||
if (_isLoading)
|
||||
Positioned(
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor:
|
||||
AlwaysStoppedAnimation<Color>(Colors.grey),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(height: 20),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.register_name,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.grey),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
TextFormField(
|
||||
controller: _usernameController,
|
||||
focusNode: _focusNodes[0],
|
||||
decoration: InputDecoration(
|
||||
// hintText: _showHints[0] ? 'Enter the User Name' : null,
|
||||
hintStyle: TextStyle(color: Colors.grey),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.email_id,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.grey),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
TextFormField(
|
||||
controller: _emailController,
|
||||
focusNode: _focusNodes[1],
|
||||
decoration: InputDecoration(
|
||||
// hintText:
|
||||
// _showHints[1] ? 'mohammad.hassan@fcsc.gov.ae' : null,
|
||||
hintStyle: TextStyle(color: Colors.grey),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.full_name,
|
||||
style: TextStyle(
|
||||
fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
TextFormField(
|
||||
enabled: true,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Required';
|
||||
}
|
||||
|
||||
//RegExp(r"^[a-zA-Z\s]+$");
|
||||
final nameRegex = RegExp(
|
||||
r"^[a-zA-Z0-9'\-\u0627\u0639~\u00C0-\u00FF\s]+$");
|
||||
|
||||
if (!nameRegex.hasMatch(value)) {
|
||||
return 'Invalid Characters';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: _fullNameController,
|
||||
focusNode: _focusNodes[2],
|
||||
decoration: InputDecoration(
|
||||
hintText: _showHints[2] ? 'Enter the name' : null,
|
||||
hintStyle: TextStyle(color: Colors.grey),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
counterText: '',
|
||||
),
|
||||
maxLength: 40, // Set the maximum length to 20 characters
|
||||
maxLengthEnforcement: MaxLengthEnforcement.enforced,
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.dob,
|
||||
style: TextStyle(
|
||||
fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
MouseRegion(
|
||||
onEnter: (_) => setState(() => _isHoveringDate = true),
|
||||
onExit: (_) => setState(() => _isHoveringDate = false),
|
||||
child: TextFormField(
|
||||
controller: _dateController,
|
||||
focusNode: _focusNodes[3],
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
hintText: _showHints[3] ? 'DD/MM/YYYY' : null,
|
||||
//_showHints[3] ? 'Select your Date of Birth' : null,
|
||||
hintStyle: TextStyle(color: Colors.grey),
|
||||
|
||||
suffixIcon: Container(
|
||||
width: 45,
|
||||
padding: EdgeInsets.only(right: 1),
|
||||
alignment:
|
||||
Alignment.center, // Center the icon vertically
|
||||
child: Icon(
|
||||
Icons.keyboard_arrow_down_sharp,
|
||||
color: _isHoveringDate ? Colors.black : Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
readOnly: true,
|
||||
onTap: _pickDate,
|
||||
validator: _validateDob,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.region,
|
||||
style: TextStyle(
|
||||
fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
MouseRegion(
|
||||
onEnter: (_) => setState(() => _isHoveringDropdown = true),
|
||||
onExit: (_) => setState(() => _isHoveringDropdown = false),
|
||||
child: DropdownButtonFormField<String>(
|
||||
value: _selectedCountry,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
labelText: 'Select',
|
||||
),
|
||||
icon: Icon(Icons.keyboard_arrow_down_sharp,
|
||||
color:
|
||||
_isHoveringDropdown ? Colors.black : Colors.grey),
|
||||
items: _countries
|
||||
.map((item) => DropdownMenuItem<String>(
|
||||
value: item,
|
||||
child: Text(item),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
_selectedCountry = newValue;
|
||||
});
|
||||
},
|
||||
validator: _validateDropdown,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: isChecked,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isChecked = value ?? false;
|
||||
showError = false;
|
||||
});
|
||||
},
|
||||
side: BorderSide(
|
||||
color:
|
||||
showError ? Color(0xFFb22222) : Color(0xFF7296BE),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 10,
|
||||
// Conditional loader that shows when _isLoading is true
|
||||
if (_isLoading)
|
||||
Positioned(
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor:
|
||||
AlwaysStoppedAnimation<Color>(Colors.grey),
|
||||
),
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(context)!.agree,
|
||||
style: TextStyle(color: Color(0xFF898C81)),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(
|
||||
context,
|
||||
)!
|
||||
.terms_conditions,
|
||||
style: TextStyle(
|
||||
color: Color(0xFF985400),
|
||||
// decoration: TextDecoration.underline,
|
||||
fontWeight: FontWeight
|
||||
.w600, // Makes the text bold
|
||||
decorationColor: Color(0xFF985400),
|
||||
decorationThickness: 1,
|
||||
),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
// Add action for Terms & Conditions tap
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(
|
||||
context,
|
||||
)!
|
||||
.t_and,
|
||||
style: TextStyle(color: Color(0xFF898C81)),
|
||||
),
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(
|
||||
context,
|
||||
)!
|
||||
.privacy_policy,
|
||||
style: TextStyle(
|
||||
color: Color(0xFF985400),
|
||||
// decoration: TextDecoration.underline,
|
||||
fontWeight: FontWeight
|
||||
.w600, // Makes the text bold
|
||||
decorationColor: Color(0xFF985400),
|
||||
decorationThickness: 1,
|
||||
),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
// Add action for Privacy Policy tap
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(
|
||||
context,
|
||||
)!
|
||||
.conditions,
|
||||
style: TextStyle(color: Color(0xFF898C81)),
|
||||
),
|
||||
],
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.visible,
|
||||
softWrap: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (showError)
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(height: 20),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10.0),
|
||||
child: Text(
|
||||
'Please agree to terms and conditions',
|
||||
style: TextStyle(
|
||||
color: Color(0xFFb22222),
|
||||
fontSize: 12,
|
||||
Text(
|
||||
AppLocalizations.of(context)!.register_name,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.grey),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
TextFormField(
|
||||
controller: _usernameController,
|
||||
focusNode: _focusNodes[0],
|
||||
decoration: InputDecoration(
|
||||
// hintText: _showHints[0] ? 'Enter the User Name' : null,
|
||||
hintStyle: TextStyle(color: Colors.grey),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.email_id,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.grey),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
TextFormField(
|
||||
controller: _emailController,
|
||||
focusNode: _focusNodes[1],
|
||||
decoration: InputDecoration(
|
||||
// hintText:
|
||||
// _showHints[1] ? 'mohammad.hassan@fcsc.gov.ae' : null,
|
||||
hintStyle: TextStyle(color: Colors.grey),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
enabled: false,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.full_name,
|
||||
style: TextStyle(
|
||||
fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
TextFormField(
|
||||
enabled: true,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Required';
|
||||
}
|
||||
|
||||
//RegExp(r"^[a-zA-Z\s]+$");
|
||||
final nameRegex = RegExp(
|
||||
r"^[a-zA-Z0-9'\-\u0627\u0639~\u00C0-\u00FF\s]+$");
|
||||
|
||||
if (!nameRegex.hasMatch(value)) {
|
||||
return 'Invalid Characters';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
controller: _fullNameController,
|
||||
focusNode: _focusNodes[2],
|
||||
decoration: InputDecoration(
|
||||
hintText: _showHints[2] ? 'Enter the name' : null,
|
||||
hintStyle: TextStyle(color: Colors.grey),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
counterText: '',
|
||||
),
|
||||
maxLength: 40, // Set the maximum length to 20 characters
|
||||
maxLengthEnforcement: MaxLengthEnforcement.enforced,
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.dob,
|
||||
style: TextStyle(
|
||||
fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
MouseRegion(
|
||||
onEnter: (_) => setState(() => _isHoveringDate = true),
|
||||
onExit: (_) => setState(() => _isHoveringDate = false),
|
||||
child: TextFormField(
|
||||
controller: _dateController,
|
||||
focusNode: _focusNodes[3],
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
hintText: _showHints[3] ? 'DD/MM/YYYY' : null,
|
||||
//_showHints[3] ? 'Select your Date of Birth' : null,
|
||||
hintStyle: TextStyle(color: Colors.grey),
|
||||
|
||||
suffixIcon: Container(
|
||||
width: 45,
|
||||
padding: EdgeInsets.only(right: 1),
|
||||
alignment:
|
||||
Alignment.center, // Center the icon vertically
|
||||
child: Icon(
|
||||
Icons.keyboard_arrow_down_sharp,
|
||||
color: _isHoveringDate ? Colors.black : Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
readOnly: true,
|
||||
onTap: _pickDate,
|
||||
validator: _validateDob,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.region,
|
||||
style: TextStyle(
|
||||
fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
MouseRegion(
|
||||
onEnter: (_) => setState(() => _isHoveringDropdown = true),
|
||||
onExit: (_) => setState(() => _isHoveringDropdown = false),
|
||||
child: DropdownButtonFormField<String>(
|
||||
value: _selectedCountry,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
labelText: 'Select',
|
||||
),
|
||||
icon: Icon(Icons.keyboard_arrow_down_sharp,
|
||||
color:
|
||||
_isHoveringDropdown ? Colors.black : Colors.grey),
|
||||
items: _countries
|
||||
.map((item) => DropdownMenuItem<String>(
|
||||
value: item,
|
||||
child: Text(item),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
_selectedCountry = newValue;
|
||||
});
|
||||
},
|
||||
validator: _validateDropdown,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: isChecked,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isChecked = value ?? false;
|
||||
showError = false;
|
||||
});
|
||||
},
|
||||
side: BorderSide(
|
||||
color:
|
||||
showError ? Color(0xFFb22222) : Color(0xFF7296BE),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(context)!.agree,
|
||||
style: TextStyle(color: Color(0xFF898C81)),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(
|
||||
context,
|
||||
)!
|
||||
.terms_conditions,
|
||||
style: TextStyle(
|
||||
color: Color(0xFF985400),
|
||||
// decoration: TextDecoration.underline,
|
||||
fontWeight: FontWeight
|
||||
.w600, // Makes the text bold
|
||||
decorationColor: Color(0xFF985400),
|
||||
decorationThickness: 1,
|
||||
),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
// Add action for Terms & Conditions tap
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(
|
||||
context,
|
||||
)!
|
||||
.t_and,
|
||||
style: TextStyle(color: Color(0xFF898C81)),
|
||||
),
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(
|
||||
context,
|
||||
)!
|
||||
.privacy_policy,
|
||||
style: TextStyle(
|
||||
color: Color(0xFF985400),
|
||||
// decoration: TextDecoration.underline,
|
||||
fontWeight: FontWeight
|
||||
.w600, // Makes the text bold
|
||||
decorationColor: Color(0xFF985400),
|
||||
decorationThickness: 1,
|
||||
),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
// Add action for Privacy Policy tap
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: AppLocalizations.of(
|
||||
context,
|
||||
)!
|
||||
.conditions,
|
||||
style: TextStyle(color: Color(0xFF898C81)),
|
||||
),
|
||||
],
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.visible,
|
||||
softWrap: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
Center(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
final userId = widget.userId;
|
||||
final email = _emailController.text;
|
||||
if (showError)
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10.0),
|
||||
child: Text(
|
||||
'Required',
|
||||
style: TextStyle(
|
||||
color: Color(0xFFb22222),
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
Center(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
final userId = widget.userId;
|
||||
final email = _emailController.text;
|
||||
|
||||
context.go('/createNewPw/$userId/$email');
|
||||
context.go('/createNewPw/$userId/$email');
|
||||
},
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.change_password,
|
||||
style: TextStyle(
|
||||
// color: Color(0xFF648CBA),
|
||||
color: Color(0xFF985400),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontFamily: 'Roboto',
|
||||
// decoration: TextDecoration.underline),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
// ElevatedButton.icon(
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
if ((_formKey.currentState?.validate() ?? false) &&
|
||||
(isChecked)) {
|
||||
_formKey.currentState?.save();
|
||||
showConfirmationDialog(context);
|
||||
} else {
|
||||
setState(() {
|
||||
showError =
|
||||
!isChecked; // Show error if the checkbox is not checked
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.change_password,
|
||||
style: TextStyle(
|
||||
color: Color(0xFF648CBA),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontFamily: 'Roboto',
|
||||
// decoration: TextDecoration.underline),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Color(0xFF92722A),
|
||||
minimumSize: Size(double.infinity, 50),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
// ElevatedButton.icon(
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
if ((_formKey.currentState?.validate() ?? false) &&
|
||||
(isChecked)) {
|
||||
_formKey.currentState?.save();
|
||||
showConfirmationDialog(context);
|
||||
} else {
|
||||
setState(() {
|
||||
showError =
|
||||
!isChecked; // Show error if the checkbox is not checked
|
||||
});
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Color(0xFF92722A),
|
||||
minimumSize: Size(double.infinity, 50),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center, // Center the content
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.save,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
SizedBox(width: 8), // Add space between text and icon
|
||||
Image.asset(
|
||||
MiscIconAssetPath.save,
|
||||
color: Colors.white,
|
||||
width: 20,
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center, // Center the content
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.save,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
SizedBox(width: 8), // Add space between text and icon
|
||||
Image.asset(
|
||||
MiscIconAssetPath.save,
|
||||
color: Colors.white,
|
||||
width: 20,
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -952,4 +1016,4 @@ class ConfirmationDialog extends StatelessWidget {
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -99,12 +99,19 @@ extension Dialogs on BuildContext {
|
||||
builder: (context) {
|
||||
final contentText = Text(content);
|
||||
return AlertDialog(
|
||||
title: Text(title),
|
||||
title: Text(title,
|
||||
style: TextStyle(color: Color(0xFF898C81),fontWeight: FontWeight.w700),),
|
||||
content: content.length > 300
|
||||
? SingleChildScrollView(
|
||||
child: contentText,
|
||||
child:Text(
|
||||
content,
|
||||
style: TextStyle(color: Color(0xFF898C81))
|
||||
),
|
||||
)
|
||||
: contentText,
|
||||
: Text(
|
||||
content,
|
||||
style: TextStyle(color:Color(0xFF898C81)), // Set content text color
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: Navigator.of(
|
||||
@ -112,10 +119,11 @@ extension Dialogs on BuildContext {
|
||||
rootNavigator: true,
|
||||
).pop,
|
||||
style: TextButton.styleFrom(
|
||||
// backgroundColor: Colors.white, // Background color
|
||||
foregroundColor: Color(0xFF92722A), // Font (text) color
|
||||
backgroundColor: Color(0xFFAA8E83), // Background color
|
||||
foregroundColor: Colors.white, // Font (text) color
|
||||
side: BorderSide(
|
||||
color: Color(0xFF92722A)), // Border outline color
|
||||
// color: Color(0xFF92722A)), // Border outline color
|
||||
color: Color(0xFFAA8E83)), // Border outline color
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(8), // Optional: Rounded corners
|
||||
@ -174,4 +182,4 @@ extension Dialogs on BuildContext {
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -32,6 +32,7 @@ class MyDrawer extends ConsumerWidget {
|
||||
children: [
|
||||
const Text(
|
||||
'Error. Trying again in 10 seconds',
|
||||
style: TextStyle(color:Color(0xFF898C81)),
|
||||
),
|
||||
12.verticalSpace,
|
||||
ElevatedButton(
|
||||
@ -40,7 +41,14 @@ class MyDrawer extends ConsumerWidget {
|
||||
authUseCaseProvider.notifier,
|
||||
)
|
||||
.logout,
|
||||
child: const Text('Logout'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Color(0xFFAA8E83), // Background color
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12), // Border radius
|
||||
),
|
||||
),
|
||||
child: const Text('Logout',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -283,4 +291,4 @@ enum DrawerItems {
|
||||
final String titleEN;
|
||||
final String titleAR;
|
||||
final String imgPath;
|
||||
}
|
||||
}
|
||||
@ -228,6 +228,7 @@ class LoginRoute extends HookConsumerWidget {
|
||||
.requestPwReset(email),
|
||||
);
|
||||
if (!context.mounted) return;
|
||||
|
||||
context.simpleDialog(
|
||||
title: context.translate(
|
||||
'Success!',
|
||||
@ -238,6 +239,7 @@ class LoginRoute extends HookConsumerWidget {
|
||||
'تم إرسال بريد إلكتروني إلى $email يتضمن المزيد من التفاصيل.',
|
||||
),
|
||||
);
|
||||
|
||||
},
|
||||
style: TextButton.styleFrom(
|
||||
padding: EdgeInsets.zero,
|
||||
@ -284,7 +286,7 @@ class LoginRoute extends HookConsumerWidget {
|
||||
if (error == LoginError.invalidEmailPw) {
|
||||
return context.simpleDialog(
|
||||
title: context.translate(
|
||||
'Incorrect credentials',
|
||||
'Incorrect Credentials',
|
||||
'أوراق غير صحيحة',
|
||||
),
|
||||
content: context.translate(
|
||||
@ -701,14 +703,29 @@ class LoginRoute extends HookConsumerWidget {
|
||||
title: Text( context.translate(
|
||||
'Exit App',
|
||||
'الخروج من التطبيق',
|
||||
),),
|
||||
),style: TextStyle(color: Color(0xFF898C81),fontWeight: FontWeight.w700),),
|
||||
content: Text( context.translate(
|
||||
'Are you sure you want to exit?',
|
||||
'هل أنت متأكد أنك تريد الخروج؟',
|
||||
),),
|
||||
),
|
||||
style: TextStyle(color:Color(0xFF898C81)),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(), // Close dialog
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: Color(0xFFAA8E83), // Background color
|
||||
// backgroundColor: Colors.white, // Font (text) color
|
||||
side: BorderSide(
|
||||
// color: Color(0xFF92722A)), // Border outline color
|
||||
color: Color(0xFFAA8E83)), // Border outline color
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(8), // Optional: Rounded corners
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16, vertical: 12), // Optional: Padding
|
||||
),
|
||||
child: Text( context.translate(
|
||||
'Cancel',
|
||||
'إلغاء',
|
||||
@ -716,6 +733,19 @@ class LoginRoute extends HookConsumerWidget {
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => SystemNavigator.pop(), // Exit the app
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: Color(0xFFAA8E83), // Background color
|
||||
foregroundColor: Colors.white, // Font (text) color
|
||||
side: BorderSide(
|
||||
// color: Color(0xFF92722A)), // Border outline color
|
||||
color: Color(0xFFAA8E83)), // Border outline color
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(8), // Optional: Rounded corners
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16, vertical: 12), // Optional: Padding
|
||||
),
|
||||
child: Text( context.translate(
|
||||
'Exit',
|
||||
'خروج',
|
||||
|
||||
@ -948,7 +948,8 @@ class _EditProfileState extends State<EditProfile> {
|
||||
AppLocalizations.of(context)!
|
||||
.change_password,
|
||||
style: TextStyle(
|
||||
color: Color(0xFF648CBA),
|
||||
// color: Color(0xFF648CBA),
|
||||
color: Color(0xFF985400),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontFamily: 'Roboto',
|
||||
@ -1133,4 +1134,4 @@ class ConfirmationDialog extends StatelessWidget {
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user