register page merge done

This commit is contained in:
venbaittech 2025-02-08 12:29:39 +05:30
commit 0d4c3cf02e
2 changed files with 347 additions and 313 deletions

View File

@ -15,12 +15,12 @@ import 'package:uae_stat/presentation/components/indicators/locale_provider.dart
import '../../components/my_toggle.dart'; import '../../components/my_toggle.dart';
import '../../routes/auth_routes/login_route.dart'; import '../../routes/auth_routes/login_route.dart';
class RegisterScreen extends StatefulWidget { class RegisterScreen extends ConsumerStatefulWidget {
@override @override
_RegisterScreenState createState() => _RegisterScreenState(); _RegisterScreenState createState() => _RegisterScreenState();
} }
class _RegisterScreenState extends State<RegisterScreen> { class _RegisterScreenState extends ConsumerState<RegisterScreen> {
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
final _usernameController = TextEditingController(); final _usernameController = TextEditingController();
final _emailController = TextEditingController(); final _emailController = TextEditingController();
@ -311,6 +311,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
double screenheight = MediaQuery.of(context).size.height; double screenheight = MediaQuery.of(context).size.height;
double screenwidth = MediaQuery.of(context).size.width; double screenwidth = MediaQuery.of(context).size.width;
final registerLocale = ref.watch(localeProvider);
Widget buildIconContainer(IconData icon, Color iconColor) { Widget buildIconContainer(IconData icon, Color iconColor) {
return Container( return Container(
@ -336,9 +337,14 @@ class _RegisterScreenState extends State<RegisterScreen> {
} }
return Scaffold( return Scaffold(
appBar: AppBar(
actions: [ body:
Consumer(
Column(
children: [
Align(
alignment: AlignmentDirectional.topEnd,
child: Consumer(
builder: (context, ref, _) { builder: (context, ref, _) {
final locale = ref.watch(localeProvider); // Current locale final locale = ref.watch(localeProvider); // Current locale
return MyToggle( return MyToggle(
@ -361,11 +367,14 @@ class _RegisterScreenState extends State<RegisterScreen> {
// ); // );
}, },
), ),
],
backgroundColor: Colors.white,
), ),
backgroundColor: Colors.white, Container(
body: registrationSuccess height: MediaQuery.of(context).size.height/1.2,
child: SingleChildScrollView(
child: Column(
children : [
registrationSuccess
? Padding( ? Padding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
child: Column( child: Column(
@ -480,6 +489,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
], ],
), ),
) )
: Form( : Form(
key: _formKey, key: _formKey,
child: SingleChildScrollView( child: SingleChildScrollView(
@ -562,7 +572,9 @@ class _RegisterScreenState extends State<RegisterScreen> {
width: 1), // Match the error color width: 1), // Match the error color
), ),
counterText: '', counterText: '',
hintStyle: TextStyle(color: Color(0xFFC3C6CB)), hintStyle: TextStyle(color: Color(0xFFC3C6CB),
fontSize: registerLocale?.languageCode == 'ar' ? 14 : 16,
),
), ),
validator: _validateUsername, validator: _validateUsername,
maxLength: maxLength:
@ -632,7 +644,9 @@ class _RegisterScreenState extends State<RegisterScreen> {
width: 1), // Match the error color width: 1), // Match the error color
), ),
counterText: '', counterText: '',
hintStyle: TextStyle(color: Color(0xFFC3C6CB)), hintStyle: TextStyle(color: Color(0xFFC3C6CB),
fontSize: registerLocale?.languageCode == 'ar' ? 14 : 16,
),
), ),
validator: _validateEmail, validator: _validateEmail,
maxLength: 320, maxLength: 320,
@ -735,7 +749,9 @@ class _RegisterScreenState extends State<RegisterScreen> {
), ),
counterText: '', counterText: '',
hintStyle: TextStyle(color: Color(0xFFC3C6CB)), hintStyle: TextStyle(color: Color(0xFFC3C6CB),
fontSize: registerLocale?.languageCode == 'ar' ? 14 : 16,
),
), ),
validator: _validatePassword, validator: _validatePassword,
maxLength: 40, maxLength: 40,
@ -824,7 +840,9 @@ class _RegisterScreenState extends State<RegisterScreen> {
width: 1), // Match the error color width: 1), // Match the error color
), ),
counterText: '', counterText: '',
hintStyle: TextStyle(color: Color(0xFFC3C6CB)), hintStyle: TextStyle(color: Color(0xFFC3C6CB),
fontSize: registerLocale?.languageCode == 'ar' ? 14 : 16,
),
), ),
validator: _validateConfirmPassword, validator: _validateConfirmPassword,
maxLength: 40, maxLength: 40,
@ -873,7 +891,8 @@ class _RegisterScreenState extends State<RegisterScreen> {
.terms_conditions, .terms_conditions,
// text: 'Terms & Conditions', // text: 'Terms & Conditions',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontSize: registerLocale?.languageCode == 'ar' ? 12 : 14,
fontWeight: FontWeight.bold,
color: Color(0xFF985400), color: Color(0xFF985400),
// Makes the text bold // Makes the text bold
// decoration: // decoration:
@ -891,8 +910,8 @@ class _RegisterScreenState extends State<RegisterScreen> {
text: AppLocalizations.of(context)! text: AppLocalizations.of(context)!
.privacy_policy, .privacy_policy,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: registerLocale?.languageCode == 'ar' ? 12 : 14,
fontFamily: 'Roboto', fontFamily: 'Roboto',
color: Color(0xFF985400), color: Color(0xFF985400),
// decoration: // decoration:
@ -924,7 +943,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
'Required', 'Required',
style: TextStyle( style: TextStyle(
color: Color(0xFFb22222), color: Color(0xFFb22222),
fontSize: 12, fontSize: registerLocale?.languageCode == 'ar' ? 12 : 14,
), ),
), ),
), ),
@ -953,7 +972,8 @@ class _RegisterScreenState extends State<RegisterScreen> {
AppLocalizations.of(context)! AppLocalizations.of(context)!
.register_title, .register_title,
style: TextStyle( style: TextStyle(
fontSize: 16, color: Colors.white), fontSize: registerLocale?.languageCode == 'ar' ? 14 : 16,
color: Colors.white),
), ),
SizedBox(width: 8), SizedBox(width: 8),
const Icon( const Icon(
@ -970,7 +990,8 @@ class _RegisterScreenState extends State<RegisterScreen> {
Text( Text(
AppLocalizations.of(context)!.account_confirmation, AppLocalizations.of(context)!.account_confirmation,
style: TextStyle( style: TextStyle(
fontSize: 14, color: Colors.grey[600]), fontSize: registerLocale?.languageCode == 'ar' ? 12 : 14,
color: Colors.grey[600]),
), ),
SizedBox(height: 15), SizedBox(height: 15),
Padding( Padding(
@ -1052,6 +1073,11 @@ class _RegisterScreenState extends State<RegisterScreen> {
), ),
), ),
), ),
]),
),
),
],
),
); );
} }
} }

