Fix 2796
This commit is contained in:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user