This commit is contained in:
2024-04-03 20:44:30 +09:00
parent dd36ab8399
commit 7e6b5f887a
11 changed files with 155 additions and 42 deletions

View File

@ -16,6 +16,12 @@ class LoginPage extends StatelessWidget {
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: Colors.white,
appBar: AppBar(
elevation: 0,
backgroundColor: Colors.white,
automaticallyImplyLeading: false,
),
/* 2024-04-03 Updated by Akira . See https://wiki.sumasen.net/issues/2796?issue_count=1&issue_position=1
appBar: AppBar(
elevation: 0,
backgroundColor: Colors.white,
@ -29,6 +35,7 @@ class LoginPage extends StatelessWidget {
color: Colors.black,
)),
),
*/
body: indexController.currentUser.isEmpty
? SizedBox(
width: double.infinity,
@ -88,7 +95,7 @@ class LoginPage extends StatelessWidget {
MaterialButton(
minWidth: double.infinity,
height: 40,
onPressed: () {
onPressed: () async {
if (emailController.text.isEmpty ||
passwordController
.text.isEmpty) {
@ -116,6 +123,30 @@ class LoginPage extends StatelessWidget {
emailController.text,
passwordController.text,
context);
/*
try {
bool isLoggedIn = await indexController.login(emailController.text, passwordController.text,context);
if (isLoggedIn) {
Get.offAllNamed(AppPages.INDEX);
} else {
Get.snackbar(
"Login Failed",
"Invalid email or password",
icon: const Icon(Icons.error, color: Colors.red),
snackPosition: SnackPosition.BOTTOM,
);
}
} catch (e) {
Get.snackbar(
"Error",
"An error occurred during login",
icon: const Icon(Icons.error, color: Colors.red),
snackPosition: SnackPosition.BOTTOM,
);
} finally {
indexController.isLoading.value = false;
}
*/ // ここまで
},
color: Colors.indigoAccent[400],
shape: RoundedRectangleBorder(
@ -128,6 +159,16 @@ class LoginPage extends StatelessWidget {
fontSize: 16,
color: Colors.white70),
),
/*
child: Obx(
() => indexController.isLoading.value
? const CircularProgressIndicator(color: Colors.white)
: const Text(
"ログイン",
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 16, color: Colors.white70),
),
),
*/ // ここまで
),
const SizedBox(
height: 5.0,

View File

@ -129,7 +129,7 @@ class StringValues extends Translations{
'finishing_rogaining' : 'ロゲイニングを終えて',
'cp_pls_take_photo' : "CPです。撮影してください。",
'take_photo of the clock' : '時計の写真を撮る',
'finish_goal': 'フィニッシュゴール',
'finish_goal': 'ゴール完了',
'goal_saved': "目標を保存しました",
'goal_added_successfuly' : '目標が正常に追加されました',
'goal_not_added' : '目標が追加されていません',