View File

@ -145,7 +145,7 @@ class LoginRoute extends HookConsumerWidget {
'إعادة تعيين كلمة المرور', 'إعادة تعيين كلمة المرور',
), ),
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: locale?.languageCode == 'ar' ? 18 : 20,
color: Color(0xFF898C81), color: Color(0xFF898C81),
fontWeight: FontWeight.w600), fontWeight: FontWeight.w600),
), ),
@ -160,7 +160,7 @@ class LoginRoute extends HookConsumerWidget {
'عنوان البريد الإلكتروني', 'عنوان البريد الإلكتروني',
), ),
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: 16, fontSize: locale?.languageCode == 'ar' ? 13 : 16,
color: Color(0xFF898C81), // For label text color color: Color(0xFF898C81), // For label text color
// fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
), ),
@ -254,10 +254,10 @@ class LoginRoute extends HookConsumerWidget {
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'Roboto',
), ),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: locale?.languageCode == 'ar' ? 12 : 14,
color: Color(0xFF985400), color: Color(0xFF985400),
), ),
), ),
@ -418,9 +418,9 @@ class LoginRoute extends HookConsumerWidget {
TextStyle( TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'Roboto',
), ),
fontSize: 16, fontSize: locale?.languageCode == 'ar' ? 14 : 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -442,6 +442,14 @@ class LoginRoute extends HookConsumerWidget {
'Login', 'Login',
'تسجيل الدخول', 'تسجيل الدخول',
), ),
style: TextStyle(
fontFamily: context.translate(
'Roboto',
'Roboto',
),
fontSize: locale?.languageCode == 'ar' ? 16: 18,
fontWeight: FontWeight.bold,
)
), ),
6.horizontalSpace, 6.horizontalSpace,
const Icon( const Icon(
@ -511,9 +519,9 @@ class LoginRoute extends HookConsumerWidget {
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'Roboto',
), ),
fontSize: 40, fontSize: locale?.languageCode == 'ar' ? 38 : 40,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
), ),
), ),
@ -527,7 +535,7 @@ class LoginRoute extends HookConsumerWidget {
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'Roboto',
), ),
fontSize: context.translate(18.0, 14.0), fontSize: context.translate(18.0, 14.0),
color: const Color(0xff898C81), color: const Color(0xff898C81),
@ -544,9 +552,9 @@ class LoginRoute extends HookConsumerWidget {
style: TextStyle( style: TextStyle(
fontFamily: context.translate( fontFamily: context.translate(
'Roboto', 'Roboto',
'NotoKufi', 'Roboto',
), ),
fontSize: 14, fontSize: locale?.languageCode == 'ar' ? 12 : 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
children: [ children: [