Compare commits
2 Commits
f4d0243de0
...
57968f7935
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57968f7935 | ||
|
|
00ff77a49a |
@@ -20,13 +20,6 @@ class _HomePageState extends State<HomePage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// _setLanguage();
|
||||
}
|
||||
void _setLanguage() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
String preLanguage = prefs.getString("language") ?? "";
|
||||
Locale locale = preLanguage == "" ? Locale(preLanguage) : Localizations.localeOf(context);
|
||||
S.load(locale);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -52,7 +45,7 @@ class _HomePageState extends State<HomePage> {
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
'全方位照護守護者',
|
||||
S.of(context).app_name,
|
||||
style: TextStyle(fontSize: 24, height: 5),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -47,7 +47,7 @@ class _MessagePageState extends State<MessagePage> {
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
'全方位照護守護者',
|
||||
S.of(context).app_name,
|
||||
style: TextStyle(fontSize: 24, height: 5),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -160,7 +160,7 @@ class _PersonalInfoState extends State<PersonalInfo> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
_username + ' 您好',
|
||||
S.of(context).welcome_message(_username),
|
||||
style: TextStyle(fontSize: 28, color: Colors.black),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -255,7 +255,7 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'全方位照護守護者',
|
||||
S.of(context).app_name,
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -31,12 +31,16 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
|
||||
static String m4(displayIndex) => "ID: ${displayIndex}";
|
||||
|
||||
static String m5(username) => "Welcome, ${username}!";
|
||||
|
||||
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
|
||||
"account_setting": MessageLookupByLibrary.simpleMessage("Account"),
|
||||
"additional_information":
|
||||
MessageLookupByLibrary.simpleMessage("Knowledge"),
|
||||
"address": MessageLookupByLibrary.simpleMessage("Address"),
|
||||
"app_name":
|
||||
MessageLookupByLibrary.simpleMessage("Comprehensive Care Guardian"),
|
||||
"basic_information_setting":
|
||||
MessageLookupByLibrary.simpleMessage("Basic Information"),
|
||||
"call_phone":
|
||||
@@ -99,6 +103,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"register_turn_back":
|
||||
MessageLookupByLibrary.simpleMessage("Return to Login Page"),
|
||||
"save": MessageLookupByLibrary.simpleMessage("Save"),
|
||||
"switch_camera": MessageLookupByLibrary.simpleMessage("Switch View")
|
||||
"switch_camera": MessageLookupByLibrary.simpleMessage("Switch View"),
|
||||
"welcome_message": m5
|
||||
};
|
||||
}
|
||||
|
||||
@@ -31,11 +31,14 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
|
||||
static String m4(displayIndex) => "編號: ${displayIndex}";
|
||||
|
||||
static String m5(username) => "${username} 您好!";
|
||||
|
||||
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
|
||||
"account_setting": MessageLookupByLibrary.simpleMessage("帳號設定"),
|
||||
"additional_information": MessageLookupByLibrary.simpleMessage("知識補充"),
|
||||
"address": MessageLookupByLibrary.simpleMessage("地址"),
|
||||
"app_name": MessageLookupByLibrary.simpleMessage("全方位照護守護者"),
|
||||
"basic_information_setting":
|
||||
MessageLookupByLibrary.simpleMessage("基本資料"),
|
||||
"call_phone": MessageLookupByLibrary.simpleMessage("撥打電話"),
|
||||
@@ -89,6 +92,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"register_success": MessageLookupByLibrary.simpleMessage("註冊成功"),
|
||||
"register_turn_back": MessageLookupByLibrary.simpleMessage("返回登入頁面"),
|
||||
"save": MessageLookupByLibrary.simpleMessage("儲存變更"),
|
||||
"switch_camera": MessageLookupByLibrary.simpleMessage("切換畫面")
|
||||
"switch_camera": MessageLookupByLibrary.simpleMessage("切換畫面"),
|
||||
"welcome_message": m5
|
||||
};
|
||||
}
|
||||
|
||||
@@ -50,6 +50,16 @@ class S {
|
||||
return Localizations.of<S>(context, S);
|
||||
}
|
||||
|
||||
/// `Comprehensive Care Guardian`
|
||||
String get app_name {
|
||||
return Intl.message(
|
||||
'Comprehensive Care Guardian',
|
||||
name: 'app_name',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Email/Username`
|
||||
String get email_label {
|
||||
return Intl.message(
|
||||
@@ -270,6 +280,16 @@ class S {
|
||||
);
|
||||
}
|
||||
|
||||
/// `Welcome, {username}!`
|
||||
String welcome_message(Object username) {
|
||||
return Intl.message(
|
||||
'Welcome, $username!',
|
||||
name: 'welcome_message',
|
||||
desc: '',
|
||||
args: [username],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Basic Information`
|
||||
String get basic_information_setting {
|
||||
return Intl.message(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"app_name": "Comprehensive Care Guardian",
|
||||
"email_label": "Email/Username",
|
||||
"password_label": "Password",
|
||||
"login_button": "Login",
|
||||
@@ -25,6 +26,7 @@
|
||||
|
||||
"home": "Home",
|
||||
|
||||
"welcome_message": "Welcome, {username}!",
|
||||
"basic_information_setting": "Basic Information",
|
||||
"account_setting": "Account",
|
||||
"language_setting": "Language",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"app_name": "全方位照護守護者",
|
||||
"email_label": "電子信箱/帳號",
|
||||
"password_label": "密碼",
|
||||
"login_button": "登入",
|
||||
@@ -25,6 +26,7 @@
|
||||
|
||||
"home": "首頁",
|
||||
|
||||
"welcome_message": "{username} 您好!",
|
||||
"basic_information_setting": "基本資料",
|
||||
"account_setting": "帳號設定",
|
||||
"language_setting": "語言設定",
|
||||
|
||||
@@ -186,7 +186,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'全方位照護守護者',
|
||||
S.of(context).app_name,
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
Reference in New Issue
Block a user