adding i18n to all other pages

This commit is contained in:
Azmat-7860
2026-10-03 11:22:48 +05:30
parent 47656678e1
commit 3fbeb606a8
22 changed files with 2526 additions and 249 deletions
@@ -4,6 +4,7 @@ import 'package:flutter/services.dart';
import '../../Utils/image_constant.dart';
import '../../Utils/size_utils.dart';
import '../../l10n/app_localizations.dart';
import '../../theme/app_style.dart';
import '../../widgets/app_bar/appbar_image.dart';
import '../../widgets/app_bar/appbar_title.dart';
@@ -126,7 +127,8 @@ class _RegistrationDetailsScreenState extends State<RegistrationDetailsScreen> {
Navigator.pop(context);
}),
centerTitle: true,
title: AppbarTitle(text: "Registration")),
title: AppbarTitle(
text: AppLocalizations.of(context)!.registration)),
//AppBar(title: const Text('Registration')),
body: SingleChildScrollView(
child: Padding(
@@ -138,7 +140,8 @@ class _RegistrationDetailsScreenState extends State<RegistrationDetailsScreen> {
children: [
Padding(
padding: getPadding(top: 19),
child: Text("First Name",
child: Text(
AppLocalizations.of(context)!.firstName,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
@@ -148,18 +151,20 @@ class _RegistrationDetailsScreenState extends State<RegistrationDetailsScreen> {
onsaved: (value) => formData['first_name'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter First Name';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.firstName);
}
return null;
},
hintText: "enter First Name",
hintText: AppLocalizations.of(context)!.enterThis(
AppLocalizations.of(context)!.firstName),
margin: getMargin(top: 6),
padding: TextFormFieldPadding.PaddingT12,
textInputType: TextInputType.text
),
Padding(
padding: getPadding(top: 19),
child: Text("Last Name",
child: Text(AppLocalizations.of(context)!.lastName,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
@@ -169,11 +174,13 @@ class _RegistrationDetailsScreenState extends State<RegistrationDetailsScreen> {
onsaved: (value) => formData['last_name'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Last Name';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.lastName);
}
return null;
},
hintText: "enter Last Name",
hintText: AppLocalizations.of(context)!.enterThis(
AppLocalizations.of(context)!.lastName),
margin: getMargin(top: 6),
padding: TextFormFieldPadding.PaddingT12,
textInputType: TextInputType.text
@@ -181,7 +188,8 @@ class _RegistrationDetailsScreenState extends State<RegistrationDetailsScreen> {
Padding(
padding: getPadding(top: 19),
child: Text("Mobile Number",
child: Text(
AppLocalizations.of(context)!.mobileNumber,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
@@ -195,33 +203,38 @@ class _RegistrationDetailsScreenState extends State<RegistrationDetailsScreen> {
onsaved: (value) => formData['mob_no'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Mobile Number';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.mobileNumber);
}
return null;
},
hintText: "enter Mobile Number",
hintText: AppLocalizations.of(context)!.enterThis(
AppLocalizations.of(context)!.mobileNumber),
margin: getMargin(top: 6),
padding: TextFormFieldPadding.PaddingT12,
),
Padding(
padding: getPadding(top: 19),
child: Text("New Password",
child: Text(AppLocalizations.of(context)!.newPassword,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
AppStyle.txtGilroyMedium16Bluegray900)),
CustomTextFormField(
focusNode: _newPasswordNode,
hintText: "New Password",
hintText:
AppLocalizations.of(context)!.newPassword,
margin: getMargin(top: 6),
padding: TextFormFieldPadding.PaddingT12,
textInputAction: TextInputAction.done,
textInputType:TextInputType.visiblePassword,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Password';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.password);
}else if(!_isPasswordValid){
return 'Please enter a valid password';
return AppLocalizations.of(context)!
.validPasswordShort;
}
return null;
},
@@ -248,21 +261,24 @@ class _RegistrationDetailsScreenState extends State<RegistrationDetailsScreen> {
Padding(
padding: getPadding(top: 19),
child: Text("Confirm Password",
child: Text(
AppLocalizations.of(context)!.confirmPassword,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
AppStyle.txtGilroyMedium16Bluegray900)),
CustomTextFormField(
focusNode: _confirmPasswordNode,
hintText: "Confirm Password",
hintText: AppLocalizations.of(context)!
.confirmPassword,
margin: getMargin(top: 6),
padding: TextFormFieldPadding.PaddingT12,
textInputAction: TextInputAction.done,
textInputType:TextInputType.visiblePassword,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Password';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.password);
}
return _validatePasswordMatch(value);
},
@@ -289,8 +305,9 @@ class _RegistrationDetailsScreenState extends State<RegistrationDetailsScreen> {
Row(
children: [
const Expanded(
child: Text('Add Account'),
Expanded(
child: Text(
AppLocalizations.of(context)!.addAccount),
),
IconButton(
onPressed: () async {