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;
|
double mywidth = MediaQuery.of(context).size.width;
|
||||||
|
|
||||||
return Padding(
|
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(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
height: 40,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(30.0),
|
borderRadius: BorderRadius.circular(30.0),
|
||||||
border: Border.all(width: 1, color: Color(0xFFAA8E83)),
|
border: Border.all(width: 1, color: Color(0xFFAA8E83)),
|
||||||
),
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(left: 12.0),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: "Search",
|
hintText: "Search",
|
||||||
|
hintStyle: TextStyle(color: Color(0xFF898C81)),
|
||||||
prefixIcon: Image.asset(
|
prefixIcon: Image.asset(
|
||||||
MiscIconAssetPath.search,
|
MiscIconAssetPath.search,
|
||||||
width: 20,
|
width: 15,
|
||||||
height: 20,
|
height: 10,
|
||||||
),
|
),
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
contentPadding:
|
contentPadding:
|
||||||
EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0),
|
EdgeInsets.symmetric(vertical: 8.0, horizontal: 18.0),
|
||||||
),
|
),
|
||||||
),
|
),),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: myheight / 35,
|
height: myheight / 40,
|
||||||
),
|
),
|
||||||
...homePageData.map<Widget>((mainTopic) {
|
...homePageData.map<Widget>((mainTopic) {
|
||||||
String colorPattern = mainTopic['color_pattern'];
|
String colorPattern = mainTopic['color_pattern'];
|
||||||
@ -144,7 +148,7 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
|||||||
},
|
},
|
||||||
title: mainTopic['main_topic'],
|
title: mainTopic['main_topic'],
|
||||||
titleBackgroundColor: backgroundColor,
|
titleBackgroundColor: backgroundColor,
|
||||||
children: _buildSubTopics(mainTopic['sub_topics'] ?? [], mywidth,
|
children: _buildSubTopics(mainTopic['sub_topics'] ?? [], mywidth,myheight,
|
||||||
borderColor, colorPattern, mainTopic['main_topic']),
|
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) {
|
Color borderColor, String colorPattern, mainTopic) {
|
||||||
print('colorPattern123 $borderColor');
|
print('colorPattern123 $borderColor');
|
||||||
// Sort sub-topics based on `sub_topic_list_order`
|
// 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
|
// Calculate width: full width for one item, half for two items
|
||||||
final cardWidth = rowItems.length == 1
|
final cardWidth = rowItems.length == 1
|
||||||
? myWidth
|
? myWidth
|
||||||
: (myWidth - 16) / 2; // Subtract spacing for padding
|
: (myWidth - 16) / 2.6; // Subtract spacing for padding
|
||||||
|
|
||||||
|
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@ -209,7 +214,7 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
|||||||
borderColor,
|
borderColor,
|
||||||
colorPattern,
|
colorPattern,
|
||||||
cardWidth,
|
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) {
|
Widget buildCategoryTitle(String title, Color color) {
|
||||||
return Padding(
|
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: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
title,
|
title,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.w600,
|
||||||
color: color,
|
color: color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -259,6 +265,7 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
|||||||
Color boldColor,
|
Color boldColor,
|
||||||
colorPattern,
|
colorPattern,
|
||||||
double mywidth,
|
double mywidth,
|
||||||
|
|
||||||
String mainTopic) {
|
String mainTopic) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@ -283,27 +290,30 @@ class _UaenumberWidgetState extends ConsumerState<uaenumberWidget> {
|
|||||||
color: Colors.white, // Background color
|
color: Colors.white, // Background color
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: bordercolor, // Border color
|
color: bordercolor, // Border color
|
||||||
width: 2, // Border width
|
width: 1, // Border width
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(12), // Optional: Rounded corners
|
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(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: robotoRegular11,
|
style: robotoRegular11,
|
||||||
),
|
),
|
||||||
SizedBox(height: 0.2),
|
|
||||||
|
|
||||||
|
SizedBox(height: 0.1),
|
||||||
Text(subtitle, textAlign: TextAlign.center, style: subtitleStyle),
|
Text(subtitle, textAlign: TextAlign.center, style: subtitleStyle),
|
||||||
SizedBox(height: 0.7),
|
SizedBox(height: 0.3),
|
||||||
Text(
|
Text(
|
||||||
value,
|
value,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24,
|
fontSize: 20,
|
||||||
color: boldColor,
|
color: boldColor,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@ -355,12 +365,17 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
|
|||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () => widget.onTap(widget.index),
|
onTap: () => widget.onTap(widget.index),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white, // Ensuring the background outside the rounded container is white
|
||||||
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: widget.titleBackgroundColor,
|
color: widget.titleBackgroundColor,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(35))),
|
borderRadius: BorderRadius.all(Radius.circular(35))
|
||||||
|
),
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
left: 16, bottom: 10, top: 10, right: 10),
|
left: 16, bottom: 5, top: 5, right: 10),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -368,8 +383,8 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
|
|||||||
widget.title,
|
widget.title,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.w600,
|
||||||
fontSize: 18,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Icon(
|
Icon(
|
||||||
@ -382,6 +397,7 @@ class _CustomExpandableTileState extends State<CustomExpandableTile> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
child: AnimatedContainer(
|
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:pocketbase/pocketbase.dart';
|
||||||
import 'package:uae_stat/config/my_router.dart';
|
import 'package:uae_stat/config/my_router.dart';
|
||||||
import 'package:uae_stat/domain/use_cases/language.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/Screens/profilepage.dart';
|
||||||
import 'package:uae_stat/presentation/components/space.dart';
|
import 'package:uae_stat/presentation/components/space.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
@ -209,7 +210,7 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
|||||||
children: [
|
children: [
|
||||||
// SizedBox(height: screenHeight / 7),
|
// SizedBox(height: screenHeight / 7),
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.topRight,
|
alignment: Alignment.topLeft,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|
||||||
@ -222,52 +223,134 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
|||||||
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.only(top: 16,left: 16,bottom: 16,right: 1), // Add margin for positioning
|
margin: EdgeInsets.only(top: 10,left: 1,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,
|
|
||||||
),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.close,
|
// Icons.close,
|
||||||
size: 20, // Icon size
|
Icons.arrow_back_ios,
|
||||||
color: Colors.white, // Icon color
|
size: 28, // Icon size
|
||||||
|
color: Colors.black, // Icon color
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: screenHeight / 6),
|
SizedBox(height: screenHeight / 30),
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
// "Create New Password",
|
// "Create New Password",
|
||||||
AppLocalizations.of(context)!.create_new_password,
|
AppLocalizations.of(context)!.create_new_password,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24,
|
fontSize: 26,
|
||||||
fontWeight: FontWeight.bold,
|
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(
|
TextFormField(
|
||||||
obscureText: _obscureOldPassword,
|
obscureText: _obscureOldPassword,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
// hintText: 'Enter old password',
|
// hintText: 'Enter old password',
|
||||||
hintText: AppLocalizations.of(context)!.old_password,
|
hintText: AppLocalizations.of(context)!.old_password,
|
||||||
prefixIcon: Icon(Icons.lock, color: Colors.blue),
|
// prefixIcon: Icon(Icons.lock, color: Colors.blue),
|
||||||
suffixIcon: IconButton(
|
hintStyle: TextStyle(
|
||||||
icon: Icon(
|
color: Color(0xFFC3C6CB),
|
||||||
_obscureOldPassword
|
fontWeight: FontWeight.w400,
|
||||||
? Icons.visibility_off
|
fontFamily: 'Roboto'
|
||||||
: Icons.visibility,
|
),
|
||||||
color: Colors.blue,
|
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: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_obscureOldPassword = !_obscureOldPassword;
|
_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,
|
validator: _validateOldPassword,
|
||||||
onChanged: (value) => _oldPassword = value,
|
onChanged: (value) => _oldPassword = value,
|
||||||
@ -278,21 +361,93 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
// hintText: 'Enter new password',
|
// hintText: 'Enter new password',
|
||||||
hintText: AppLocalizations.of(context)!.enter_new_password,
|
hintText: AppLocalizations.of(context)!.enter_new_password,
|
||||||
prefixIcon: Icon(Icons.lock, color: Colors.blue),
|
// prefixIcon: Icon(Icons.lock, color: Colors.blue),
|
||||||
suffixIcon: IconButton(
|
hintStyle: TextStyle(
|
||||||
icon: Icon(
|
color: Color(0xFFC3C6CB),
|
||||||
_obscureNewPassword
|
fontWeight: FontWeight.w400,
|
||||||
? Icons.visibility_off
|
fontFamily: 'Roboto'
|
||||||
: Icons.visibility,
|
),
|
||||||
color: Colors.blue,
|
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: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_obscureNewPassword = !_obscureNewPassword;
|
_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,
|
validator: _validateNewPassword,
|
||||||
),
|
),
|
||||||
@ -302,13 +457,51 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
// hintText: 'Confirm new password',
|
// hintText: 'Confirm new password',
|
||||||
hintText: AppLocalizations.of(context)!.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(
|
suffixIcon: IconButton(
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
_obscureConfirmPassword
|
// _obscureConfirmPassword
|
||||||
? Icons.visibility_off
|
// ? Icons.visibility_off
|
||||||
: Icons.visibility,
|
// : Icons.visibility,
|
||||||
color: Colors.blue,
|
// 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: () {
|
onPressed: () {
|
||||||
setState(() {
|
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,
|
validator: _validateConfirmPassword,
|
||||||
),
|
),
|
||||||
@ -360,7 +585,7 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
|||||||
SizedBox(height: screenHeight / 5),
|
SizedBox(height: screenHeight / 5),
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: screenHeight / 12,
|
height: screenHeight / 16,
|
||||||
width: screenWidth / 2.5,
|
width: screenWidth / 2.5,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
@ -443,11 +668,11 @@ class _CreateNewPwState extends State<CreateNewPw> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: screenHeight / 5),
|
SizedBox(height: screenHeight / 12),
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: screenHeight / 8,
|
height: screenHeight / 1,
|
||||||
width: screenWidth / 2,
|
width: screenWidth / 2.5,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/splash_screen/logo.png"),
|
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(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: screenheight / 8),
|
SizedBox(height: screenheight / 4),
|
||||||
buildIconContainer(
|
buildIconContainer(
|
||||||
Icons.report, Color(0xFF7DAFBC)),
|
Icons.report, Color(0xFF7DAFBC)),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
@ -409,11 +409,20 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
|||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () => {context.go('/')},
|
onPressed: () => {context.go('/')},
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Color(0xFFAA8E83), // Background color
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12), // Border radius
|
||||||
|
),
|
||||||
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
context.translate(
|
context.translate('Go to Login', 'اذهب إلى تسجيل الدخول'),
|
||||||
'Go to Login', 'اذهب إلى تسجيل الدخول'),
|
style: TextStyle(
|
||||||
|
color: Colors.white, // Text color
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
SizedBox(height: screenheight / 5),
|
SizedBox(height: screenheight / 5),
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -1197,4 +1206,4 @@ class _RegisterScreenState extends ConsumerState<RegisterScreen> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -218,8 +218,43 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
initialDate: initialDate,
|
initialDate: initialDate,
|
||||||
firstDate: firstDate,
|
firstDate: firstDate,
|
||||||
lastDate: lastDate,
|
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) {
|
if (pickedDate != null && pickedDate != _selectedDate) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_selectedDate = pickedDate;
|
_selectedDate = pickedDate;
|
||||||
@ -356,30 +391,55 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
'Logout',
|
'Logout',
|
||||||
'تسجيل الخروج',
|
'تسجيل الخروج',
|
||||||
),
|
),
|
||||||
|
style: TextStyle(color: Color(0xFF898C81),fontWeight: FontWeight.w700),
|
||||||
),
|
),
|
||||||
content: Text(
|
content: Text(
|
||||||
context.translate(
|
context.translate(
|
||||||
'Are you sure you want to logout?',
|
'Are you sure you want to logout?',
|
||||||
'هل أنت متأكد أنك تريد تسجيل الخروج؟',
|
'هل أنت متأكد أنك تريد تسجيل الخروج؟',
|
||||||
),
|
),
|
||||||
|
style: TextStyle(color:Color(0xFF898C81)),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.of(context).pop(), // Close dialog
|
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(
|
child: Text(
|
||||||
context.translate(
|
context.translate(
|
||||||
'Cancel',
|
'Cancel',
|
||||||
'إلغاء',
|
'إلغاء',
|
||||||
),
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
color: Color(0xFFAA8E83), // Text color
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => logout(context), // Exit the app
|
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(
|
child: Text(
|
||||||
context.translate(
|
context.translate(
|
||||||
'Logout',
|
'Logout',
|
||||||
'تسجيل الخروج',
|
'تسجيل الخروج',
|
||||||
),
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white, // Text color
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -409,438 +469,442 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
AppLocalizations.of(context)!.my_profile,
|
AppLocalizations.of(context)!.my_profile,
|
||||||
style: TextStyle(color: Color(0xFF985400)),
|
style: TextStyle(color: Color(0xFF985400)),
|
||||||
),
|
),
|
||||||
actions: [
|
// actions: [
|
||||||
TextButton(
|
// TextButton(
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
context.go('/');
|
// context.go('/');
|
||||||
},
|
// },
|
||||||
child: Text(
|
// child: Text(
|
||||||
'Logout',
|
// 'Logout',
|
||||||
style: TextStyle(color: Colors.orange),
|
// style: TextStyle(color: Colors.orange),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
IconButton(
|
// IconButton(
|
||||||
icon: Icon(Icons.logout, color: Colors.black),
|
// icon: Icon(Icons.logout, color: Colors.black),
|
||||||
onPressed: () {},
|
// onPressed: () {},
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Form(
|
child: Container(
|
||||||
key: _formKey,
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Form(
|
||||||
padding: const EdgeInsets.only(
|
key: _formKey,
|
||||||
top: 20.0, bottom: 20.0, left: 25, right: 25),
|
child: Padding(
|
||||||
child: Column(
|
padding: const EdgeInsets.only(
|
||||||
children: [
|
top: 20.0, bottom: 20.0, left: 25, right: 25),
|
||||||
// CircleAvatar(
|
child: Column(
|
||||||
// radius: 50,
|
children: [
|
||||||
// backgroundImage: _profileImage != null
|
// CircleAvatar(
|
||||||
// ? FileImage(_profileImage!)
|
// radius: 50,
|
||||||
// : AssetImage("assets/edit_profile/profile.png")
|
// backgroundImage: _profileImage != null
|
||||||
// as ImageProvider,
|
// ? FileImage(_profileImage!)
|
||||||
// child: Align(
|
// : AssetImage("assets/edit_profile/profile.png")
|
||||||
// alignment: Alignment.bottomRight,
|
// as ImageProvider,
|
||||||
// child: GestureDetector(
|
// child: Align(
|
||||||
// onTap: _pickImage, // Call `_pickImage` on tap
|
// alignment: Alignment.bottomRight,
|
||||||
// child: CircleAvatar(
|
// child: GestureDetector(
|
||||||
// radius: 15,
|
// onTap: _pickImage, // Call `_pickImage` on tap
|
||||||
// backgroundColor: Colors.white,
|
// child: CircleAvatar(
|
||||||
// child: Icon(
|
// radius: 15,
|
||||||
// Icons.camera_alt,
|
// backgroundColor: Colors.white,
|
||||||
// size: 15,
|
// child: Icon(
|
||||||
// color: Colors.grey,
|
// Icons.camera_alt,
|
||||||
// ),
|
// size: 15,
|
||||||
// ),
|
// color: Colors.grey,
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
|
||||||
Stack(
|
Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
// CircleAvatar with the profile image
|
// CircleAvatar with the profile image
|
||||||
CircleAvatar(
|
CircleAvatar(
|
||||||
radius: 50,
|
radius: 50,
|
||||||
backgroundImage: _profileImage != null
|
backgroundImage: _profileImage != null
|
||||||
? FileImage(_profileImage!)
|
? FileImage(_profileImage!)
|
||||||
: AssetImage("assets/edit_profile/profile.png")
|
: AssetImage("assets/edit_profile/profile.png")
|
||||||
as ImageProvider,
|
as ImageProvider,
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.bottomRight,
|
alignment: Alignment.bottomRight,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: _pickImage, // Call `_pickImage` on tap
|
onTap: _pickImage, // Call `_pickImage` on tap
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
radius: 15,
|
radius: 15,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.camera_alt,
|
Icons.camera_alt,
|
||||||
size: 15,
|
size: 15,
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
// Conditional loader that shows when _isLoading is true
|
// Conditional loader that shows when _isLoading is true
|
||||||
if (_isLoading)
|
if (_isLoading)
|
||||||
Positioned(
|
Positioned(
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
valueColor:
|
valueColor:
|
||||||
AlwaysStoppedAnimation<Color>(Colors.grey),
|
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,
|
|
||||||
),
|
),
|
||||||
Text.rich(
|
),
|
||||||
TextSpan(
|
],
|
||||||
text: AppLocalizations.of(context)!.agree,
|
),
|
||||||
style: TextStyle(color: Color(0xFF898C81)),
|
|
||||||
children: [
|
SizedBox(height: 20),
|
||||||
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)
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Text(
|
||||||
padding: const EdgeInsets.only(left: 10.0),
|
AppLocalizations.of(context)!.register_name,
|
||||||
child: Text(
|
style: TextStyle(
|
||||||
'Please agree to terms and conditions',
|
fontSize: 16,
|
||||||
style: TextStyle(
|
fontWeight: FontWeight.w500,
|
||||||
color: Color(0xFFb22222),
|
color: Colors.grey),
|
||||||
fontSize: 12,
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
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),
|
if (showError)
|
||||||
Center(
|
Row(
|
||||||
child: GestureDetector(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
onTap: () {
|
children: [
|
||||||
final userId = widget.userId;
|
Padding(
|
||||||
final email = _emailController.text;
|
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(
|
style: ElevatedButton.styleFrom(
|
||||||
AppLocalizations.of(context)!.change_password,
|
backgroundColor: Color(0xFF92722A),
|
||||||
style: TextStyle(
|
minimumSize: Size(double.infinity, 50),
|
||||||
color: Color(0xFF648CBA),
|
shape: RoundedRectangleBorder(
|
||||||
fontSize: 14,
|
borderRadius: BorderRadius.circular(8),
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
fontFamily: 'Roboto',
|
|
||||||
// decoration: TextDecoration.underline),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
child: Row(
|
||||||
),
|
mainAxisAlignment:
|
||||||
SizedBox(height: 20),
|
MainAxisAlignment.center, // Center the content
|
||||||
// ElevatedButton.icon(
|
children: [
|
||||||
ElevatedButton(
|
Text(
|
||||||
onPressed: () {
|
AppLocalizations.of(context)!.save,
|
||||||
if ((_formKey.currentState?.validate() ?? false) &&
|
style: TextStyle(color: Colors.white),
|
||||||
(isChecked)) {
|
),
|
||||||
_formKey.currentState?.save();
|
SizedBox(width: 8), // Add space between text and icon
|
||||||
showConfirmationDialog(context);
|
Image.asset(
|
||||||
} else {
|
MiscIconAssetPath.save,
|
||||||
setState(() {
|
color: Colors.white,
|
||||||
showError =
|
width: 20,
|
||||||
!isChecked; // Show error if the checkbox is not checked
|
height: 20,
|
||||||
});
|
),
|
||||||
}
|
],
|
||||||
},
|
|
||||||
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,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -952,4 +1016,4 @@ class ConfirmationDialog extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,12 +99,19 @@ extension Dialogs on BuildContext {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
final contentText = Text(content);
|
final contentText = Text(content);
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text(title),
|
title: Text(title,
|
||||||
|
style: TextStyle(color: Color(0xFF898C81),fontWeight: FontWeight.w700),),
|
||||||
content: content.length > 300
|
content: content.length > 300
|
||||||
? SingleChildScrollView(
|
? SingleChildScrollView(
|
||||||
child: contentText,
|
child:Text(
|
||||||
|
content,
|
||||||
|
style: TextStyle(color: Color(0xFF898C81))
|
||||||
|
),
|
||||||
)
|
)
|
||||||
: contentText,
|
: Text(
|
||||||
|
content,
|
||||||
|
style: TextStyle(color:Color(0xFF898C81)), // Set content text color
|
||||||
|
),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: Navigator.of(
|
onPressed: Navigator.of(
|
||||||
@ -112,10 +119,11 @@ extension Dialogs on BuildContext {
|
|||||||
rootNavigator: true,
|
rootNavigator: true,
|
||||||
).pop,
|
).pop,
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
// backgroundColor: Colors.white, // Background color
|
backgroundColor: Color(0xFFAA8E83), // Background color
|
||||||
foregroundColor: Color(0xFF92722A), // Font (text) color
|
foregroundColor: Colors.white, // Font (text) color
|
||||||
side: BorderSide(
|
side: BorderSide(
|
||||||
color: Color(0xFF92722A)), // Border outline color
|
// color: Color(0xFF92722A)), // Border outline color
|
||||||
|
color: Color(0xFFAA8E83)), // Border outline color
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(8), // Optional: Rounded corners
|
BorderRadius.circular(8), // Optional: Rounded corners
|
||||||
@ -174,4 +182,4 @@ extension Dialogs on BuildContext {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -32,6 +32,7 @@ class MyDrawer extends ConsumerWidget {
|
|||||||
children: [
|
children: [
|
||||||
const Text(
|
const Text(
|
||||||
'Error. Trying again in 10 seconds',
|
'Error. Trying again in 10 seconds',
|
||||||
|
style: TextStyle(color:Color(0xFF898C81)),
|
||||||
),
|
),
|
||||||
12.verticalSpace,
|
12.verticalSpace,
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
@ -40,7 +41,14 @@ class MyDrawer extends ConsumerWidget {
|
|||||||
authUseCaseProvider.notifier,
|
authUseCaseProvider.notifier,
|
||||||
)
|
)
|
||||||
.logout,
|
.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 titleEN;
|
||||||
final String titleAR;
|
final String titleAR;
|
||||||
final String imgPath;
|
final String imgPath;
|
||||||
}
|
}
|
||||||
@ -228,6 +228,7 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
.requestPwReset(email),
|
.requestPwReset(email),
|
||||||
);
|
);
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
|
|
||||||
context.simpleDialog(
|
context.simpleDialog(
|
||||||
title: context.translate(
|
title: context.translate(
|
||||||
'Success!',
|
'Success!',
|
||||||
@ -238,6 +239,7 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
'تم إرسال بريد إلكتروني إلى $email يتضمن المزيد من التفاصيل.',
|
'تم إرسال بريد إلكتروني إلى $email يتضمن المزيد من التفاصيل.',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
},
|
},
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
@ -284,7 +286,7 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
if (error == LoginError.invalidEmailPw) {
|
if (error == LoginError.invalidEmailPw) {
|
||||||
return context.simpleDialog(
|
return context.simpleDialog(
|
||||||
title: context.translate(
|
title: context.translate(
|
||||||
'Incorrect credentials',
|
'Incorrect Credentials',
|
||||||
'أوراق غير صحيحة',
|
'أوراق غير صحيحة',
|
||||||
),
|
),
|
||||||
content: context.translate(
|
content: context.translate(
|
||||||
@ -701,14 +703,29 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
title: Text( context.translate(
|
title: Text( context.translate(
|
||||||
'Exit App',
|
'Exit App',
|
||||||
'الخروج من التطبيق',
|
'الخروج من التطبيق',
|
||||||
),),
|
),style: TextStyle(color: Color(0xFF898C81),fontWeight: FontWeight.w700),),
|
||||||
content: Text( context.translate(
|
content: Text( context.translate(
|
||||||
'Are you sure you want to exit?',
|
'Are you sure you want to exit?',
|
||||||
'هل أنت متأكد أنك تريد الخروج؟',
|
'هل أنت متأكد أنك تريد الخروج؟',
|
||||||
),),
|
),
|
||||||
|
style: TextStyle(color:Color(0xFF898C81)),
|
||||||
|
),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.of(context).pop(), // Close dialog
|
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(
|
child: Text( context.translate(
|
||||||
'Cancel',
|
'Cancel',
|
||||||
'إلغاء',
|
'إلغاء',
|
||||||
@ -716,6 +733,19 @@ class LoginRoute extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => SystemNavigator.pop(), // Exit the app
|
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(
|
child: Text( context.translate(
|
||||||
'Exit',
|
'Exit',
|
||||||
'خروج',
|
'خروج',
|
||||||
|
|||||||
@ -948,7 +948,8 @@ class _EditProfileState extends State<EditProfile> {
|
|||||||
AppLocalizations.of(context)!
|
AppLocalizations.of(context)!
|
||||||
.change_password,
|
.change_password,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xFF648CBA),
|
// color: Color(0xFF648CBA),
|
||||||
|
color: Color(0xFF985400),
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
fontFamily: 'Roboto',
|
fontFamily: 'Roboto',
|
||||||
@ -1133,4 +1134,4 @@ class ConfirmationDialog extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user