Toggle navigation
Toggle navigation
This project
Loading...
Sign in
OnePoem
/
OnePoem-App
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
reason
2022-01-03 13:51:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ab8481691d8308ac2227c3e80b4a25a274d6a7d9
ab848169
1 parent
b760ee55
i18n页面修改
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
317 additions
and
63 deletions
lib/account/page/account_edit_page.dart
lib/generated/intl/messages_en.dart
lib/generated/intl/messages_zh.dart
lib/generated/l10n.dart
lib/l10n/intl_en.arb
lib/l10n/intl_zh.arb
lib/setting/page/locale_page.dart
lib/account/page/account_edit_page.dart
View file @
ab84816
...
...
@@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart';
import
'package:one_poem/extension/int_extension.dart'
;
import
'package:one_poem/widgets/my_app_bar.dart'
;
import
'package:flutter_gen/gen_l10n/one_poem_localizations.dart'
;
class
AccountEditPage
extends
StatefulWidget
{
const
AccountEditPage
({
Key
?
key
})
:
super
(
key:
key
);
...
...
@@ -60,15 +61,17 @@ class MapScreenState extends State<AccountEditPage>
],
),
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
90.0
,
right:
100.0
),
padding:
EdgeInsets
.
only
(
top:
90
.
px
,
right:
100
.
px
,
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
const
<
Widget
>[
children:
<
Widget
>[
CircleAvatar
(
backgroundColor:
Colors
.
red
,
radius:
25.
0
,
child:
Icon
(
radius:
25
.
px
,
child:
const
Icon
(
Icons
.
camera_alt
,
color:
Colors
.
white
,
),
...
...
@@ -83,16 +86,16 @@ class MapScreenState extends State<AccountEditPage>
Container
(
color:
const
Color
(
0xffFFFFFF
),
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
),
padding:
EdgeInsets
.
only
(
bottom:
5
.
px
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
<
Widget
>[
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
25.
0
,
right:
25.
0
,
top:
5.
0
,
padding:
EdgeInsets
.
only
(
left:
25
.
px
,
right:
25
.
px
,
top:
5
.
px
,
),
child:
Row
(
mainAxisAlignment:
...
...
@@ -102,11 +105,11 @@ class MapScreenState extends State<AccountEditPage>
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
const
<
Widget
>[
children:
<
Widget
>[
Text
(
'个人信息'
,
OnePoemLocalizations
.
of
(
context
).
accountEditPageUserInfo
,
style:
TextStyle
(
fontSize:
18.
0
,
fontSize:
18
.
px
,
fontWeight:
FontWeight
.
bold
),
),
],
...
...
@@ -121,19 +124,19 @@ class MapScreenState extends State<AccountEditPage>
],
)),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
25.
0
,
right:
25.0
,
top:
25.0
),
padding:
EdgeInsets
.
only
(
left:
25
.
px
,
right:
25
.
px
,
top:
25
.
px
),
child:
Row
(
mainAxisSize:
MainAxisSize
.
max
,
children:
<
Widget
>[
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
const
<
Widget
>[
children:
<
Widget
>[
Text
(
'姓名'
,
OnePoemLocalizations
.
of
(
context
).
accountEditPageUserName
,
style:
TextStyle
(
fontSize:
16.
0
,
fontSize:
16
.
px
,
fontWeight:
FontWeight
.
bold
),
),
],
...
...
@@ -141,15 +144,18 @@ class MapScreenState extends State<AccountEditPage>
],
)),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
25.0
,
right:
25.0
,
top:
2.0
),
padding:
EdgeInsets
.
only
(
left:
25
.
px
,
right:
25
.
px
,
top:
2
.
px
,
),
child:
Row
(
mainAxisSize:
MainAxisSize
.
max
,
children:
<
Widget
>[
Flexible
(
child:
TextField
(
decoration:
const
InputDecoration
(
hintText:
"请输入您的名称"
,
decoration:
InputDecoration
(
hintText:
OnePoemLocalizations
.
of
(
context
).
accountEditPageUserNamePlaceholder
,
),
enabled:
!
_status
,
autofocus:
!
_status
,
...
...
@@ -158,19 +164,22 @@ class MapScreenState extends State<AccountEditPage>
],
)),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
25.0
,
right:
25.0
,
top:
25.0
),
padding:
EdgeInsets
.
only
(
left:
25
.
px
,
right:
25
.
px
,
top:
25
.
px
,
),
child:
Row
(
mainAxisSize:
MainAxisSize
.
max
,
children:
<
Widget
>[
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
const
<
Widget
>[
children:
<
Widget
>[
Text
(
'邮箱'
,
OnePoemLocalizations
.
of
(
context
).
accountEditPageUserEmail
,
style:
TextStyle
(
fontSize:
16.
0
,
fontSize:
16
.
px
,
fontWeight:
FontWeight
.
bold
),
),
],
...
...
@@ -178,15 +187,18 @@ class MapScreenState extends State<AccountEditPage>
],
)),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
25.0
,
right:
25.0
,
top:
2.0
),
padding:
EdgeInsets
.
only
(
left:
25
.
px
,
right:
25
.
px
,
top:
2
.
px
,
),
child:
Row
(
mainAxisSize:
MainAxisSize
.
max
,
children:
<
Widget
>[
Flexible
(
child:
TextField
(
decoration:
const
InputDecoration
(
hintText:
"请输入您的邮箱"
,
decoration:
InputDecoration
(
hintText:
OnePoemLocalizations
.
of
(
context
).
accountEditPageUserEmailPlaceholder
,
),
enabled:
!
_status
,
),
...
...
@@ -194,19 +206,22 @@ class MapScreenState extends State<AccountEditPage>
],
)),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
25.0
,
right:
25.0
,
top:
25.0
),
padding:
EdgeInsets
.
only
(
left:
25
.
px
,
right:
25
.
px
,
top:
25
.
px
,
),
child:
Row
(
mainAxisSize:
MainAxisSize
.
max
,
children:
<
Widget
>[
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
const
<
Widget
>[
children:
<
Widget
>[
Text
(
'手机号'
,
OnePoemLocalizations
.
of
(
context
).
accountEditPageUserPhone
,
style:
TextStyle
(
fontSize:
16.
0
,
fontSize:
16
.
px
,
fontWeight:
FontWeight
.
bold
),
),
],
...
...
@@ -214,15 +229,18 @@ class MapScreenState extends State<AccountEditPage>
],
)),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
25.0
,
right:
25.0
,
top:
2.0
),
padding:
EdgeInsets
.
only
(
left:
25
.
px
,
right:
25
.
px
,
top:
2
.
px
,
),
child:
Row
(
mainAxisSize:
MainAxisSize
.
max
,
children:
<
Widget
>[
Flexible
(
child:
TextField
(
decoration:
const
InputDecoration
(
hintText:
"请输入您的手机号"
,
decoration:
InputDecoration
(
hintText:
OnePoemLocalizations
.
of
(
context
).
accountEditPageUserPhonePlaceholder
,
),
enabled:
!
_status
,
),
...
...
@@ -230,17 +248,20 @@ class MapScreenState extends State<AccountEditPage>
],
)),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
25.0
,
right:
25.0
,
top:
25.0
),
padding:
EdgeInsets
.
only
(
left:
25
.
px
,
right:
25
.
px
,
top:
25
.
px
,
),
child:
Row
(
mainAxisSize:
MainAxisSize
.
max
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
const
<
Widget
>[
children:
<
Widget
>[
Expanded
(
child:
Text
(
'性别'
,
OnePoemLocalizations
.
of
(
context
).
accountEditPageUserGender
,
style:
TextStyle
(
fontSize:
16.
0
,
fontSize:
16
.
px
,
fontWeight:
FontWeight
.
bold
,
),
),
...
...
@@ -248,9 +269,9 @@ class MapScreenState extends State<AccountEditPage>
),
Expanded
(
child:
Text
(
'出生日期'
,
OnePoemLocalizations
.
of
(
context
).
accountEditPageUserBirthday
,
style:
TextStyle
(
fontSize:
16.
0
,
fontSize:
16
.
px
,
fontWeight:
FontWeight
.
bold
,
),
),
...
...
@@ -259,19 +280,21 @@ class MapScreenState extends State<AccountEditPage>
],
)),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
25.0
,
right:
25.0
,
top:
2.0
),
padding:
EdgeInsets
.
only
(
left:
25
.
px
,
right:
25
.
px
,
top:
2
.
px
,
),
child:
Row
(
mainAxisSize:
MainAxisSize
.
max
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
<
Widget
>[
Flexible
(
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
right:
10.0
),
padding:
EdgeInsets
.
only
(
right:
10
.
px
),
child:
TextField
(
decoration:
const
InputDecoration
(
hintText:
"请选择性别"
),
decoration:
InputDecoration
(
hintText:
OnePoemLocalizations
.
of
(
context
).
accountEditPageUserGenderPlaceholder
,
),
enabled:
!
_status
,
),
),
...
...
@@ -279,8 +302,8 @@ class MapScreenState extends State<AccountEditPage>
),
Flexible
(
child:
TextField
(
decoration:
const
InputDecoration
(
hintText:
"请输入出生日期"
),
decoration:
InputDecoration
(
hintText:
OnePoemLocalizations
.
of
(
context
).
accountEditPageUserBirthdayPlaceholder
,
),
enabled:
!
_status
,
),
flex:
2
,
...
...
@@ -308,14 +331,18 @@ class MapScreenState extends State<AccountEditPage>
Widget
_getActionButtons
()
{
return
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
25.0
,
right:
25.0
,
top:
45.0
),
padding:
EdgeInsets
.
only
(
left:
25
.
px
,
right:
25
.
px
,
top:
45
.
px
,
),
child:
Row
(
mainAxisSize:
MainAxisSize
.
max
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
<
Widget
>[
Expanded
(
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
right:
10.0
),
padding:
EdgeInsets
.
only
(
right:
10
.
px
),
child:
ElevatedButton
(
child:
const
Text
(
"保存"
),
onPressed:
()
{
...
...
@@ -330,7 +357,7 @@ class MapScreenState extends State<AccountEditPage>
),
Expanded
(
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
10.0
),
padding:
EdgeInsets
.
only
(
left:
10
.
px
),
child:
ElevatedButton
(
style:
ButtonStyle
(
backgroundColor:
MaterialStateProperty
.
all
(
Colors
.
red
)),
...
...
@@ -352,13 +379,13 @@ class MapScreenState extends State<AccountEditPage>
Widget
_getEditIcon
()
{
return
GestureDetector
(
child:
const
CircleAvatar
(
child:
CircleAvatar
(
backgroundColor:
Colors
.
red
,
radius:
14.
0
,
radius:
14
.
px
,
child:
Icon
(
Icons
.
edit
,
color:
Colors
.
white
,
size:
16.
0
,
size:
16
.
px
,
),
),
onTap:
()
{
...
...
lib/generated/intl/messages_en.dart
View file @
ab84816
...
...
@@ -22,6 +22,28 @@ class MessageLookup extends MessageLookupByLibrary {
final
messages
=
_notInlinedMessages
(
_notInlinedMessages
);
static
Map
<
String
,
Function
>
_notInlinedMessages
(
_
)
=>
<
String
,
Function
>{
"accountEditPageUserBirthday"
:
MessageLookupByLibrary
.
simpleMessage
(
"Birthday"
),
"accountEditPageUserBirthdayPlaceholder"
:
MessageLookupByLibrary
.
simpleMessage
(
"Please input birthday"
),
"accountEditPageUserEmail"
:
MessageLookupByLibrary
.
simpleMessage
(
"Email"
),
"accountEditPageUserEmailPlaceholder"
:
MessageLookupByLibrary
.
simpleMessage
(
"Please input Email"
),
"accountEditPageUserGender"
:
MessageLookupByLibrary
.
simpleMessage
(
"Gender"
),
"accountEditPageUserGenderPlaceholder"
:
MessageLookupByLibrary
.
simpleMessage
(
"Please choose gender"
),
"accountEditPageUserInfo"
:
MessageLookupByLibrary
.
simpleMessage
(
"User Info"
),
"accountEditPageUserName"
:
MessageLookupByLibrary
.
simpleMessage
(
"User Name"
),
"accountEditPageUserNamePlaceholder"
:
MessageLookupByLibrary
.
simpleMessage
(
"Please input User Name"
),
"accountEditPageUserPhone"
:
MessageLookupByLibrary
.
simpleMessage
(
"Phone"
),
"accountEditPageUserPhonePlaceholder"
:
MessageLookupByLibrary
.
simpleMessage
(
"Please input Phone"
),
"categoryBottomNavigationBarItemTitle"
:
MessageLookupByLibrary
.
simpleMessage
(
"category"
),
"confirm"
:
MessageLookupByLibrary
.
simpleMessage
(
"Confirm"
),
...
...
lib/generated/intl/messages_zh.dart
View file @
ab84816
...
...
@@ -22,6 +22,23 @@ class MessageLookup extends MessageLookupByLibrary {
final
messages
=
_notInlinedMessages
(
_notInlinedMessages
);
static
Map
<
String
,
Function
>
_notInlinedMessages
(
_
)
=>
<
String
,
Function
>{
"accountEditPageUserBirthday"
:
MessageLookupByLibrary
.
simpleMessage
(
"出生日期"
),
"accountEditPageUserBirthdayPlaceholder"
:
MessageLookupByLibrary
.
simpleMessage
(
"请输入出生日期"
),
"accountEditPageUserEmail"
:
MessageLookupByLibrary
.
simpleMessage
(
"邮箱"
),
"accountEditPageUserEmailPlaceholder"
:
MessageLookupByLibrary
.
simpleMessage
(
"请输入您的邮箱"
),
"accountEditPageUserGender"
:
MessageLookupByLibrary
.
simpleMessage
(
"性别"
),
"accountEditPageUserGenderPlaceholder"
:
MessageLookupByLibrary
.
simpleMessage
(
"请选择性别"
),
"accountEditPageUserInfo"
:
MessageLookupByLibrary
.
simpleMessage
(
"个人信息"
),
"accountEditPageUserName"
:
MessageLookupByLibrary
.
simpleMessage
(
"姓名"
),
"accountEditPageUserNamePlaceholder"
:
MessageLookupByLibrary
.
simpleMessage
(
"请输入您的名称"
),
"accountEditPageUserPhone"
:
MessageLookupByLibrary
.
simpleMessage
(
"手机号"
),
"accountEditPageUserPhonePlaceholder"
:
MessageLookupByLibrary
.
simpleMessage
(
"请输入您的手机号"
),
"categoryBottomNavigationBarItemTitle"
:
MessageLookupByLibrary
.
simpleMessage
(
"众妙"
),
"confirm"
:
MessageLookupByLibrary
.
simpleMessage
(
"确认"
),
...
...
lib/generated/l10n.dart
View file @
ab84816
...
...
@@ -269,6 +269,116 @@ class S {
args:
[],
);
}
/// `User Info`
String
get
accountEditPageUserInfo
{
return
Intl
.
message
(
'User Info'
,
name:
'accountEditPageUserInfo'
,
desc:
''
,
args:
[],
);
}
/// `User Name`
String
get
accountEditPageUserName
{
return
Intl
.
message
(
'User Name'
,
name:
'accountEditPageUserName'
,
desc:
'User Name'
,
args:
[],
);
}
/// `Please input User Name`
String
get
accountEditPageUserNamePlaceholder
{
return
Intl
.
message
(
'Please input User Name'
,
name:
'accountEditPageUserNamePlaceholder'
,
desc:
'User Name'
,
args:
[],
);
}
/// `Email`
String
get
accountEditPageUserEmail
{
return
Intl
.
message
(
'Email'
,
name:
'accountEditPageUserEmail'
,
desc:
'User Name'
,
args:
[],
);
}
/// `Please input Email`
String
get
accountEditPageUserEmailPlaceholder
{
return
Intl
.
message
(
'Please input Email'
,
name:
'accountEditPageUserEmailPlaceholder'
,
desc:
'Email'
,
args:
[],
);
}
/// `Phone`
String
get
accountEditPageUserPhone
{
return
Intl
.
message
(
'Phone'
,
name:
'accountEditPageUserPhone'
,
desc:
'Phone'
,
args:
[],
);
}
/// `Please input Phone`
String
get
accountEditPageUserPhonePlaceholder
{
return
Intl
.
message
(
'Please input Phone'
,
name:
'accountEditPageUserPhonePlaceholder'
,
desc:
'Phone'
,
args:
[],
);
}
/// `Gender`
String
get
accountEditPageUserGender
{
return
Intl
.
message
(
'Gender'
,
name:
'accountEditPageUserGender'
,
desc:
'Gender'
,
args:
[],
);
}
/// `Please choose gender`
String
get
accountEditPageUserGenderPlaceholder
{
return
Intl
.
message
(
'Please choose gender'
,
name:
'accountEditPageUserGenderPlaceholder'
,
desc:
'Gender'
,
args:
[],
);
}
/// `Birthday`
String
get
accountEditPageUserBirthday
{
return
Intl
.
message
(
'Birthday'
,
name:
'accountEditPageUserBirthday'
,
desc:
'Birthday'
,
args:
[],
);
}
/// `Please input birthday`
String
get
accountEditPageUserBirthdayPlaceholder
{
return
Intl
.
message
(
'Please input birthday'
,
name:
'accountEditPageUserBirthdayPlaceholder'
,
desc:
'Birthday'
,
args:
[],
);
}
}
class
AppLocalizationDelegate
extends
LocalizationsDelegate
<
S
>
{
...
...
lib/l10n/intl_en.arb
View file @
ab84816
...
...
@@ -130,5 +130,72 @@
"description"
:
"One Poem"
,
"type"
:
"text"
,
"placeholders"
:
{}
},
"accountEditPageUserInfo"
:
"User Info"
,
"@accountEditPageTitle"
:
{
"description"
:
"User Info"
,
"type"
:
"text"
,
"placeholders"
:
{}
},
"accountEditPageUserName"
:
"User Name"
,
"@accountEditPageUserName"
:
{
"description"
:
"User Name"
,
"type"
:
"text"
,
"placeholders"
:
{}
},
"accountEditPageUserNamePlaceholder"
:
"Please input User Name"
,
"@accountEditPageUserNamePlaceholder"
:
{
"description"
:
"User Name"
,
"type"
:
"text"
,
"placeholders"
:
{}
},
"accountEditPageUserEmail"
:
"Email"
,
"@accountEditPageUserEmail"
:
{
"description"
:
"User Name"
,
"type"
:
"text"
,
"placeholders"
:
{}
},
"accountEditPageUserEmailPlaceholder"
:
"Please input Email"
,
"@accountEditPageUserEmailPlaceholder"
:
{
"description"
:
"Email"
,
"type"
:
"text"
,
"placeholders"
:
{}
},
"accountEditPageUserPhone"
:
"Phone"
,
"@accountEditPageUserPhone"
:
{
"description"
:
"Phone"
,
"type"
:
"text"
,
"placeholders"
:
{}
},
"accountEditPageUserPhonePlaceholder"
:
"Please input Phone"
,
"@accountEditPageUserPhonePlaceholder"
:
{
"description"
:
"Phone"
,
"type"
:
"text"
,
"placeholders"
:
{}
},
"accountEditPageUserGender"
:
"Gender"
,
"@accountEditPageUserGender"
:
{
"description"
:
"Gender"
,
"type"
:
"text"
,
"placeholders"
:
{}
},
"accountEditPageUserGenderPlaceholder"
:
"Please choose gender"
,
"@accountEditPageUserGenderPlaceholder"
:
{
"description"
:
"Gender"
,
"type"
:
"text"
,
"placeholders"
:
{}
},
"accountEditPageUserBirthday"
:
"Birthday"
,
"@accountEditPageUserBirthday"
:
{
"description"
:
"Birthday"
,
"type"
:
"text"
,
"placeholders"
:
{}
},
"accountEditPageUserBirthdayPlaceholder"
:
"Please input birthday"
,
"@accountEditPageUserBirthdayPlaceholder"
:
{
"description"
:
"Birthday"
,
"type"
:
"text"
,
"placeholders"
:
{}
}
}
\ No newline at end of file
...
...
lib/l10n/intl_zh.arb
View file @
ab84816
...
...
@@ -20,5 +20,17 @@
"onePoemBottomNavigationBarItemTitle"
:
"一言"
,
"timelineBottomNavigationBarItemTitle"
:
"临境"
,
"categoryBottomNavigationBarItemTitle"
:
"众妙"
,
"profileBottomNavigationBarItemTitle"
:
"我在"
"profileBottomNavigationBarItemTitle"
:
"我在"
,
"accountEditPageUserInfo"
:
"个人信息"
,
"accountEditPageUserName"
:
"姓名"
,
"accountEditPageUserNamePlaceholder"
:
"请输入您的名称"
,
"accountEditPageUserEmail"
:
"邮箱"
,
"accountEditPageUserEmailPlaceholder"
:
"请输入您的邮箱"
,
"accountEditPageUserPhone"
:
"手机号"
,
"accountEditPageUserPhonePlaceholder"
:
"请输入您的手机号"
,
"accountEditPageUserGender"
:
"性别"
,
"accountEditPageUserGenderPlaceholder"
:
"请选择性别"
,
"accountEditPageUserBirthday"
:
"出生日期"
,
"accountEditPageUserBirthdayPlaceholder"
:
"请输入出生日期"
}
\ No newline at end of file
...
...
lib/setting/page/locale_page.dart
View file @
ab84816
...
...
@@ -52,7 +52,6 @@ class _LocalePageState extends State<LocalePage> {
final
String
locale
=
index
==
0
?
''
:
(
index
==
1
?
'zh'
:
'en'
);
context
.
read
<
LocaleProvider
>().
setLocale
(
locale
);
Toast
.
show
(
'当前功能仅登录模块有效'
);
setState
(()
{});
},
child:
Container
(
...
...
Please
register
or
login
to post a comment