add locale to app using intl

This commit is contained in:
周强
2021-12-12 10:13:32 +08:00
parent 13bd12cfe9
commit e1ed4c65f6
3 changed files with 7 additions and 7 deletions

View File

@@ -58,7 +58,7 @@ class _ResetPasswordRequestPageState extends TbPageState<ResetPasswordRequestPag
),
SizedBox(height: 61),
FormBuilderTextField(
name: '${S.of(context).email}',
name: 'email',
autofocus: true,
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(context, errorText: '${S.of(context).emailRequireText}'),

View File

@@ -51,7 +51,7 @@ class _ChangePasswordPageState extends TbContextState<ChangePasswordPage> {
valueListenable: _showCurrentPasswordNotifier,
builder: (BuildContext context, bool showPassword, child) {
return FormBuilderTextField(
name: '${S.of(context).currentPassword}',
name: 'currentPassword',
obscureText: !showPassword,
autofocus: true,
validator: FormBuilderValidators.compose([
@@ -75,7 +75,7 @@ class _ChangePasswordPageState extends TbContextState<ChangePasswordPage> {
valueListenable: _showNewPasswordNotifier,
builder: (BuildContext context, bool showPassword, child) {
return FormBuilderTextField(
name: '${S.of(context).newPassword}',
name: 'newPassword',
obscureText: !showPassword,
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(context, errorText: '${S.of(context).newPasswordRequireText}')
@@ -98,7 +98,7 @@ class _ChangePasswordPageState extends TbContextState<ChangePasswordPage> {
valueListenable: _showNewPassword2Notifier,
builder: (BuildContext context, bool showPassword, child) {
return FormBuilderTextField(
name: '${S.of(context).newPassword2}',
name: 'newPassword2',
obscureText: !showPassword,
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(context, errorText: '${S.of(context).newPassword2RequireText}')

View File

@@ -81,7 +81,7 @@ class _ProfilePageState extends TbPageState<ProfilePage> {
children: [
SizedBox(height: 16),
FormBuilderTextField(
name: '${S.of(context).email}',
name: 'email',
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(context, errorText: '${S.of(context).emailRequireText}'),
FormBuilderValidators.email(context, errorText: '${S.of(context).emailInvalidText}')
@@ -93,7 +93,7 @@ class _ProfilePageState extends TbPageState<ProfilePage> {
),
SizedBox(height: 24),
FormBuilderTextField(
name: '${S.of(context).firstName}',
name: 'firstName',
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: '${S.of(context).firstNameUpper}'
@@ -101,7 +101,7 @@ class _ProfilePageState extends TbPageState<ProfilePage> {
),
SizedBox(height: 24),
FormBuilderTextField(
name: '${S.of(context).lastName}',
name: 'lastName',
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: '${S.of(context).lastNameUpper}'