diff --git a/assets/icons/uae_numbers/share.svg b/assets/icons/uae_numbers/share.svg
new file mode 100644
index 00000000..cb440dcd
--- /dev/null
+++ b/assets/icons/uae_numbers/share.svg
@@ -0,0 +1,3 @@
+
diff --git a/lib/infrastructure/services/img_asset_paths/icons/uae_numbers_asset_path.dart b/lib/infrastructure/services/img_asset_paths/icons/uae_numbers_asset_path.dart
index db2e65cd..167127df 100644
--- a/lib/infrastructure/services/img_asset_paths/icons/uae_numbers_asset_path.dart
+++ b/lib/infrastructure/services/img_asset_paths/icons/uae_numbers_asset_path.dart
@@ -2,8 +2,9 @@ import 'package:flutter/material.dart';
abstract class UaeNumbersAssetPath {
static const _basePath = 'assets/icons/uae_numbers';
- static const bookmarksUae = '$_basePath/bookmarks.png';
- static const bookmarksSelectedUae = '$_basePath/bookmarksSelectedUae.png';
- static const shareUae = '$_basePath/share.png';
+ // static const bookmarksUae = '$_basePath/bookmarks.png';
+ // static const bookmarksSelectedUae = '$_basePath/bookmarksSelectedUae.png';
+ // static const shareUae = '$_basePath/share.png';
+ static const share = '$_basePath/share.svg';
static const filterUae = '$_basePath/filters.png';
}
diff --git a/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/uae_numbers.dart b/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/uae_numbers.dart
index 5dd763ad..b09a6223 100644
--- a/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/uae_numbers.dart
+++ b/lib/presentation/Screens/Bottom Navigation Pages/UAE_Numbers/uae_numbers.dart
@@ -288,7 +288,7 @@ class _UaenumberWidgetState extends ConsumerState {
final encodedTitle = Uri.encodeComponent(title);
// Pass mainTopic and title as query parameters
- context.go(
+ context.push(
'/chartScreen/$data_set?bgColor=$colorPattern&mainTopic=$encodedMainTopic&title=$encodedTitle');
// context.go('/chartScreen/$data_set');
},
diff --git a/lib/presentation/Screens/auth_verification/create_new_pw.dart b/lib/presentation/Screens/auth_verification/create_new_pw.dart
index 0bcd7b7d..47b1c34e 100644
--- a/lib/presentation/Screens/auth_verification/create_new_pw.dart
+++ b/lib/presentation/Screens/auth_verification/create_new_pw.dart
@@ -14,7 +14,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../../../config/my_theme.dart';
-class CreateNewPw extends StatefulWidget {
+class CreateNewPw extends ConsumerStatefulWidget {
final String userId;
final String email;
final String? keyParam;
@@ -22,10 +22,10 @@ class CreateNewPw extends StatefulWidget {
const CreateNewPw({Key? key, required this.userId, required this.email, required this.keyParam});
@override
- State createState() => _CreateNewPwState();
+ ConsumerState createState() => _CreateNewPwState();
}
-class _CreateNewPwState extends State {
+class _CreateNewPwState extends ConsumerState {
final _pb = PocketBase('https://pb.venbait.in');
final _formKey = GlobalKey();
bool _obscureOldPassword = true;
@@ -191,6 +191,7 @@ class _CreateNewPwState extends State {
Widget build(BuildContext context) {
double screenHeight = MediaQuery.of(context).size.height;
double screenWidth = MediaQuery.of(context).size.width;
+ final passwordLocale = ref.watch(localeProvider);
return Scaffold(
backgroundColor: Colors.white,
@@ -198,13 +199,14 @@ class _CreateNewPwState extends State {
child: SafeArea(
child: _isPasswordUpdated
? _buildSuccessContent(screenHeight, screenWidth)
- : _buildPasswordForm(screenHeight, screenWidth),
+ : _buildPasswordForm(ref,screenHeight, screenWidth),
),
),
);
}
- Widget _buildPasswordForm(double screenHeight, double screenWidth) {
+ Widget _buildPasswordForm(WidgetRef ref ,double screenHeight, double screenWidth) {
+ final passwordLocale = ref.watch(localeProvider);
return Form(
key: _formKey,
child: Padding(
@@ -231,7 +233,7 @@ class _CreateNewPwState extends State {
child: Icon(
// Icons.close,
Icons.arrow_back_ios,
- size: 28, // Icon size
+ size: 24, // Icon size
color: Colors.black, // Icon color
),
),
@@ -259,7 +261,10 @@ class _CreateNewPwState extends State {
// "Create New Password",
AppLocalizations.of(context)!.create_new_password,
style: TextStyle(
- fontSize: 26,
+ fontSize: passwordLocale?.languageCode ==
+ 'ar'
+ ? 24
+ :26,
fontWeight: FontWeight.w300,
),
),
@@ -269,12 +274,18 @@ class _CreateNewPwState extends State {
TextSpan(
children: [
TextSpan(
- text: 'Your New Password Must Be Different\n',
- style: TextStyle(fontSize: 15,fontWeight: FontWeight.w700, color: Color(0xFF898C81)),
+ text: context.translate('Your New Password Must Be Different\n','يجب أن تكون كلمة المرور الجديدة مختلفة\n',),
+ style: TextStyle(fontSize: passwordLocale?.languageCode ==
+ 'ar'
+ ? 14
+ :15,fontWeight: FontWeight.w700, color: Color(0xFF898C81)),
),
TextSpan(
- text: 'from Previously Used Password',
- style: TextStyle(fontSize: 15, color: Color(0xFF898C81), fontWeight: FontWeight.w700),
+ text: context.translate('from Previously Used Password','عن كلمة المرور المستخدمة سابقًا'),
+ style: TextStyle(fontSize: passwordLocale?.languageCode ==
+ 'ar'
+ ? 14
+ :15, color: Color(0xFF898C81), fontWeight: FontWeight.w700),
),
],
),
@@ -590,7 +601,10 @@ class _CreateNewPwState extends State {
children: [
Text(
AppLocalizations.of(context)!.save,
- style: TextStyle(fontSize: 18, color: Colors.white),
+ style: TextStyle(fontSize: passwordLocale?.languageCode ==
+ 'ar'
+ ? 14
+ :18, color: Colors.white),
),
SizedBox(width: 2),
Icon(
diff --git a/lib/presentation/Screens/auth_verification/privacy_policy.dart b/lib/presentation/Screens/auth_verification/privacy_policy.dart
index c259e21a..cb4cdc60 100644
--- a/lib/presentation/Screens/auth_verification/privacy_policy.dart
+++ b/lib/presentation/Screens/auth_verification/privacy_policy.dart
@@ -17,6 +17,7 @@ class PrivacyPolicy extends StatelessWidget {
),
child: Scaffold(
appBar: AppBar(
+ scrolledUnderElevation: 0,
title:Text(context.translate(
'Privacy Policy',
'الشروط والأحكام',
diff --git a/lib/presentation/Screens/auth_verification/registration.dart b/lib/presentation/Screens/auth_verification/registration.dart
index d6384345..232e774f 100644
--- a/lib/presentation/Screens/auth_verification/registration.dart
+++ b/lib/presentation/Screens/auth_verification/registration.dart
@@ -118,7 +118,7 @@ class _RegisterScreenState extends ConsumerState {
String? _validateUsername(String? value) {
if (value == null || value.isEmpty) {
- return 'Required';
+ return context.translate('Required', 'مطلوب');
} else if (value.length > 40) {
return 'Must not exceed 40 characters';
} else if (!RegExp(r"^[a-zA-Z0-9'\-\u0627\u0639~\u00C0-\u00FF]+$")
@@ -136,7 +136,7 @@ class _RegisterScreenState extends ConsumerState {
r'^[a-zA-Z0-9àèìòùÀÈÌÒÙéàç~!#$%^&*()_+=-{}|;,.?<>]+@[a-zA-Z0-9àèìòùÀÈÌÒÙéàç~!#$%^&*()_+=-{}|;,.?<>]+\.[a-zA-Z]{2,}$';
if (value == null || value.isEmpty) {
- return 'Required';
+ return context.translate('Required', 'مطلوب');
} else if (!RegExp(emailRegex).hasMatch(value)) {
return 'Invalid Email';
}
@@ -155,7 +155,7 @@ class _RegisterScreenState extends ConsumerState {
final hasSpecialCharacter = RegExp(r'[~!@#$%^&*()_+=[\]{}|;:,.<>?/-]');
if (value == null || value.isEmpty) {
- return 'Required';
+ return context.translate('Required', 'مطلوب');
} else if (value.length < 8) {
return 'Password must be at least 8characters';
}
@@ -201,7 +201,7 @@ class _RegisterScreenState extends ConsumerState {
r'^[A-Za-z0-9~!@#$%^&*()_+=[\]{}|;:,.<>?/-àèìòùáéíóúÀÈÌÒÙÁÉÍÓÚ]*$');
if (value == null || value.isEmpty) {
- return 'Required';
+ return context.translate('Required', 'مطلوب');
} else if (value.length < 8 || value.length > 40) {
return 'Password must be at least 8characters';
} else if (!regex.hasMatch(value)) {
@@ -359,895 +359,896 @@ class _RegisterScreenState extends ConsumerState {
child: SafeArea(
child: Scaffold(
backgroundColor: Colors.white,
- body: Column(
- children: [
- Align(
- alignment: AlignmentDirectional.topEnd,
- child: Padding(
- padding: EdgeInsets.only(top: 16.0, right :16.0),
- child: Consumer(
- builder: (context, ref, _) {
- final locale = ref.watch(localeProvider); // Current locale
- return MyToggle(
- isOn: locale?.languageCode == 'en',
- knobTextWhenOn: 'ع',
- knobTextWhenOff: 'EN',
- pathColorWhenOn: Colors.grey.shade300,
- pathColorWhenOff: Colors.grey.shade300,
- onTap: () {
- ref.read(localeProvider.notifier).toggleLocale();
- },
- );
- },
+ body: SingleChildScrollView(
+ child: Column(
+ children: [
+ Align(
+ alignment: AlignmentDirectional.topEnd,
+ child: Padding(
+ padding: EdgeInsets.only(top: 16.0, right :16.0),
+ child: Consumer(
+ builder: (context, ref, _) {
+ final locale = ref.watch(localeProvider); // Current locale
+ return MyToggle(
+ isOn: locale?.languageCode == 'en',
+ knobTextWhenOn: 'ع',
+ knobTextWhenOff: 'EN',
+ pathColorWhenOn: Colors.grey.shade300,
+ pathColorWhenOff: Colors.grey.shade300,
+ onTap: () {
+ ref.read(localeProvider.notifier).toggleLocale();
+ },
+ );
+ },
+ ),
),
),
- ),
- Container(
- height: MediaQuery.of(context).size.height / 1.2,
- child: SingleChildScrollView(
- child: Column(children: [
- registrationSuccess
- ? Padding(
- padding: const EdgeInsets.all(20.0),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- SizedBox(height: screenheight / 4),
- buildIconContainer(
- Icons.report, Color(0xFF7DAFBC)),
- SizedBox(height: 20),
- Text(
- context.translate(
- 'Your registration is pending for verification.',
- 'تسجيلك في انتظار التحقق.'),
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w500,
- color: Color(0xFF414042)),
- ),
- SizedBox(height: 10),
- Text(
- context.translate(
- 'Kindly verify your mail to proceed further.',
- 'يرجى التحقق من البريد الخاص بك للمضي قدما.'),
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: 14,
- color: Color(0xFF898C81),
- ),
- ),
- SizedBox(height: 10),
- ElevatedButton(
- onPressed: () => {context.go('/login')},
- style: ElevatedButton.styleFrom(
- backgroundColor: Color(0xFFAA8E83), // Background color
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(12), // Border radius
- ),
- ),
- child: Text(
- context.translate('Go to Login', 'اذهب إلى تسجيل الدخول'),
- style: TextStyle(
- color: Colors.white, // Text color
- ),
- ),
- ),
-
- SizedBox(height: screenheight / 5),
- Center(
- child: Container(
- height: screenheight / 16,
- width: screenwidth / 2.5,
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage(
- "assets/splash_screen/logo.png"), // Background image asset
- fit: BoxFit.fill,
- ),
- ),
- ))
- ],
+ Column(children: [
+ registrationSuccess
+ ? Padding(
+ padding: const EdgeInsets.all(20.0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SizedBox(height: screenheight / 4),
+ buildIconContainer(
+ Icons.report, Color(0xFF7DAFBC)),
+ SizedBox(height: 20),
+ Text(
+ context.translate(
+ 'Your registration is pending for verification.',
+ 'تسجيلك في انتظار التحقق.'),
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: 16,
+ fontWeight: FontWeight.w500,
+ color: Color(0xFF414042)),
+ ),
+ SizedBox(height: 10),
+ Text(
+ context.translate(
+ 'Kindly verify your mail to proceed further.',
+ 'يرجى التحقق من البريد الخاص بك للمضي قدما.'),
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: 14,
+ color: Color(0xFF898C81),
+ ),
+ ),
+ SizedBox(height: 10),
+ ElevatedButton(
+ onPressed: () => {context.go('/login')},
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Color(0xFFAA8E83), // Background color
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12), // Border radius
),
- )
- : registrationFailed
- ? Padding(
- padding: const EdgeInsets.all(20.0),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- SizedBox(height: screenheight / 8),
- buildIconContainer(Icons.report, Colors.red),
- SizedBox(height: 20),
- Text(
- context.translate(
- 'Sorry ${_usernameController.text}!',
- 'آسف ${_usernameController.text}!'),
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w500,
- color: Color(0xFF414042)),
- ),
- SizedBox(height: 10),
- Text(
- context.translate(
- 'Your registration process failed. For further assistance, please contact support.',
- 'فشلت عملية التسجيل الخاصة بك. لمزيد من المساعدة، يرجى الاتصال بالدعم.'),
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: 14,
- color: Color(0xFF898C81),
- ),
- ),
- SizedBox(height: 10),
- ElevatedButton(
- onPressed: () => {
- setState(() {
- registrationFailed = false;
- registrationSuccess = false;
- _usernameController.clear();
- _emailController.clear();
- _passwordController.clear();
- _confirmpasswordController.clear();
- isChecked = false;
- })
- },
- child: Text(
- context.translate(
- 'Retry', 'أعد المحاولة'),
- ),
- ),
- SizedBox(height: screenheight / 5),
- Center(
- child: Container(
- height: screenheight / 16,
- width: screenwidth / 2.5,
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage(
- "assets/splash_screen/logo.png"), // Background image asset
- fit: BoxFit.fill,
- ),
- ),
- ))
- ],
- ),
- )
- : Form(
- key: _formKey,
- child: SingleChildScrollView(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- SizedBox(height: screenheight / 60),
- Text(
- // 'Register',
- AppLocalizations.of(context)!
- .register_title,
- style: TextStyle(
- fontSize: 32,
- fontWeight: FontWeight.w400),
- ),
- SizedBox(height: 10),
- Text(AppLocalizations.of(context)!
- .register_details,
- style: TextStyle(
- fontSize: context.translate(18.0, 14.0),
- color: const Color(0xff898C81),
- fontWeight: FontWeight.w600,
- ),
- ),
-
- SizedBox(height: 20),
- // Display this if registration is pending approval
- Padding(
- padding: const EdgeInsets.only(
- top: 5.0,
- bottom: 10,
- left: 30,
- right: 30),
- child: TextFormField(
- controller: _usernameController,
- // focusNode: _focusNodes[0],
- decoration: InputDecoration(
- // hintText: _showHints[0] ? 'Username' : null,
- hintText: _showHints[0]
- ? AppLocalizations.of(context)!
- .register_name
- : null,
- 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.person,
- fit: BoxFit.fitHeight,
- height: 25,
- width: 25,
- color: MyTheme.topicColor(
- IndicatorTopic.economy)
- .shade300,
- ),
- ),
-
- // prefixIcon: Icon(
- // Icons.person,
- // color: Color(0xFF90B0D5),
- //
- // ),
- // border: OutlineInputBorder(),
- enabledBorder: OutlineInputBorder(
- borderRadius:
- BorderRadius.circular(10),
- borderSide: BorderSide(
- color: MyTheme.topicColor(
- IndicatorTopic.economy)
- .shade400,
- width: 1), // Enabled border
- ),
- 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
- ),
- counterText: '',
- hintStyle: TextStyle(
- color: Color(0xFFC3C6CB),
- fontSize:
- registerLocale?.languageCode ==
- 'ar'
- ? 14
- : 16,
- ),
- ),
- validator: _validateUsername,
- maxLength:
- 40, // Set the maximum length to 20 characters
- maxLengthEnforcement:
- MaxLengthEnforcement.enforced,
- ),
- ),
- SizedBox(height: 15),
- Padding(
- padding: const EdgeInsets.only(
- top: 5.0,
- bottom: 10,
- left: 30,
- right: 30),
- child: TextFormField(
- controller: _emailController,
- // focusNode: _focusNodes[1],
- decoration: InputDecoration(
- // hintText: 'Enter your email',
- hintText: _showHints[1]
- ? AppLocalizations.of(context)!
- .enter_your_email
- : null,
- // _showHints[1] ? 'Enter your email' : null,
- 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.vector,
- fit: BoxFit.fitHeight,
- height: 20,
- width: 25,
- color: MyTheme.topicColor(
- IndicatorTopic.economy)
- .shade100,
- ),
- ),
-
- // 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
- ),
- counterText: '',
- hintStyle: TextStyle(
- color: Color(0xFFC3C6CB),
- fontSize:
- registerLocale?.languageCode ==
- 'ar'
- ? 14
- : 16,
- ),
- ),
- validator: _validateEmail,
- maxLength: 320,
- maxLengthEnforcement:
- MaxLengthEnforcement.enforced,
- inputFormatters: [
- LengthLimitingTextInputFormatter(
- 320), // Limit to 320 characters
- ],
- ),
- ),
- SizedBox(height: 15),
- Padding(
- padding: const EdgeInsets.only(
- top: 5.0,
- bottom: 10,
- left: 30,
- right: 30),
- child: TextFormField(
- controller: _passwordController,
- // focusNode: _focusNodes[2],
- obscureText: _obscurePassword,
- decoration: InputDecoration(
- hintText: _showHints[2]
- ? AppLocalizations.of(context)!
- .enter_your_password
- : null,
- // _showHints[2] ? 'Enter your password' : null,
- 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,
- ),
- ),
-
- // prefixIcon: Icon(
- // Icons.lock,
- // color: Color(0xFF90B0D5),
- // ),
- suffixIcon: IconButton(
- // icon: Icon(
- // _obscurePassword
- // ? Icons.visibility_off
- // : Icons.visibility,
- // color: Color(0xFF9EA2A9),
- // ),
-
- icon: Image.asset(
- _obscurePassword
- ? 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(() {
- _obscurePassword =
- !_obscurePassword;
- });
- },
- ),
- // 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
- ),
-
- counterText: '',
- hintStyle: TextStyle(
- color: Color(0xFFC3C6CB),
- fontSize:
- registerLocale?.languageCode ==
- 'ar'
- ? 14
- : 16,
- ),
- ),
- validator: _validatePassword,
- maxLength: 40,
- maxLengthEnforcement:
- MaxLengthEnforcement.enforced,
- ),
- ),
- SizedBox(height: 15),
- Padding(
- padding: const EdgeInsets.only(
- top: 5.0,
- bottom: 10,
- left: 30,
- right: 30),
- child: TextFormField(
- controller: _confirmpasswordController,
- // focusNode: _focusNodes[3],
- obscureText: _obscureConfirmPassword,
- decoration: InputDecoration(
- hintText: _showHints[3]
- ? AppLocalizations.of(context)!
- .register_Confirm_password
- : null,
- // _showHints[3] ? 'Confirm password' : null,
- 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: 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(() {
- _obscureConfirmPassword =
- !_obscureConfirmPassword;
- });
- },
- ),
- // border: OutlineInputBorder(
- // borderSide: BorderSide(color: Colors.blue, width: 2), // Default border color
- // ),
- 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
- ),
- counterText: '',
- hintStyle: TextStyle(
- color: Color(0xFFC3C6CB),
- fontSize:
- registerLocale?.languageCode ==
- 'ar'
- ? 14
- : 16,
- ),
- ),
- validator: _validateConfirmPassword,
- maxLength: 40,
- maxLengthEnforcement:
- MaxLengthEnforcement.enforced,
- inputFormatters: [
- LengthLimitingTextInputFormatter(
- 64), // Limit to 40 characters
- ],
- ),
- ),
- SizedBox(height: 10),
- Padding(
- padding: const EdgeInsets.only(
- top: 0,
- bottom: 10,
- left: 25,
- right: 30),
- child: Row(
- crossAxisAlignment:
- CrossAxisAlignment.start,
- children: [
- Checkbox(
- value: isChecked,
- onChanged: (value) {
- setState(() {
- isChecked = value ?? false;
- showError = false;
- });
- },
- side: BorderSide(
- color: showError
- ? Color(0xFFb22222)
- : MyTheme.topicColor(
- IndicatorTopic.economy)
- .shade400,
- width: 1,
- ),
- ),
- Expanded(
- child: Padding(
- padding: const EdgeInsets.only(
- top: 13.0),
- child: Text.rich(
- TextSpan(
- text: AppLocalizations.of(
- context)!
- .agree,
- // text: 'I agree to ',
- style: TextStyle(
- fontWeight: FontWeight.w500,
- fontSize: registerLocale
- ?.languageCode ==
- 'ar'
- ? 12
- : 14,
- color: Color(
- 0xFF898C81,), // Change to your desired color
- ),
- children: [
- TextSpan(
- recognizer:TapGestureRecognizer()
- ..onTap = () => context.push('/terms&conditions'),
- text: AppLocalizations.of(
- context)!
- .terms_conditions,
- // text: 'Terms & Conditions',
- style: TextStyle(
- fontSize: registerLocale
- ?.languageCode ==
- 'ar'
- ? 12
- : 14,
- fontWeight:
- FontWeight.bold,
- color:
- Color(0xFF985400),
- // Makes the text bold
- // decoration:
- // TextDecoration.underline,
- decorationColor:
- Color(0xFF985400),
- decorationThickness:
- 1),
- ),
- TextSpan(
- text: AppLocalizations.of(
- context)!
- .t_and,
- style: TextStyle(
- color: Color(
- 0xFF898C81), // Change to your desired color
- ),
- ),
- TextSpan(
- recognizer: TapGestureRecognizer()
- ..onTap = () => context.push('/privacy_policy'),
- text: AppLocalizations.of(
- context)!
- .privacy_policy,
- style: TextStyle(
- fontWeight:
- FontWeight.bold,
- fontSize: registerLocale
- ?.languageCode ==
- 'ar'
- ? 12
- : 14,
- fontFamily: 'Roboto',
- color:
- Color(0xFF985400),
- // decoration:
- // TextDecoration.underline,
- decorationColor:
- Color(0xFF648CBA),
- decorationThickness:
- 1),
- ),
- TextSpan(
- text: AppLocalizations.of(
- context)!
- .conditions,
- style: TextStyle(
- fontWeight: FontWeight.w500,
- fontSize: registerLocale
- ?.languageCode ==
- 'ar'
- ? 12
- : 14,
- color: Color(
- 0xFF898C81), // Change to your desired color
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- if (showError)
- Row(
- mainAxisAlignment:
- MainAxisAlignment.start,
- children: [
- Padding(
- padding: EdgeInsets.only(
- left:registerLocale
- ?.languageCode ==
- 'ar'
- ? 0
- : 30.0,
- right: registerLocale
- ?.languageCode ==
- 'ar'
- ? 30
- : 0.0,),
- child: Text(
- 'Required',
- style: TextStyle(
- color: Color(0xFFb22222),
- fontSize: registerLocale
- ?.languageCode ==
- 'ar'
- ? 12
- : 12,
- ),
- ),
- ),
- ],
- ),
- SizedBox(height: 20),
- Padding(
- padding: const EdgeInsets.only(
- top: 5.0,
- bottom: 10,
- left: 30,
- right: 30),
- child: SizedBox(
- width: screenwidth / 1,
- child: ElevatedButton(
- onPressed: isRegistering
- ? null
- : _registerUser,
- style: ElevatedButton.styleFrom(
- backgroundColor: Color(
- 0xFFA7887A), // Brownish color for Register
- shape: RoundedRectangleBorder(
- borderRadius:
- BorderRadius.circular(10),
- ),
- ),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Text(
- // "Register",
- AppLocalizations.of(context)!
- .register_title,
- style: TextStyle(
- fontSize: registerLocale
- ?.languageCode ==
- 'ar'
- ? 14
- : 16,
- color: Colors.white),
- ),
- SizedBox(width: 8),
- const Icon(
- Icons.chevron_right_outlined,
- color: Colors
- .white, // Set your desired color here
- )
- ],
- ),
- ),
- ),
- ),
- SizedBox(height: 15),
- Text(
- AppLocalizations.of(context)!
- .account_confirmation,
- style: TextStyle(
- fontWeight: FontWeight.w500,
- fontSize:
- registerLocale?.languageCode ==
- 'ar'
- ? 12
- : 14,
- color: Color(0xFF898C81),
- ),
- ),
- SizedBox(height: 15),
- Padding(
- padding: const EdgeInsets.only(
- top: 5.0,
- bottom: 10,
- left: 30,
- right: 30),
- child: SizedBox(
- width: screenwidth / 1,
- child: ElevatedButton(
- onPressed: () {
- context.pop();
- },
- style: ElevatedButton.styleFrom(
- backgroundColor: Color(
- 0xFF82AFCB), // Blueish color for Login
- shape: RoundedRectangleBorder(
- borderRadius:
- BorderRadius.circular(10),
- ),
- ),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Text(
- AppLocalizations.of(context)!
- .login_title,
- style: TextStyle(
- fontSize: 16,
- color: Colors.white),
- ),
- SizedBox(width: 8),
- const Icon(
- Icons.chevron_right_outlined,
- color: Colors
- .white, // Set your desired color here
- )
- ],
- ),
- ),
- ),
- ),
- SizedBox(
- height: 10,
- ),
- Center(
- child: Container(
- height: screenheight / 16,
- width: screenwidth / 3,
- decoration: BoxDecoration(
- image: DecorationImage(
- image: AssetImage(
- "assets/splash_screen/logo.png"), // Background image asset
- fit: BoxFit.fill,
- ),
- ),
- )),
- SizedBox(
- height: 20,
- ),
- ],
- ),
+ ),
+ child: Text(
+ context.translate('Go to Login', 'اذهب إلى تسجيل الدخول'),
+ style: TextStyle(
+ color: Colors.white, // Text color
+ ),
+ ),
+ ),
+
+ SizedBox(height: screenheight / 5),
+ Center(
+ child: Container(
+ height: screenheight / 16,
+ width: screenwidth / 2.5,
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage(
+ "assets/splash_screen/logo.png"), // Background image asset
+ fit: BoxFit.fill,
),
),
- ]),
- ),
- ),
- ],
+ ))
+ ],
+ ),
+ )
+ : registrationFailed
+ ? Padding(
+ padding: const EdgeInsets.all(20.0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SizedBox(height: screenheight / 8),
+ buildIconContainer(Icons.report, Colors.red),
+ SizedBox(height: 20),
+ Text(
+ context.translate(
+ 'Sorry ${_usernameController.text}!',
+ 'آسف ${_usernameController.text}!'),
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: 16,
+ fontWeight: FontWeight.w500,
+ color: Color(0xFF414042)),
+ ),
+ SizedBox(height: 10),
+ Text(
+ context.translate(
+ 'Your registration process failed. For further assistance, please contact support.',
+ 'فشلت عملية التسجيل الخاصة بك. لمزيد من المساعدة، يرجى الاتصال بالدعم.'),
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: 14,
+ color: Color(0xFF898C81),
+ ),
+ ),
+ SizedBox(height: 10),
+ ElevatedButton(
+ onPressed: () => {
+ setState(() {
+ registrationFailed = false;
+ registrationSuccess = false;
+ _usernameController.clear();
+ _emailController.clear();
+ _passwordController.clear();
+ _confirmpasswordController.clear();
+ isChecked = false;
+ })
+ },
+ child: Text(
+ context.translate(
+ 'Retry', 'أعد المحاولة'),
+ ),
+ ),
+ SizedBox(height: screenheight / 5),
+ Center(
+ child: Container(
+ height: screenheight / 16,
+ width: screenwidth / 2.5,
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage(
+ "assets/splash_screen/logo.png"), // Background image asset
+ fit: BoxFit.fill,
+ ),
+ ),
+ ))
+ ],
+ ),
+ )
+ : Form(
+ key: _formKey,
+ child: SingleChildScrollView(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SizedBox(height: screenheight / 60),
+ Text(
+ // 'Register',
+ AppLocalizations.of(context)!
+ .register_title,
+ style: TextStyle(
+ fontSize: 32,
+ fontWeight: FontWeight.w400),
+ ),
+ SizedBox(height: 10),
+ Text(AppLocalizations.of(context)!
+ .register_details,
+ style: TextStyle(
+ fontSize: context.translate(18.0, 14.0),
+ color: const Color(0xff898C81),
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+
+ SizedBox(height: 20),
+ // Display this if registration is pending approval
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 5.0,
+ bottom: 10,
+ left: 30,
+ right: 30),
+ child: TextFormField(
+ controller: _usernameController,
+ // focusNode: _focusNodes[0],
+ decoration: InputDecoration(
+ // hintText: _showHints[0] ? 'Username' : null,
+ hintText: _showHints[0]
+ ? AppLocalizations.of(context)!
+ .register_name
+ : null,
+ 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.person,
+ fit: BoxFit.fitHeight,
+ height: 25,
+ width: 25,
+ color: MyTheme.topicColor(
+ IndicatorTopic.economy)
+ .shade300,
+ ),
+ ),
+
+ // prefixIcon: Icon(
+ // Icons.person,
+ // color: Color(0xFF90B0D5),
+ //
+ // ),
+ // border: OutlineInputBorder(),
+ enabledBorder: OutlineInputBorder(
+ borderRadius:
+ BorderRadius.circular(10),
+ borderSide: BorderSide(
+ color: MyTheme.topicColor(
+ IndicatorTopic.economy)
+ .shade400,
+ width: 1), // Enabled border
+ ),
+ 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
+ ),
+ counterText: '',
+ hintStyle: TextStyle(
+ color: Color(0xFFC3C6CB),
+ fontSize:
+ registerLocale?.languageCode ==
+ 'ar'
+ ? 14
+ : 16,
+ ),
+ ),
+ validator: _validateUsername,
+ maxLength:
+ 40, // Set the maximum length to 20 characters
+ maxLengthEnforcement:
+ MaxLengthEnforcement.enforced,
+ ),
+ ),
+ SizedBox(height: 15),
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 5.0,
+ bottom: 10,
+ left: 30,
+ right: 30),
+ child: TextFormField(
+ controller: _emailController,
+ // focusNode: _focusNodes[1],
+ decoration: InputDecoration(
+ // hintText: 'Enter your email',
+ hintText: _showHints[1]
+ ? AppLocalizations.of(context)!
+ .enter_your_email
+ : null,
+ // _showHints[1] ? 'Enter your email' : null,
+ 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.vector,
+ fit: BoxFit.fitHeight,
+ height: 20,
+ width: 25,
+ color: MyTheme.topicColor(
+ IndicatorTopic.economy)
+ .shade100,
+ ),
+ ),
+
+ // 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
+ ),
+ counterText: '',
+ hintStyle: TextStyle(
+ color: Color(0xFFC3C6CB),
+ fontSize:
+ registerLocale?.languageCode ==
+ 'ar'
+ ? 14
+ : 16,
+ ),
+ ),
+ validator: _validateEmail,
+ maxLength: 320,
+ maxLengthEnforcement:
+ MaxLengthEnforcement.enforced,
+ inputFormatters: [
+ LengthLimitingTextInputFormatter(
+ 320), // Limit to 320 characters
+ ],
+ ),
+ ),
+ SizedBox(height: 15),
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 5.0,
+ bottom: 10,
+ left: 30,
+ right: 30),
+ child: TextFormField(
+ controller: _passwordController,
+ // focusNode: _focusNodes[2],
+ obscureText: _obscurePassword,
+ decoration: InputDecoration(
+ hintText: _showHints[2]
+ ? AppLocalizations.of(context)!
+ .enter_your_password
+ : null,
+ // _showHints[2] ? 'Enter your password' : null,
+ 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,
+ ),
+ ),
+
+ // prefixIcon: Icon(
+ // Icons.lock,
+ // color: Color(0xFF90B0D5),
+ // ),
+ suffixIcon: IconButton(
+ // icon: Icon(
+ // _obscurePassword
+ // ? Icons.visibility_off
+ // : Icons.visibility,
+ // color: Color(0xFF9EA2A9),
+ // ),
+
+ icon: Image.asset(
+ _obscurePassword
+ ? 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(() {
+ _obscurePassword =
+ !_obscurePassword;
+ });
+ },
+ ),
+ // 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
+ ),
+
+ counterText: '',
+ hintStyle: TextStyle(
+ color: Color(0xFFC3C6CB),
+ fontSize:
+ registerLocale?.languageCode ==
+ 'ar'
+ ? 14
+ : 16,
+ ),
+ ),
+ validator: _validatePassword,
+ maxLength: 40,
+ maxLengthEnforcement:
+ MaxLengthEnforcement.enforced,
+ ),
+ ),
+ SizedBox(height: 15),
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 5.0,
+ bottom: 10,
+ left: 30,
+ right: 30),
+ child: TextFormField(
+ controller: _confirmpasswordController,
+ // focusNode: _focusNodes[3],
+ obscureText: _obscureConfirmPassword,
+ decoration: InputDecoration(
+ hintText: _showHints[3]
+ ? AppLocalizations.of(context)!
+ .register_Confirm_password
+ : null,
+ // _showHints[3] ? 'Confirm password' : null,
+ 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: 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(() {
+ _obscureConfirmPassword =
+ !_obscureConfirmPassword;
+ });
+ },
+ ),
+ // border: OutlineInputBorder(
+ // borderSide: BorderSide(color: Colors.blue, width: 2), // Default border color
+ // ),
+ 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
+ ),
+ counterText: '',
+ hintStyle: TextStyle(
+ color: Color(0xFFC3C6CB),
+ fontSize:
+ registerLocale?.languageCode ==
+ 'ar'
+ ? 14
+ : 16,
+ ),
+ ),
+ validator: _validateConfirmPassword,
+ maxLength: 40,
+ maxLengthEnforcement:
+ MaxLengthEnforcement.enforced,
+ inputFormatters: [
+ LengthLimitingTextInputFormatter(
+ 64), // Limit to 40 characters
+ ],
+ ),
+ ),
+ SizedBox(height: 10),
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 0,
+ bottom: 10,
+ left: 25,
+ right: 30),
+ child: Row(
+ crossAxisAlignment:
+ CrossAxisAlignment.start,
+ children: [
+ Checkbox(
+ value: isChecked,
+ onChanged: (value) {
+ setState(() {
+ isChecked = value ?? false;
+ showError = false;
+ });
+ },
+ side: BorderSide(
+ color: showError
+ ? Color(0xFFb22222)
+ : MyTheme.topicColor(
+ IndicatorTopic.economy)
+ .shade400,
+ width: 1,
+ ),
+ ),
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.only(
+ top: 14.0,),
+ child: Text.rich(
+ TextSpan(
+ text: AppLocalizations.of(
+ context,)!
+ .agree,
+ // text: 'I agree to ',
+ style: TextStyle(
+ fontWeight: FontWeight.w500,
+ fontSize: registerLocale
+ ?.languageCode ==
+ 'ar'
+ ? 12
+ : 14,
+ color: Color(
+ 0xFF898C81,), // Change to your desired color
+ ),
+ children: [
+ TextSpan(
+ recognizer:TapGestureRecognizer()
+ ..onTap = () => context.push('/terms&conditions'),
+ text: AppLocalizations.of(
+ context)!
+ .terms_conditions,
+ // text: 'Terms & Conditions',
+ style: TextStyle(
+ fontSize: registerLocale
+ ?.languageCode ==
+ 'ar'
+ ? 12
+ : 14,
+ fontWeight:
+ FontWeight.bold,
+ color:
+ Color(0xFF985400),
+ // Makes the text bold
+ // decoration:
+ // TextDecoration.underline,
+ decorationColor:
+ Color(0xFF985400),
+ decorationThickness:
+ 1),
+ ),
+ TextSpan(
+ text: AppLocalizations.of(
+ context)!
+ .t_and,
+ style: TextStyle(
+ color: Color(
+ 0xFF898C81), // Change to your desired color
+ ),
+ ),
+ TextSpan(
+ recognizer: TapGestureRecognizer()
+ ..onTap = () => context.push('/privacy_policy'),
+ text: AppLocalizations.of(
+ context)!
+ .privacy_policy,
+ style: TextStyle(
+ fontWeight:
+ FontWeight.bold,
+ fontSize: registerLocale
+ ?.languageCode ==
+ 'ar'
+ ? 12
+ : 14,
+ fontFamily: 'Roboto',
+ color:
+ Color(0xFF985400),
+ // decoration:
+ // TextDecoration.underline,
+ decorationColor:
+ Color(0xFF648CBA),
+ decorationThickness:
+ 1),
+ ),
+ TextSpan(
+ text: AppLocalizations.of(
+ context)!
+ .conditions,
+ style: TextStyle(
+ fontWeight: FontWeight.w500,
+ fontSize: registerLocale
+ ?.languageCode ==
+ 'ar'
+ ? 12
+ : 14,
+ color: Color(
+ 0xFF898C81), // Change to your desired color
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ if (showError)
+ Row(
+ mainAxisAlignment:
+ MainAxisAlignment.start,
+ children: [
+ Padding(
+ padding: EdgeInsets.only(
+ left:registerLocale
+ ?.languageCode ==
+ 'ar'
+ ? 0
+ : 30.0,
+ right: registerLocale
+ ?.languageCode ==
+ 'ar'
+ ? 40
+ : 0.0,),
+ child: Text(
+ context.translate('Required', 'مطلوب'),
+ style: TextStyle(
+ color: Color(0xFFb22222),
+ fontSize: registerLocale
+ ?.languageCode ==
+ 'ar'
+ ? 12
+ : 12,
+ ),
+ ),
+ ),
+ ],
+ ),
+ SizedBox(height: 20),
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 5.0,
+ bottom: 10,
+ left: 30,
+ right: 30),
+ child: SizedBox(
+ width: screenwidth / 1,
+ child: ElevatedButton(
+ onPressed: isRegistering
+ ? null
+ : _registerUser,
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Color(
+ 0xFFA7887A), // Brownish color for Register
+ shape: RoundedRectangleBorder(
+ borderRadius:
+ BorderRadius.circular(10),
+ ),
+ ),
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ // "Register",
+ AppLocalizations.of(context)!
+ .register_title,
+ style: TextStyle(
+ fontSize: registerLocale
+ ?.languageCode ==
+ 'ar'
+ ? 14
+ : 16,
+ color: Colors.white),
+ ),
+ SizedBox(width: 8),
+ const Icon(
+ Icons.chevron_right_outlined,
+ color: Colors
+ .white, // Set your desired color here
+ )
+ ],
+ ),
+ ),
+ ),
+ ),
+ SizedBox(height: 15),
+ Text(
+ AppLocalizations.of(context)!
+ .account_confirmation,
+ style: TextStyle(
+ fontWeight: FontWeight.w500,
+ fontSize:
+ registerLocale?.languageCode ==
+ 'ar'
+ ? 12
+ : 14,
+ color: Color(0xFF898C81),
+ ),
+ ),
+ SizedBox(height: 15),
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 5.0,
+ bottom: 10,
+ left: 30,
+ right: 30),
+ child: SizedBox(
+ width: screenwidth / 1,
+ child: ElevatedButton(
+ onPressed: () {
+ context.pop();
+ },
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Color(
+ 0xFF82AFCB), // Blueish color for Login
+ shape: RoundedRectangleBorder(
+ borderRadius:
+ BorderRadius.circular(10),
+ ),
+ ),
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ AppLocalizations.of(context)!
+ .login_title,
+ style: TextStyle(
+ fontSize: 16,
+ color: Colors.white),
+ ),
+ SizedBox(width: 8),
+ const Icon(
+ Icons.chevron_right_outlined,
+ color: Colors
+ .white, // Set your desired color here
+ )
+ ],
+ ),
+ ),
+ ),
+ ),
+ SizedBox(
+ height: 10,
+ ),
+ Center(
+ child: Container(
+ height: screenheight / 16,
+ width: screenwidth / 3,
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage(
+ "assets/splash_screen/logo.png"), // Background image asset
+ fit: BoxFit.fill,
+ ),
+ ),
+ )),
+ SizedBox(
+ height: 20,
+ ),
+ ],
+ ),
+ ),
+ ),
+ ]),
+ // Container(
+ // height: MediaQuery.of(context).size.height / 1.2,
+ // child:
+ // ),
+ ],
+ ),
),
),
),
diff --git a/lib/presentation/Screens/auth_verification/terms&conditions.dart b/lib/presentation/Screens/auth_verification/terms&conditions.dart
index c4e2192d..5ea68038 100644
--- a/lib/presentation/Screens/auth_verification/terms&conditions.dart
+++ b/lib/presentation/Screens/auth_verification/terms&conditions.dart
@@ -17,6 +17,7 @@ class TermsOfUse extends StatelessWidget {
),
child: Scaffold(
appBar: AppBar(
+ scrolledUnderElevation: 0,
title:Text(context.translate(
'Terms & Conditions',
'الشروط والأحكام',
diff --git a/lib/presentation/Screens/charts/screens/chart_screen.dart b/lib/presentation/Screens/charts/screens/chart_screen.dart
index dcc97e71..5e2dec37 100644
--- a/lib/presentation/Screens/charts/screens/chart_screen.dart
+++ b/lib/presentation/Screens/charts/screens/chart_screen.dart
@@ -1,6 +1,7 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import 'package:pocketbase/pocketbase.dart';
import 'package:shared_preferences/shared_preferences.dart';
@@ -2071,16 +2072,17 @@ class _ChartScreen1State extends ConsumerState {
// color: Colors.white),
// ),
// const SizedBox(width: 5),
- Image.asset(
- isBookmarked
- ? UaeNumbersAssetPath
- .bookmarksSelectedUae // Filled bookmark image
- : UaeNumbersAssetPath
- .bookmarksUae, // Default bookmark image
- // color: Colors.white,
- width: 24,
- height: 24,
- ),
+ // Image.asset(
+ // isBookmarked
+ // ? UaeNumbersAssetPath
+ // .bookmarksSelectedUae // Filled bookmark image
+ // : UaeNumbersAssetPath
+ // .bookmarksUae, // Default bookmark image
+ // // color: Colors.white,
+ // width: 24,
+ // height: 24,
+ // ),
+ Icon(Icons.bookmarks_rounded, color:isBookmarked ? Colors.black:Colors.white ,),
],
),
),
@@ -2102,18 +2104,24 @@ class _ChartScreen1State extends ConsumerState {
SizedBox(width: 5),
Stack(
children: [
- Image.asset(
- UaeNumbersAssetPath.shareUae,
- color: Colors.white, // Outline color
- width: 24, // Slightly larger
- height: 24,
- ),
- Image.asset(
- UaeNumbersAssetPath.shareUae,
- color: Colors.white,
+ // Image.asset(
+ // UaeNumbersAssetPath.shareUae,
+ // color: Colors.white, // Outline color
+ // width: 24, // Slightly larger
+ // height: 24,
+ // ),
+ // Image.asset(
+ // UaeNumbersAssetPath.shareUae,
+ // color: Colors.white,
+ // width: 24,
+ // height: 24,
+ // ),
+ SvgPicture.asset(
+ UaeNumbersAssetPath.share,
+ semanticsLabel: 'share',
width: 24,
height: 24,
- ),
+ ),
],
)
],
diff --git a/lib/presentation/Screens/profilepage.dart b/lib/presentation/Screens/profilepage.dart
index f88960d8..f6954c85 100644
--- a/lib/presentation/Screens/profilepage.dart
+++ b/lib/presentation/Screens/profilepage.dart
@@ -5,6 +5,7 @@ import 'package:external_repos/external_repos.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:http/http.dart' as http;
import 'package:image_picker/image_picker.dart';
@@ -15,6 +16,8 @@ import 'package:uae_stat/config/my_theme.dart';
import 'package:uae_stat/domain/use_cases/language.dart';
import 'package:uae_stat/infrastructure/data/p_auth_repo.dart';
import 'package:uae_stat/infrastructure/services/img_asset_paths/icons/misc_icon_asset_path.dart';
+import 'package:uae_stat/presentation/components/indicators/locale_provider.dart';
+import 'package:uae_stat/presentation/components/my_toggle.dart';
import 'package:uae_stat/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
@@ -22,15 +25,15 @@ import '../components/my_bottom_nav_bar.dart';
import 'auth_verification/changepassword.dart';
import 'demo_home.dart';
-class ProfileScreen extends StatefulWidget {
+class ProfileScreen extends ConsumerStatefulWidget {
final String userId; // Add this field to hold the user ID
const ProfileScreen({Key? key, required this.userId}) : super(key: key);
@override
- State createState() => _ProfileScreenState();
+ ConsumerState createState() => _ProfileScreenState();
}
-class _ProfileScreenState extends State {
+class _ProfileScreenState extends ConsumerState {
final _pb = PocketBase('https://pb.venbait.in');
// final _pb = PocketBase('http://127.0.0.1:8090');
@@ -183,10 +186,10 @@ class _ProfileScreenState extends State {
_isLoading = true; // Start loading
});
final XFile? pickedFile =
- await _picker.pickImage(source: ImageSource.gallery);
+ await _picker.pickImage(source: ImageSource.gallery);
if (pickedFile != null) {
final String fileExtension =
- pickedFile.path.split('.').last.toLowerCase();
+ pickedFile.path.split('.').last.toLowerCase();
if (fileExtension == 'jpg' ||
fileExtension == 'jpeg' ||
fileExtension == 'png' ||
@@ -320,7 +323,7 @@ class _ProfileScreenState extends State {
// Create a multipart request
final uri =
- Uri.parse('${_pb.baseUrl}/api/collections/users/records/$userID');
+ Uri.parse('${_pb.baseUrl}/api/collections/users/records/$userID');
final request = http.MultipartRequest('PATCH', uri);
// Add other fields
@@ -461,6 +464,7 @@ class _ProfileScreenState extends State {
},
child: Scaffold(
appBar: AppBar(
+ scrolledUnderElevation: 0,
backgroundColor: Colors.white,
elevation: 0,
leading: IconButton(
@@ -473,6 +477,23 @@ class _ProfileScreenState extends State {
AppLocalizations.of(context)!.my_profile,
style: TextStyle(color: Color(0xFF985400)),
),
+ actions: [
+ Consumer(
+ builder: (context, ref, _) {
+ final locale = ref.watch(localeProvider); // Current locale
+ return MyToggle(
+ isOn: locale?.languageCode == 'en',
+ knobTextWhenOn: 'ع',
+ knobTextWhenOff: 'EN',
+ pathColorWhenOn: Colors.grey.shade300,
+ pathColorWhenOff: Colors.grey.shade300,
+ onTap: () {
+ ref.read(localeProvider.notifier).toggleLocale();
+ },
+ );
+ },
+ ),
+ ],
// actions: [
// TextButton(
// onPressed: () {
@@ -531,7 +552,7 @@ class _ProfileScreenState extends State {
backgroundImage: _profileImage != null
? FileImage(_profileImage!)
: AssetImage("assets/edit_profile/profile.png")
- as ImageProvider,
+ as ImageProvider,
child: Align(
alignment: Alignment.bottomRight,
child: GestureDetector(
@@ -555,7 +576,7 @@ class _ProfileScreenState extends State {
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor:
- AlwaysStoppedAnimation(Colors.grey),
+ AlwaysStoppedAnimation(Colors.grey),
),
),
],
@@ -707,7 +728,7 @@ class _ProfileScreenState extends State {
width: 45,
padding: EdgeInsets.only(right: 1),
alignment:
- Alignment.center, // Center the icon vertically
+ Alignment.center, // Center the icon vertically
child: Icon(
Icons.keyboard_arrow_down_sharp,
color: _isHoveringDate ? Colors.black : Colors.grey,
@@ -755,12 +776,12 @@ class _ProfileScreenState extends State {
),
icon: Icon(Icons.keyboard_arrow_down_sharp,
color:
- _isHoveringDropdown ? Colors.black : Colors.grey),
+ _isHoveringDropdown ? Colors.black : Colors.grey),
items: _countries
.map((item) => DropdownMenuItem(
- value: item,
- child: Text(item),
- ))
+ value: item,
+ child: Text(item),
+ ))
.toList(),
onChanged: (String? newValue) {
setState(() {
@@ -783,79 +804,91 @@ class _ProfileScreenState extends State {
},
side: BorderSide(
color:
- showError ? Color(0xFFb22222) : Color(0xFF7296BE),
+ 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(
- recognizer:TapGestureRecognizer()
- ..onTap = () => context.push('/terms&conditions'),
- 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,
- ),
- ),
- TextSpan(
- text: AppLocalizations.of(
- context,
- )!
- .t_and,
- style: TextStyle(color: Color(0xFF898C81)),
- ),
- TextSpan(
- recognizer: TapGestureRecognizer()
- ..onTap = () => context.push('/privacy_policy'),
-
- 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,
- ),
-
- ),
- TextSpan(
- text: AppLocalizations.of(
- context,
- )!
- .conditions,
- style: TextStyle(color: Color(0xFF898C81)),
- ),
- ],
+ child: Padding(
+ padding: const EdgeInsets.only(
+ top: 14.0,),
+ child: Text.rich(
+ TextSpan(
+ text: AppLocalizations.of(
+ context)!
+ .agree,
+ // text: 'I agree to ',
+ style: TextStyle(
+ fontWeight: FontWeight.w500,
+ fontSize: 14,
+ color: Color(
+ 0xFF898C81,), // Change to your desired color
),
- textAlign: TextAlign.start,
- maxLines: 2,
- overflow: TextOverflow.visible,
- softWrap: true,
+ children: [
+ TextSpan(
+ recognizer:TapGestureRecognizer()
+ ..onTap = () => context.push('/terms&conditions'),
+ text: AppLocalizations.of(
+ context)!
+ .terms_conditions,
+ // text: 'Terms & Conditions',
+ style: TextStyle(
+ fontSize: 14,
+ fontWeight:
+ FontWeight.bold,
+ color:
+ Color(0xFF985400),
+ // Makes the text bold
+ // decoration:
+ // TextDecoration.underline,
+ decorationColor:
+ Color(0xFF985400),
+ decorationThickness:
+ 1),
+ ),
+ TextSpan(
+ text: AppLocalizations.of(
+ context)!
+ .t_and,
+ style: TextStyle(
+ color: Color(
+ 0xFF898C81), // Change to your desired color
+ ),
+ ),
+ TextSpan(
+ recognizer: TapGestureRecognizer()
+ ..onTap = () => context.push('/privacy_policy'),
+ text: AppLocalizations.of(
+ context)!
+ .privacy_policy,
+ style: TextStyle(
+ fontWeight:
+ FontWeight.bold,
+ fontSize: 14,
+ fontFamily: 'Roboto',
+ color:
+ Color(0xFF985400),
+ // decoration:
+ // TextDecoration.underline,
+ decorationColor:
+ Color(0xFF648CBA),
+ decorationThickness:
+ 1),
+ ),
+ TextSpan(
+ text: AppLocalizations.of(
+ context)!
+ .conditions,
+ style: TextStyle(
+ fontWeight: FontWeight.w500,
+ fontSize: 14,
+ color: Color(
+ 0xFF898C81), // Change to your desired color
+ ),
+ ),
+ ],
),
- ],
+ ),
),
),
],
@@ -909,7 +942,7 @@ class _ProfileScreenState extends State {
} else {
setState(() {
showError =
- !isChecked; // Show error if the checkbox is not checked
+ !isChecked; // Show error if the checkbox is not checked
});
}
},
@@ -922,7 +955,7 @@ class _ProfileScreenState extends State {
),
child: Row(
mainAxisAlignment:
- MainAxisAlignment.center, // Center the content
+ MainAxisAlignment.center, // Center the content
children: [
Text(
AppLocalizations.of(context)!.save,
@@ -981,7 +1014,7 @@ class ConfirmationDialog extends StatelessWidget {
TextSpan(
text: "Name",
style:
- TextStyle(fontWeight: FontWeight.w700), // Bold for "name"
+ TextStyle(fontWeight: FontWeight.w700), // Bold for "name"
),
TextSpan(
text: " or ",
diff --git a/lib/presentation/routes/auth_routes/login_route.dart b/lib/presentation/routes/auth_routes/login_route.dart
index 29618deb..330bd057 100644
--- a/lib/presentation/routes/auth_routes/login_route.dart
+++ b/lib/presentation/routes/auth_routes/login_route.dart
@@ -449,8 +449,8 @@ class LoginRoute extends HookConsumerWidget {
'Roboto',
'Roboto',
),
- fontSize: locale?.languageCode == 'ar' ? 14: 18,
- fontWeight: FontWeight.bold,
+ fontSize: locale?.languageCode == 'ar' ? 12: 18,
+ fontWeight: FontWeight.w500,
)
),
6.horizontalSpace,
diff --git a/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart b/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart
index 421a59f9..557e9dbf 100644
--- a/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart
+++ b/lib/presentation/routes/bottom_bar_routes/tab_routes/home_route.dart
@@ -1266,7 +1266,7 @@ class InfoCard extends StatelessWidget {
return GestureDetector(
onTap: () {
- context.go(
+ context.push(
'/chartScreen/$dataset?bgColor=$colorPattern&mainTopic=$encodedMainTopic&title=$encodedTitle&key=$encodedKey');
},
child: Container(
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/AboutTheApp/AboutFCSC.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/AboutTheApp/AboutFCSC.dart
index 53f73395..7b332537 100755
--- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/AboutTheApp/AboutFCSC.dart
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/AboutTheApp/AboutFCSC.dart
@@ -16,6 +16,7 @@ class aboutFCSC extends StatelessWidget {
);
return BaseScaffold(
showDivider: true,
+ showBackButton: true,
dividerColor: Colors.grey[300],
appbarColor: Colors.white,
bottomColor: Colors.white,
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/AboutTheApp/getStarted.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/AboutTheApp/getStarted.dart
index 1a0ebf95..763ba1d7 100755
--- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/AboutTheApp/getStarted.dart
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/AboutTheApp/getStarted.dart
@@ -23,6 +23,7 @@ class GetStarted extends StatelessWidget {
),
child: BaseScaffold(
showDivider: true,
+ showBackButton: true,
dividerColor: Colors.grey[300],
appbarColor: Colors.white,
bottomColor: Colors.white,
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/AppFeatures.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/AppFeatures.dart
index 803d013d..b15d522c 100755
--- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/AppFeatures.dart
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/AppFeatures.dart
@@ -21,6 +21,7 @@ class AppFeatures extends StatelessWidget {
),
child: BaseScaffold(
showDivider: true,
+ showBackButton: true,
bottomColor: Colors.white,
dividerColor: Colors.grey[300],
appbarColor: Colors.white,
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/ChangeMyPassword.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/ChangeMyPassword.dart
index cbdda79b..908b26bc 100755
--- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/ChangeMyPassword.dart
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/ChangeMyPassword.dart
@@ -21,6 +21,7 @@ class ChangeMyPassword extends StatelessWidget {
),
child: BaseScaffold(
showDivider: true,
+ showBackButton: true,
bottomColor: Colors.white,
dividerColor: Colors.grey[300],
appbarColor: Colors.white,
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/EditMyProfile.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/EditMyProfile.dart
index 9668065d..d125fe39 100755
--- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/EditMyProfile.dart
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/EditMyProfile.dart
@@ -21,6 +21,7 @@ class EditMyProfile extends StatelessWidget {
),
child: BaseScaffold(
showDivider: true,
+ showBackButton: true,
bottomColor: Colors.white,
dividerColor: Colors.grey[300],
appbarColor: Colors.white,
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/howUseTheApp.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/howUseTheApp.dart
index b20bd1c0..513871eb 100755
--- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/howUseTheApp.dart
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/howUseTheApp.dart
@@ -21,6 +21,7 @@ class HowUseTheApp extends StatelessWidget {
),
child: BaseScaffold(
showDivider: true,
+ showBackButton: true,
dividerColor: Colors.grey[300],
appbarColor: Colors.white,
bottomColor: Colors.white,
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/purpose.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/purpose.dart
index 273e7371..85f3de4d 100755
--- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/purpose.dart
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/purpose.dart
@@ -24,6 +24,7 @@ class Purpose extends StatelessWidget {
),
child: BaseScaffold(
showDivider: true,
+ showBackButton: true,
dividerColor: Colors.grey[300],
appbarColor: Colors.white,
bottomColor: Colors.white,
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/stayUpdate.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/stayUpdate.dart
index bf90dd4f..a7333e0b 100755
--- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/stayUpdate.dart
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/stayUpdate.dart
@@ -24,6 +24,7 @@ class StayUpdate extends StatelessWidget {
),
child: BaseScaffold(
showDivider: true,
+ showBackButton: true,
dividerColor: Colors.grey[300],
appbarColor: Colors.white,
bottomColor: Colors.white,
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/useTheApp.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/useTheApp.dart
index 9d3a01e5..f34258b0 100755
--- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/useTheApp.dart
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/KeyFeatures/useTheApp.dart
@@ -21,6 +21,7 @@ class WhoUseTheApp extends StatelessWidget {
),
child: BaseScaffold(
showDivider: true,
+ showBackButton: true,
dividerColor: Colors.grey[300],
appbarColor: Colors.white,
bottomColor: Colors.white,
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/aboutApp.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/aboutApp.dart
index b41c7224..98eb4cd9 100755
--- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/aboutApp.dart
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/aboutApp.dart
@@ -16,6 +16,7 @@ class aboutTheApp extends StatelessWidget {
);
return BaseScaffold(
showDivider: true,
+ showBackButton: true,
bottomColor: Colors.white,
dividerColor: Colors.grey[300],
appbarColor: Colors.white,
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/faq_page.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/faq_page.dart
index 642131bf..633666ff 100755
--- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/faq_page.dart
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/faq_page.dart
@@ -20,6 +20,7 @@ class _FAQPageState extends State {
Widget build(BuildContext context) {
return BaseScaffold(
dividerColor: Colors.grey[300],
+ showBackButton: true,
appbarColor: Colors.white,
bottomColor: Colors.white,
mycenterTitle: true,
diff --git a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/features.dart b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/features.dart
index a646a1ca..9743c868 100755
--- a/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/features.dart
+++ b/lib/presentation/routes/drawer_routes/Drawer Items/user_guide/features.dart
@@ -17,6 +17,7 @@ class UsingFeatures extends StatelessWidget {
);
return BaseScaffold(
showDivider: true,
+ showBackButton: true,
dividerColor: Colors.grey[300],
bottomColor: Colors.white,
appbarColor: Colors.white,
diff --git a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart
index a35aeb93..90d5a899 100644
--- a/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart
+++ b/lib/presentation/routes/drawer_routes/custom_drawer_routes.dart
@@ -668,6 +668,17 @@ class _BaseScaffoldState extends ConsumerState {
),
)
: null,
+
+ // bottom: widget.showDivider
+ // ? PreferredSize(
+ // preferredSize: Size.fromHeight(1), // Height of the line
+ // child: Container(
+ // color: widget.dividerColor,
+ // width: double.infinity,// Line color
+ // height: 1, // Line thickness
+ // ),
+ // )
+ // : null,
actions: widget.actions ??
[
// IconButton(
@@ -698,14 +709,15 @@ class _BaseScaffoldState extends ConsumerState {
child: IconButton(
padding: EdgeInsets.zero,
constraints: BoxConstraints(),
- color: Colors.white,
+ color: widget.colorChange ? Colors.white : Colors.black,
icon: const Icon(Icons.arrow_back_ios_new, size: 24),
onPressed: () {
- if ((widget.navBackArrow as Text).data == 'home') {
- context.go('/myhomepage');
- } else {
- context.go('/uaenumbers');
- }
+ // if ((widget.navBackArrow as Text).data == 'home') {
+ // context.go('/myhomepage');
+ // } else {
+ // context.go('/uaenumbers');
+ // }
+ context.pop();
},
),
),
@@ -755,7 +767,7 @@ class _BaseScaffoldState extends ConsumerState {
),
],
),
- Divider(),
+ Divider(thickness: 1, color: Colors.grey),
InkWell(
onTap: () {
if (userId != 'guest') context.go('/editProfile');
@@ -813,7 +825,7 @@ class _BaseScaffoldState extends ConsumerState {
ListTile(
leading: Icon(Icons.notifications_none),
title: const Text('Notification'),
- onTap: () => context.go('/notification'),
+ onTap: () => _navigateTo(context, '/notification'),
),
ListTile(
leading: Icon(Icons.message_outlined),
@@ -825,7 +837,7 @@ class _BaseScaffoldState extends ConsumerState {
// ),
// title: const Text('Feedback'),
title: Text(AppLocalizations.of(context)!.feedback_title),
- onTap: () => context.go('/feedback', extra: userName),
+ onTap: () => _navigateTo(context, '/feedback', extra: userName),
),
if (role == 'admin')
ListTile(
@@ -840,7 +852,7 @@ class _BaseScaffoldState extends ConsumerState {
title: Text(
AppLocalizations.of(context)!.manage_user,
),
- onTap: () => context.go('/manageuser'),
+ onTap: () => _navigateTo(context, '/manageuser'),
),
ListTile(
leading: Icon(Icons.bookmarks_outlined),
@@ -848,7 +860,7 @@ class _BaseScaffoldState extends ConsumerState {
title: Text(
AppLocalizations.of(context)!.bookmark_title,
),
- onTap: () => context.go('/bookmark'),
+ onTap: () => _navigateTo(context, '/bookmark'),
),
ListTile(
leading: Icon(Icons.menu_book_outlined),
@@ -860,7 +872,7 @@ class _BaseScaffoldState extends ConsumerState {
// ),
// title: const Text('User Guide'),
title: Text(AppLocalizations.of(context)!.guide_title),
- onTap: () => context.go('/user-guide'),
+ onTap: () => _navigateTo(context, '/user-guide'),
),
if (userId != 'guest')
ListTile(
@@ -1000,6 +1012,11 @@ class _BaseScaffoldState extends ConsumerState {
body: widget.body,
);
}
+ //drawer close code
+ void _navigateTo(BuildContext context, String route, {Object? extra}) {
+ Navigator.pop(context); // Close the drawer
+ context.go(route, extra: extra); // Navigate with extra data
+ }
int _getSelectedIndex(String route) {
switch (route) {
diff --git a/pubspec.lock b/pubspec.lock
index c8b9ce43..1bdd3452 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -568,7 +568,7 @@ packages:
source: hosted
version: "0.7.0"
flutter_svg:
- dependency: transitive
+ dependency: "direct main"
description:
name: flutter_svg
sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b
@@ -1002,7 +1002,7 @@ packages:
source: hosted
version: "1.1.0"
path_provider:
- dependency: transitive
+ dependency: "direct main"
description:
name: path_provider
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
diff --git a/pubspec.yaml b/pubspec.yaml
index c8991e73..215e91b2 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -25,6 +25,7 @@ dependencies:
iconify_design: ^1.0.1
marquee: ^2.2.3
url_launcher: ^6.3.1
+ path_provider: ^2.1.5
# dynamic_layouts:
# git:
# url: https://github.com/flutter/packages.git
@@ -63,6 +64,7 @@ dependencies:
connectivity_plus: ^6.1.2
tutorial_coach_mark: ^1.2.12
package_info_plus: ^8.2.0
+ flutter_svg: ^2.0.17
dependency_overrides:
fading_edge_scrollview: ^4.1.1
@@ -136,6 +138,7 @@ flutter:
- assets/icons/misc/group.png
- assets/icons/misc/search.png
+
fonts:
- family: Segoe
fonts: