手戻り修正、APK出力
This commit is contained in:
@ -131,6 +131,30 @@ class IndexController extends GetxController {
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
/*
|
||||
@override
|
||||
void onReady() async {
|
||||
await readUserToken();
|
||||
final token = userToken;
|
||||
if (token != null && token.isNotEmpty) {
|
||||
await loadUserDetailsForToken(token);
|
||||
fixMapBound(token);
|
||||
} else {
|
||||
// ユーザートークンが存在しない場合はログイン画面にリダイレクト
|
||||
Get.offAllNamed(AppPages.LOGIN);
|
||||
}
|
||||
|
||||
// 地図のイベントリスナーを設定
|
||||
indexController.mapController.mapEventStream.listen((MapEvent mapEvent) {
|
||||
if (mapEvent is MapEventMoveEnd) {
|
||||
indexController.loadLocationsBound();
|
||||
}
|
||||
});
|
||||
|
||||
super.onReady();
|
||||
}
|
||||
*/
|
||||
|
||||
Future<void> _updateConnectionStatus(ConnectivityResult result) async {
|
||||
connectionStatus = result;
|
||||
connectionStatusName.value = result.name;
|
||||
@ -232,6 +256,10 @@ class IndexController extends GetxController {
|
||||
});
|
||||
currentUser.clear();
|
||||
cats.clear();
|
||||
|
||||
// ユーザートークンをデバイスから削除
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
await prefs.remove("user_token");
|
||||
}
|
||||
|
||||
// 要検討:エラーハンドリングが行われていますが、エラーメッセージをローカライズすることを検討してください。
|
||||
@ -361,6 +389,9 @@ class IndexController extends GetxController {
|
||||
return;
|
||||
}
|
||||
|
||||
// MapControllerの初期化が完了するまで待機
|
||||
await waitForMapControllerReady();
|
||||
|
||||
// Akira 追加:2024-4-6 #2800
|
||||
//await waitForMapControllerReady(); // MapControllerの初期化が完了するまで待機
|
||||
// Akira 追加:2024-4-6 #2800
|
||||
@ -451,7 +482,7 @@ class IndexController extends GetxController {
|
||||
Future<void> waitForMapControllerReady() async {
|
||||
if (!isMapControllerReady.value) {
|
||||
await Future.doWhile(() async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
await Future.delayed(const Duration(milliseconds: 100));
|
||||
return !isMapControllerReady.value;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user