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
+51 -27
View File
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../../Utils/size_utils.dart';
import '../../l10n/app_localizations.dart';
import '../../theme/app_style.dart';
import '../../widgets/custom_button.dart';
import '../../widgets/custom_text_form_field.dart';
@@ -42,7 +43,8 @@ class _CreateAccountScreenState extends State<CreateAccountScreen> {
_context = context; // Store the context
return Scaffold(
appBar: AppBar(title: const Text('Create Account')),
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.createAccount)),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16),
@@ -52,7 +54,8 @@ class _CreateAccountScreenState extends State<CreateAccountScreen> {
children: [
Padding(
padding: getPadding(top: 19),
child: Text("Company Name",
child: Text(
AppLocalizations.of(context)!.companyName,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
@@ -62,18 +65,20 @@ class _CreateAccountScreenState extends State<CreateAccountScreen> {
onsaved: (value) => formData['companyName'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Company Name';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.companyName);
}
return null;
},
hintText: "enter Company Name",
hintText: AppLocalizations.of(context)!.enterThis(
AppLocalizations.of(context)!.companyName),
margin: getMargin(top: 6),
padding: TextFormFieldPadding.PaddingT12,
textInputType: TextInputType.text
),
Padding(
padding: getPadding(top: 19),
child: Text("Email",
child: Text(AppLocalizations.of(context)!.email,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
@@ -84,20 +89,23 @@ class _CreateAccountScreenState extends State<CreateAccountScreen> {
onChanged: _validateEmail,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Email';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.email);
}else if(!_isEmailValid){
return 'Please enter a valid email';
return AppLocalizations.of(context)!.validEmailShort;
}
return null;
},
hintText: "enter Email",
hintText: AppLocalizations.of(context)!
.enterThis(AppLocalizations.of(context)!.email),
margin: getMargin(top: 6),
padding: TextFormFieldPadding.PaddingT12,
textInputType: TextInputType.text
),
Padding(
padding: getPadding(top: 19),
child: Text("Mobile Number",
child: Text(
AppLocalizations.of(context)!.mobileNumber,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
@@ -111,17 +119,19 @@ class _CreateAccountScreenState extends State<CreateAccountScreen> {
onsaved: (value) => formData['mobile'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Mob No';
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("Workspace",
child: Text(AppLocalizations.of(context)!.workspace,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
@@ -131,18 +141,20 @@ class _CreateAccountScreenState extends State<CreateAccountScreen> {
onsaved: (value) => formData['workspace'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Workspace';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.workspace);
}
return null;
},
hintText: "enter Workspace",
hintText: AppLocalizations.of(context)!.enterThis(
AppLocalizations.of(context)!.workspace),
margin: getMargin(top: 6),
padding: TextFormFieldPadding.PaddingT12,
textInputType: TextInputType.text
),
Padding(
padding: getPadding(top: 19),
child: Text("Gst Number",
child: Text(AppLocalizations.of(context)!.gstNumber,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
@@ -152,18 +164,20 @@ class _CreateAccountScreenState extends State<CreateAccountScreen> {
onsaved: (value) => formData['gstNumber'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Gst Number';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.gstNumber);
}
return null;
},
hintText: "enter Gst Number",
hintText: AppLocalizations.of(context)!.enterThis(
AppLocalizations.of(context)!.gstNumber),
margin: getMargin(top: 6),
padding: TextFormFieldPadding.PaddingT12,
textInputType: TextInputType.text
),
Padding(
padding: getPadding(top: 19),
child: Text("pancard",
child: Text(AppLocalizations.of(context)!.pancard,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
@@ -173,18 +187,21 @@ class _CreateAccountScreenState extends State<CreateAccountScreen> {
onsaved: (value) => formData['pancard'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Pancard';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.pancard);
}
return null;
},
hintText: "enter pancard",
hintText: AppLocalizations.of(context)!.enterThis(
AppLocalizations.of(context)!.pancard),
margin: getMargin(top: 6),
padding: TextFormFieldPadding.PaddingT12,
textInputType: TextInputType.text
),
Padding(
padding: getPadding(top: 19),
child: Text("Working",
child: Text(
AppLocalizations.of(context)!.workingField,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
@@ -194,11 +211,13 @@ class _CreateAccountScreenState extends State<CreateAccountScreen> {
onsaved: (value) => formData['working'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Working';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.workingField);
}
return null;
},
hintText: "enter Working",
hintText: AppLocalizations.of(context)!.enterThis(
AppLocalizations.of(context)!.workingField),
margin: getMargin(top: 6),
padding: TextFormFieldPadding.PaddingT12,
textInputType: TextInputType.text
@@ -208,7 +227,7 @@ class _CreateAccountScreenState extends State<CreateAccountScreen> {
child: CustomButton(
height: getVerticalSize(50),
width: getHorizontalSize(396),
text: "SUBMIT",
text: AppLocalizations.of(context)!.submitCaps,
margin: getMargin(top: 25),
onTap: () async {
if (_formKey.currentState!.validate()) {
@@ -234,11 +253,16 @@ class _CreateAccountScreenState extends State<CreateAccountScreen> {
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Error'),
content: Text('Account Creation Failed: $e'),
title: Text(AppLocalizations.of(context)!
.error),
content: Text(
AppLocalizations.of(context)!
.accountCreationFailed(
e.toString())),
actions: [
TextButton(
child: const Text('OK'),
child: Text(
AppLocalizations.of(context)!.ok),
onPressed: () {
Navigator.of(context).pop();
},
+54 -30
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import '../../l10n/app_localizations.dart';
import 'SignUpService.dart';
class CreateUserScreen extends StatefulWidget {
@@ -26,7 +27,8 @@ class _CreateUserScreenState extends State<CreateUserScreen> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Sign Up - Step ${_currentStep + 1}'),
title: Text(AppLocalizations.of(context)!
.signUpStep((_currentStep + 1).toString())),
),
body: Column(
children: [
@@ -46,14 +48,14 @@ class _CreateUserScreenState extends State<CreateUserScreen> {
_currentStep--;
});
},
child: const Text('Previous'),
child: Text(AppLocalizations.of(context)!.previous),
),
if (_currentStep < 2)
ElevatedButton(
onPressed: () {
_proceedToNextStep();
},
child: const Text('Next'),
child: Text(AppLocalizations.of(context)!.next),
),
],
),
@@ -125,79 +127,95 @@ class StepCreateAccountState extends State<StepCreateAccount> {
alignment: Alignment.center,
child: Column(
children: [
const Text('Step 1: Create Account'),
Text(AppLocalizations.of(context)!.step1CreateAccount),
TextFormField(
decoration: const InputDecoration(labelText: 'Company Name'),
decoration: InputDecoration(
labelText:
AppLocalizations.of(context)!.companyName),
onSaved: (value) => formData['companyName'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Company Name';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.companyName);
}
return null;
},
),
const SizedBox(height: 16),
TextFormField(
decoration: const InputDecoration(labelText: 'Email'),
decoration: InputDecoration(
labelText: AppLocalizations.of(context)!.email),
onSaved: (value) => formData['email'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Email';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.email);
}
return null;
},
),
const SizedBox(height: 16),
TextFormField(
decoration: const InputDecoration(labelText: 'Mobile No'),
decoration: InputDecoration(
labelText: AppLocalizations.of(context)!.mobileNo),
onSaved: (value) => formData['mobile'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Mob No';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.mobileNo);
}
return null;
},
),
const SizedBox(height: 16),
TextFormField(
decoration: const InputDecoration(labelText: 'Workspace'),
decoration: InputDecoration(
labelText: AppLocalizations.of(context)!.workspace),
onSaved: (value) => formData['workspace'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Workspace';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.workspace);
}
return null;
},
),
const SizedBox(height: 16),
TextFormField(
decoration: const InputDecoration(labelText: 'Gst Number'),
decoration: InputDecoration(
labelText: AppLocalizations.of(context)!.gstNumber),
onSaved: (value) => formData['gstNumber'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Gst Number';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.gstNumber);
}
return null;
},
),
const SizedBox(height: 16),
TextFormField(
decoration: const InputDecoration(labelText: 'pancard'),
decoration: InputDecoration(
labelText: AppLocalizations.of(context)!.pancard),
onSaved: (value) => formData['pancard'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Pancard';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.pancard);
}
return null;
},
),
const SizedBox(height: 16),
TextFormField(
decoration: const InputDecoration(labelText: 'Working'),
decoration: InputDecoration(
labelText:
AppLocalizations.of(context)!.workingField),
onSaved: (value) => formData['working'] = value,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Working';
return AppLocalizations.of(context)!.pleaseEnterThis(
AppLocalizations.of(context)!.workingField);
}
return null;
},
@@ -228,12 +246,15 @@ class StepCreateAccountState extends State<StepCreateAccount> {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Error'),
content: Text('Account Creation Failed: $e'),
return AlertDialog(
title: Text(
AppLocalizations.of(context)!.error),
content: Text(AppLocalizations.of(context)!
.accountCreationFailed(e.toString())),
actions: [
TextButton(
child: const Text('OK'),
child: Text(
AppLocalizations.of(context)!.ok),
onPressed: () {
Navigator.of(context).pop();
},
@@ -246,12 +267,12 @@ class StepCreateAccountState extends State<StepCreateAccount> {
}
}
},
child: const SizedBox(
child: SizedBox(
width: double.infinity,
height: 50,
child: Center(
child: Text(
'SUBMIT',
AppLocalizations.of(context)!.submitCaps,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
@@ -261,7 +282,9 @@ class StepCreateAccountState extends State<StepCreateAccount> {
),
),
),
if (accountId != null) Text('Selected Account ID: $accountId'),
if (accountId != null)
Text(AppLocalizations.of(context)!
.selectedAccountId(accountId!)),
],
),
);
@@ -284,7 +307,7 @@ class StepGetEmailVerificationState extends State<StepGetEmailVerification> {
Widget build(BuildContext context) {
return Container(
alignment: Alignment.center,
child: Text('Step 2: Get Email Verification'),
child: Text(AppLocalizations.of(context)!.step2EmailVerification),
);
}
}
@@ -303,7 +326,7 @@ class StepGetRegistrationState extends State<StepGetRegistration> {
Widget build(BuildContext context) {
return Container(
alignment: Alignment.center,
child: Text('Step 3: Get Registration'),
child: Text(AppLocalizations.of(context)!.step3GetRegistration),
);
}
}
@@ -313,14 +336,15 @@ class CreateAccountDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text('Create Account'),
content: Text('Account created successfully!'),
title: Text(AppLocalizations.of(context)!.createAccount),
content:
Text(AppLocalizations.of(context)!.accountCreatedSuccess),
actions: [
ElevatedButton(
onPressed: () {
Navigator.of(context).pop('12345'); // Pass the created account ID
},
child: Text('OK'),
child: Text(AppLocalizations.of(context)!.ok),
),
],
);
@@ -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 {
@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import '../../l10n/app_localizations.dart';
class StepGetEmailVerification extends StatefulWidget {
final LabeledGlobalKey<FormState> emailPasswordFormKey;
// final Function updateSignUpDetails;
@@ -67,7 +69,7 @@ class _StepGetEmailVerificationState extends State<StepGetEmailVerification> {
// validator: _validateNewPassword,
autofocus: mounted,
autocorrect: false,
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -76,7 +78,7 @@ class _StepGetEmailVerificationState extends State<StepGetEmailVerification> {
disabledBorder: InputBorder.none,
contentPadding:
EdgeInsets.only(left: 15, bottom: 11, top: 11, right: 15),
hintText: "email",
hintText: AppLocalizations.of(context)!.email,
hintStyle: TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),
style: const TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import '../../l10n/app_localizations.dart';
class StepGetRegistration extends StatefulWidget {
final LabeledGlobalKey<FormState> bankAccountFormKey;
// final Function updateSignUpDetails;
@@ -94,7 +96,7 @@ class _StepGetRegistrationState extends State<StepGetRegistration> {
widget.finalStepProccessing();
}
},
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -103,7 +105,7 @@ class _StepGetRegistrationState extends State<StepGetRegistration> {
disabledBorder: InputBorder.none,
contentPadding:
EdgeInsets.only(left: 15, bottom: 11, top: 11, right: 15),
hintText: "first name",
hintText: AppLocalizations.of(context)!.firstName,
hintStyle: TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),
style: const TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
@@ -153,7 +155,7 @@ class _StepGetRegistrationState extends State<StepGetRegistration> {
widget.finalStepProccessing();
}
},
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -162,7 +164,7 @@ class _StepGetRegistrationState extends State<StepGetRegistration> {
disabledBorder: InputBorder.none,
contentPadding:
EdgeInsets.only(left: 15, bottom: 11, top: 11, right: 15),
hintText: "last name",
hintText: AppLocalizations.of(context)!.lastName,
hintStyle: TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),
style: const TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
@@ -212,7 +214,7 @@ class _StepGetRegistrationState extends State<StepGetRegistration> {
widget.finalStepProccessing();
}
},
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -221,7 +223,7 @@ class _StepGetRegistrationState extends State<StepGetRegistration> {
disabledBorder: InputBorder.none,
contentPadding:
EdgeInsets.only(left: 15, bottom: 11, top: 11, right: 15),
hintText: "mob no",
hintText: AppLocalizations.of(context)!.mobileNumber,
hintStyle: TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),
style: const TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
@@ -270,7 +272,7 @@ class _StepGetRegistrationState extends State<StepGetRegistration> {
widget.finalStepProccessing();
}
},
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -279,7 +281,7 @@ class _StepGetRegistrationState extends State<StepGetRegistration> {
disabledBorder: InputBorder.none,
contentPadding:
EdgeInsets.only(left: 15, bottom: 11, top: 11, right: 15),
hintText: "password",
hintText: AppLocalizations.of(context)!.password,
hintStyle: TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),
style: const TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
@@ -329,7 +331,7 @@ class _StepGetRegistrationState extends State<StepGetRegistration> {
widget.finalStepProccessing();
}
},
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -338,7 +340,8 @@ class _StepGetRegistrationState extends State<StepGetRegistration> {
disabledBorder: InputBorder.none,
contentPadding:
EdgeInsets.only(left: 15, bottom: 11, top: 11, right: 15),
hintText: "confirmPassword",
hintText:
AppLocalizations.of(context)!.confirmPassword,
hintStyle: TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),
style: const TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
+41 -21
View File
@@ -6,6 +6,7 @@ import 'package:pinput/pinput.dart';
import '../../Utils/color_constants.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';
@@ -101,7 +102,8 @@ class _SignUpUserScreenState extends State<SignUpUserScreenNew> {
Navigator.pop(context);
}),
centerTitle: true,
title: AppbarTitle(text: "Create User")),
title: AppbarTitle(
text: AppLocalizations.of(context)!.createUser)),
body: Builder(
builder: (BuildContext context) {
return SingleChildScrollView(
@@ -120,7 +122,7 @@ class _SignUpUserScreenState extends State<SignUpUserScreenNew> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text("Email",
Text(AppLocalizations.of(context)!.email,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyMedium16Bluegray900),
@@ -129,17 +131,21 @@ class _SignUpUserScreenState extends State<SignUpUserScreenNew> {
controller: emailcontroller,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter Email';
return AppLocalizations.of(context)!
.pleaseEnterThis(
AppLocalizations.of(context)!
.email);
}
return null;
},
hintText: "Enter Your Email",
hintText: AppLocalizations.of(context)!
.enterYourEmail,
margin: getMargin(top: 7),
textInputType: TextInputType.emailAddress),
CustomButton(
height: getVerticalSize(50),
width: getHorizontalSize(396),
text: "Send OTP",
text: AppLocalizations.of(context)!.sendOtp,
margin: getMargin(top: 25),
onTap: () async {
@@ -158,8 +164,9 @@ class _SignUpUserScreenState extends State<SignUpUserScreenNew> {
moveToNextStep();
} catch (e) {
showErrorMessage(
'Failed to send OTP: $e');
showErrorMessage(AppLocalizations.of(
context)!
.failedToSendOtp(e.toString()));
}
}
@@ -226,7 +233,8 @@ class _SignUpUserScreenState extends State<SignUpUserScreenNew> {
top: 29,
),
child: Text(
"Email Verification",
AppLocalizations.of(context)!
.emailVerification,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroySemiBold24,
@@ -242,7 +250,8 @@ class _SignUpUserScreenState extends State<SignUpUserScreenNew> {
right: 46,
),
child: Text(
"A mail with a 6-digit verification code was just sent to ${emailcontroller.text}",
AppLocalizations.of(context)!.otpSentToEmail(
emailcontroller.text),
maxLines: null,
textAlign: TextAlign.center,
style: AppStyle.txtGilroyMedium16,
@@ -276,7 +285,7 @@ class _SignUpUserScreenState extends State<SignUpUserScreenNew> {
height: getVerticalSize(
50,
),
text: "Next",
text: AppLocalizations.of(context)!.next,
margin: getMargin(
top: 40,
),
@@ -287,9 +296,12 @@ class _SignUpUserScreenState extends State<SignUpUserScreenNew> {
moveToNextStep();
showSuccessMessage(
'Email verified successfully');
AppLocalizations.of(context)!
.emailVerifiedSuccess);
} catch (e) {
showErrorMessage('Failed to verify OTP: $e');
showErrorMessage(AppLocalizations.of(
context)!
.failedToVerifyOtp(e.toString()));
}
},
),
@@ -300,19 +312,24 @@ class _SignUpUserScreenState extends State<SignUpUserScreenNew> {
await Future.delayed(
const Duration(seconds: 5));
showSuccessMessage('OTP RESEND');
showSuccessMessage(AppLocalizations.of(
context)!
.otpResent);
} catch (e) {
showErrorMessage(
'Failed to resend OTP: $e');
showErrorMessage(AppLocalizations.of(
context)!
.failedToResendOtp(e.toString()));
}
},
child: Padding(
padding: getPadding(top: 3),
child: Text("Forgot Password?",
child: Text(
AppLocalizations.of(context)!
.forgotPasswordLink,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style:
AppStyle.txtGilroyMedium14BlueA700)),
style: AppStyle
.txtGilroyMedium14BlueA700)),
),
@@ -330,7 +347,8 @@ class _SignUpUserScreenState extends State<SignUpUserScreenNew> {
top: 2,
),
child: Text(
"Didn’t get the code?",
AppLocalizations.of(context)!
.didntGetCode,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyMedium16,
@@ -342,7 +360,8 @@ class _SignUpUserScreenState extends State<SignUpUserScreenNew> {
bottom: 1,
),
child: Text(
"Resend",
AppLocalizations.of(context)!
.resend,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroySemiBold16BlueA700,
@@ -364,7 +383,8 @@ class _SignUpUserScreenState extends State<SignUpUserScreenNew> {
height: getVerticalSize(
50,
),
text: "Go to Registration Details",
text: AppLocalizations.of(context)!
.goToRegistrationDetails,
margin: getMargin(
top: 40,
),
+22 -13
View File
@@ -3,6 +3,7 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import '../../hadwin_components.dart';
import '../../l10n/app_localizations.dart';
import '../../utilities/slide_right_route.dart';
import '../Login Screen/login_screen.dart';
import 'StepGetEmailVerification.dart';
@@ -151,12 +152,13 @@ class _SignUpStepsState extends State<SignUpSteps> {
const EdgeInsets.symmetric(vertical: 3.6, horizontal: 10),
child: RichText(
text: TextSpan(
text: 'By signing up you are agreeing to the ',
text: AppLocalizations.of(context)!.termsAgreePrefix,
style: const TextStyle(
fontSize: 14, color: Color(0xFF929BAB)),
children: <InlineSpan>[
TextSpan(
text: 'Terms & Conditions',
text: AppLocalizations.of(context)!
.termsConditions,
style: const TextStyle(
fontSize: 14, color: Colors.blue),
recognizer: TapGestureRecognizer()
@@ -167,19 +169,23 @@ class _SignUpStepsState extends State<SignUpSteps> {
() => Navigator.push(
context,
SlideRightRoute(
page: const HadWinMarkdownViewer(
screenName: "Terms & Conditons",
page: HadWinMarkdownViewer(
screenName:
AppLocalizations.of(context)!
.termsConditions,
urlRequested:
'https://raw.githubusercontent.com/brownboycodes/HADWIN/master/docs/TERMS_AND_CONDITIONS.md',
))));
}),
const TextSpan(
text: ' and our ',
TextSpan(
text:
AppLocalizations.of(context)!.termsAndOur,
style:
TextStyle(fontSize: 14, color: Color(0xFF929BAB)),
),
TextSpan(
text: 'End User License Agreement',
text:
AppLocalizations.of(context)!.eula,
style: const TextStyle(
fontSize: 14, color: Colors.blue),
recognizer: TapGestureRecognizer()
@@ -190,9 +196,10 @@ class _SignUpStepsState extends State<SignUpSteps> {
() => Navigator.push(
context,
SlideRightRoute(
page: const HadWinMarkdownViewer(
page: HadWinMarkdownViewer(
screenName:
"End User License Agreement",
AppLocalizations.of(context)!
.eula,
urlRequested:
'https://raw.githubusercontent.com/brownboycodes/HADWIN/master/docs/END_USER_LICENSE_AGREEMENT.md',
))));
@@ -311,8 +318,9 @@ class _SignUpStepsState extends State<SignUpSteps> {
if (stepHasError[_currentStep] == false && mounted) {
ScaffoldMessenger.of(context)
.showSnackBar(
const SnackBar(
content: Text('Processing'),
SnackBar(
content:
Text(AppLocalizations.of(context)!.processingPlain),
backgroundColor: Colors.blue,
// onVisible: _tryRegistering,
),
@@ -487,8 +495,9 @@ class _SignUpStepsState extends State<SignUpSteps> {
print('Account succesfully created');
ScaffoldMessenger.of(context)
.showSnackBar(const SnackBar(
content: Text("Account Created Successfully"),
.showSnackBar(SnackBar(
content: Text(AppLocalizations.of(context)!
.accountCreatedSuccess),
backgroundColor: Colors.green))
.closed
.then((value) => Navigator.of(context).pushAndRemoveUntil(
@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import '../../l10n/app_localizations.dart';
class StepCreateAccount extends StatefulWidget {
final LabeledGlobalKey<FormState> nameAddressFormKey;
// final Function updateSignUpDetails;
@@ -99,7 +101,7 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
validator: _validatecompanyName,
autofocus: mounted,
autocorrect: false,
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -108,7 +110,8 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
disabledBorder: InputBorder.none,
contentPadding: EdgeInsets.only(
left: 15, bottom: 11, top: 11, right: 15),
hintText: "Company_Name",
hintText:
AppLocalizations.of(context)!.companyName,
hintStyle:
TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),
@@ -155,7 +158,7 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
// validator: _validatelastName,
autofocus: mounted,
autocorrect: false,
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -164,7 +167,8 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
disabledBorder: InputBorder.none,
contentPadding: EdgeInsets.only(
left: 15, bottom: 11, top: 11, right: 15),
hintText: "email",
hintText:
AppLocalizations.of(context)!.email,
hintStyle:
TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),
@@ -213,7 +217,7 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
// validator: _validatemobno,
autofocus: mounted,
autocorrect: false,
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -222,7 +226,8 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
disabledBorder: InputBorder.none,
contentPadding: EdgeInsets.only(
left: 15, bottom: 11, top: 11, right: 15),
hintText: "mob_no",
hintText: AppLocalizations.of(context)!
.mobileNumber,
hintStyle:
TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),
@@ -271,7 +276,7 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
// validator: _validatelastName,
autofocus: mounted,
autocorrect: false,
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -280,7 +285,8 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
disabledBorder: InputBorder.none,
contentPadding: EdgeInsets.only(
left: 15, bottom: 11, top: 11, right: 15),
hintText: "workspace",
hintText:
AppLocalizations.of(context)!.workspace,
hintStyle:
TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),
@@ -327,7 +333,7 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
// validator: _validatelastName,
autofocus: mounted,
autocorrect: false,
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -336,7 +342,8 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
disabledBorder: InputBorder.none,
contentPadding: EdgeInsets.only(
left: 15, bottom: 11, top: 11, right: 15),
hintText: "gst number",
hintText:
AppLocalizations.of(context)!.gstNumber,
hintStyle:
TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),
@@ -383,7 +390,7 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
// validator: _validatelastName,
autofocus: mounted,
autocorrect: false,
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -392,7 +399,8 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
disabledBorder: InputBorder.none,
contentPadding: EdgeInsets.only(
left: 15, bottom: 11, top: 11, right: 15),
hintText: "pancard",
hintText:
AppLocalizations.of(context)!.pancard,
hintStyle:
TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),
@@ -439,7 +447,7 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
// validator: _validatelastName,
autofocus: mounted,
autocorrect: false,
decoration: const InputDecoration(
decoration: InputDecoration(
fillColor: Colors.white,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@@ -448,7 +456,8 @@ class _StepCreateAccountState extends State<StepCreateAccount> {
disabledBorder: InputBorder.none,
contentPadding: EdgeInsets.only(
left: 15, bottom: 11, top: 11, right: 15),
hintText: "working",
hintText: AppLocalizations.of(context)!
.workingField,
hintStyle:
TextStyle(fontSize: 16, color: Color(0xFF929BAB)),
),