Semi Final 7th Aug 2024
This commit is contained in:
@ -489,7 +489,23 @@ class IndexController extends GetxController with WidgetsBindingObserver {
|
||||
//
|
||||
void register(String email, String password, String password2, BuildContext context) {
|
||||
AuthService.register(email, password,password2).then((value) {
|
||||
if (value.isNotEmpty) {
|
||||
if (value is Map && value.containsKey("error")) {
|
||||
String err_message = value["error"];
|
||||
debugPrint("ユーザー登録失敗:${email}, ${password},${err_message}");
|
||||
logManager.addOperationLog("User failed to register new account : ${email} , ${password} ,${err_message}.");
|
||||
isLoading.value = false;
|
||||
Get.snackbar(
|
||||
'user_registration_failed_please_try_again'.tr, // ユーザー登録に失敗しました。
|
||||
err_message,
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
icon: const Icon(Icons.error, size: 40.0, color: Colors.blue),
|
||||
snackPosition: SnackPosition.TOP,
|
||||
duration: const Duration(seconds: 3),
|
||||
//backgroundColor: Colors.yellow,
|
||||
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
||||
);
|
||||
}else{
|
||||
debugPrint("ユーザー登録成功:${email}, ${password}");
|
||||
logManager.addOperationLog("User tried to register new account : ${email} , ${password} .");
|
||||
|
||||
@ -508,22 +524,7 @@ class IndexController extends GetxController with WidgetsBindingObserver {
|
||||
);
|
||||
|
||||
//Navigator.pop(context);
|
||||
Get.toNamed(AppPages.INDEX);
|
||||
} else {
|
||||
debugPrint("ユーザー登録失敗:${email}, ${password}");
|
||||
logManager.addOperationLog("User failed to register new account : ${email} , ${password} .");
|
||||
isLoading.value = false;
|
||||
Get.snackbar(
|
||||
'failed'.tr, // 失敗
|
||||
'user_registration_failed_please_try_again'.tr, // ユーザー登録に失敗しました。
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
icon: const Icon(Icons.error, size: 40.0, color: Colors.blue),
|
||||
snackPosition: SnackPosition.TOP,
|
||||
duration: const Duration(seconds: 3),
|
||||
//backgroundColor: Colors.yellow,
|
||||
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
||||
);
|
||||
Get.toNamed(AppPages.LOGIN);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user