release 4.8.9

This commit is contained in:
2024-08-05 03:08:12 +09:00
parent 1e0af0b06b
commit 66ade1fe09
30 changed files with 1765 additions and 17646 deletions

View File

@ -82,6 +82,12 @@ class IndexController extends GetxController with WidgetsBindingObserver {
String areaDropdownValue = "-1";
String cateogory = "-all-";
final selectedEventName = 'add_location'.tr.obs;
void setSelectedEventName(String eventName) {
selectedEventName.value = eventName;
}
ConnectivityResult connectionStatus = ConnectivityResult.none;
var connectionStatusName = "".obs;
final Connectivity _connectivity = Connectivity();
@ -89,6 +95,9 @@ class IndexController extends GetxController with WidgetsBindingObserver {
final Rx<DateTime> lastUserUpdateTime = DateTime.now().obs;
RxInt teamId = RxInt(-1); // チームIDを保存するための変数
//late TeamController teamController = TeamController();
/*
void updateUserInfo(Map<String, dynamic> newUserInfo) {
currentUser.clear();
@ -97,6 +106,20 @@ class IndexController extends GetxController with WidgetsBindingObserver {
}
*/
final isReferenceMode = false.obs;
void setReferenceMode(bool value) {
isReferenceMode.value = value;
}
bool canStartRoge() {
return !isReferenceMode.value;
}
bool canCheckin() {
return !isReferenceMode.value;
}
void toggleMode() {
if (mode.value == 0) {
mode += 1;
@ -214,6 +237,8 @@ class IndexController extends GetxController with WidgetsBindingObserver {
print('IndexController onInit called'); // デバッグ用の出力を追加
//teamController = Get.find<TeamController>();
}
Future<void> initializeApiService() async {
@ -462,16 +487,27 @@ class IndexController extends GetxController with WidgetsBindingObserver {
// 要検討:エラーハンドリングが行われていますが、エラーメッセージをローカライズすることを検討してください。
//
void register(String email, String password, BuildContext context) {
AuthService.register(email, password).then((value) {
void register(String email, String password, String password2, BuildContext context) {
AuthService.register(email, password,password2).then((value) {
if (value.isNotEmpty) {
debugPrint("ユーザー登録成功:${email}, ${password}");
logManager.addOperationLog("User tried to register new account : ${email} , ${password} .");
currentUser.clear();
currentUser.add(value);
//currentUser.add(value);
isLoading.value = false;
Navigator.pop(context);
// ユーザー登録成功メッセージを表示
Get.snackbar(
'success'.tr,
'user_registration_successful'.tr,
backgroundColor: Colors.green,
colorText: Colors.white,
snackPosition: SnackPosition.TOP,
duration: const Duration(seconds: 3),
);
//Navigator.pop(context);
Get.toNamed(AppPages.INDEX);
} else {
debugPrint("ユーザー登録失敗:${email}, ${password}");
@ -518,7 +554,7 @@ class IndexController extends GetxController with WidgetsBindingObserver {
}
*/
void changeUser(Map<String, dynamic> value, {bool replace = true}) {
void changeUser(Map<String, dynamic> value, {bool replace = true}) async{
currentUser.clear();
currentUser.add(value);
if (replace) {
@ -529,12 +565,29 @@ class IndexController extends GetxController with WidgetsBindingObserver {
if (currentUser.isNotEmpty) {
rogMode.value = 0;
restoreGame();
// チームデータを取得
await fetchTeamData();
} else {
rogMode.value = 1;
}
Get.toNamed(AppPages.INDEX);
}
Future<void> fetchTeamData() async {
try {
Get.put(TeamController());
// \"TeamController\" not found. You need to call \"Get.put(TeamController())\" or \"Get.lazyPut(()=>TeamController())\"
final teamController = Get.find<TeamController>();
await teamController.fetchTeams();
if (teamController.teams.isNotEmpty) {
teamId.value = teamController.teams.first.id;
}
} catch (e) {
print("Error fetching team data: $e");
}
}
loadUserDetailsForToken(String token) async {
AuthService.userForToken(token).then((value) {
print("----token val-- $value ------");