Login and Register translation font

This commit is contained in:
Kalonkarthik 2025-02-07 18:36:11 +05:30
parent 9f75e090fd
commit 1787488987
2 changed files with 44 additions and 24 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(
@ -432,7 +433,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
'آسف ${_usernameController.text}!'), 'آسف ${_usernameController.text}!'),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: registerLocale?.languageCode == 'ar' ? 14 : 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF414042)), color: Color(0xFF414042)),
), ),
@ -443,7 +444,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
'فشلت عملية التسجيل الخاصة بك. لمزيد من المساعدة، يرجى الاتصال بالدعم.'), 'فشلت عملية التسجيل الخاصة بك. لمزيد من المساعدة، يرجى الاتصال بالدعم.'),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: registerLocale?.languageCode == 'ar' ? 12 : 14,
color: Color(0xFF898C81), color: Color(0xFF898C81),
), ),
), ),
@ -491,7 +492,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
// 'Register', // 'Register',
AppLocalizations.of(context)!.register_title, AppLocalizations.of(context)!.register_title,
style: TextStyle( style: TextStyle(
fontSize: 32, fontWeight: FontWeight.w400), fontSize: registerLocale?.languageCode == 'ar' ? 30 : 32, fontWeight: FontWeight.w400),
), ),
SizedBox(height: 10), SizedBox(height: 10),
Text(AppLocalizations.of(context)!.register_details), Text(AppLocalizations.of(context)!.register_details),
@ -562,7 +563,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 +635,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 +740,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 +831,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,
@ -868,6 +877,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
.terms_conditions, .terms_conditions,
// text: 'Terms & Conditions', // text: 'Terms & Conditions',
style: TextStyle( style: TextStyle(
fontSize: registerLocale?.languageCode == 'ar' ? 12 : 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF985400), color: Color(0xFF985400),
// Makes the text bold // Makes the text bold
@ -884,7 +894,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
.privacy_policy, .privacy_policy,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: registerLocale?.languageCode == 'ar' ? 12 : 14,
fontFamily: 'Roboto', fontFamily: 'Roboto',
color: Color(0xFF985400), color: Color(0xFF985400),
decoration: decoration:
@ -912,7 +922,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,
), ),
), ),
), ),
@ -941,7 +951,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(
@ -958,7 +969,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(

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: [