Fix 2803,2802,2800
This commit is contained in:
@ -561,7 +561,14 @@ class DestinationController extends GetxController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Get.snackbar("始まっていない", "ロゲイニングを始める必要があります");
|
Get.snackbar(
|
||||||
|
"始まっていません",
|
||||||
|
"ロゲ開始ボタンをタップして、ロゲイニングを始める必要があります",
|
||||||
|
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
backgroundColor: Colors.yellow,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -931,7 +938,11 @@ class DestinationController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void centerMapToCurrentLocation() {
|
void centerMapToCurrentLocation() {
|
||||||
|
assert(() {
|
||||||
print("center is ${currentLon}, ${currentLon}");
|
print("center is ${currentLon}, ${currentLon}");
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
// Akira
|
||||||
if (currentLat != 0 || currentLon != 0) {
|
if (currentLat != 0 || currentLon != 0) {
|
||||||
indexController.mapController.move(LatLng(currentLat, currentLon), 17.0);
|
indexController.mapController.move(LatLng(currentLat, currentLon), 17.0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -172,11 +172,11 @@ class IndexController extends GetxController {
|
|||||||
} else {
|
} else {
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Failed",
|
"ログイン失敗",
|
||||||
"User login failed, please try again.",
|
"ログインIDかパスワードを確認して下さい。",
|
||||||
icon: const Icon(Icons.error, size: 40.0, color: Colors.blue),
|
icon: const Icon(Icons.error, size: 40.0, color: Colors.blue),
|
||||||
snackPosition: SnackPosition.TOP,
|
snackPosition: SnackPosition.TOP,
|
||||||
duration: const Duration(milliseconds: 800),
|
duration: const Duration(seconds: 3),
|
||||||
backgroundColor: Colors.yellow,
|
backgroundColor: Colors.yellow,
|
||||||
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
||||||
);
|
);
|
||||||
@ -282,6 +282,7 @@ class IndexController extends GetxController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void loadLocationsBound() {
|
void loadLocationsBound() {
|
||||||
if (isCustomAreaSelected.value == true) {
|
if (isCustomAreaSelected.value == true) {
|
||||||
return;
|
return;
|
||||||
@ -320,7 +321,7 @@ class IndexController extends GetxController {
|
|||||||
icon: const Icon(Icons.assistant_photo_outlined,
|
icon: const Icon(Icons.assistant_photo_outlined,
|
||||||
size: 40.0, color: Colors.blue),
|
size: 40.0, color: Colors.blue),
|
||||||
snackPosition: SnackPosition.TOP,
|
snackPosition: SnackPosition.TOP,
|
||||||
duration: const Duration(milliseconds: 800),
|
duration: const Duration(seconds: 2),
|
||||||
backgroundColor: Colors.yellow,
|
backgroundColor: Colors.yellow,
|
||||||
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
||||||
);
|
);
|
||||||
@ -333,6 +334,73 @@ class IndexController extends GetxController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 2024-04-03 Akira .. Update the code . See ticket 2800.
|
||||||
|
//
|
||||||
|
void loadLocationsBound() {
|
||||||
|
if (isCustomAreaSelected.value == true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
locations.clear();
|
||||||
|
String cat = currentCat.isNotEmpty ? currentCat[0] : "";
|
||||||
|
if (currentCat.isNotEmpty && currentCat[0] == "-all-") {
|
||||||
|
cat = "";
|
||||||
|
}
|
||||||
|
LatLngBounds bounds = mapController.bounds!;
|
||||||
|
currentBound.clear();
|
||||||
|
currentBound.add(bounds);
|
||||||
|
|
||||||
|
isLoading.value = true; // ローディング状態をtrueに設定
|
||||||
|
|
||||||
|
LocationService.loadLocationsBound(
|
||||||
|
bounds.southWest.latitude,
|
||||||
|
bounds.southWest.longitude,
|
||||||
|
bounds.northWest.latitude,
|
||||||
|
bounds.northWest.longitude,
|
||||||
|
bounds.northEast.latitude,
|
||||||
|
bounds.northEast.longitude,
|
||||||
|
bounds.southEast.latitude,
|
||||||
|
bounds.southEast.longitude,
|
||||||
|
cat
|
||||||
|
).then((value) {
|
||||||
|
isLoading.value = false; // ローディング状態をfalseに設定
|
||||||
|
|
||||||
|
if (value == null) {
|
||||||
|
// APIからのレスポンスがnullの場合は処理を中断
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (value.features.isEmpty) {
|
||||||
|
if (showPopup == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Get.snackbar(
|
||||||
|
"Too many Points",
|
||||||
|
"please zoom in",
|
||||||
|
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
backgroundColor: Colors.yellow,
|
||||||
|
);
|
||||||
|
showPopup = false;
|
||||||
|
}
|
||||||
|
if (value.features.isNotEmpty) {
|
||||||
|
locations.add(value);
|
||||||
|
}
|
||||||
|
}).catchError((error) {
|
||||||
|
isLoading.value = false; // ローディング状態をfalseに設定
|
||||||
|
|
||||||
|
// エラーハンドリング: APIリクエストが失敗した場合
|
||||||
|
Get.snackbar(
|
||||||
|
"Error",
|
||||||
|
"Failed to load locations. Please check your internet connection and try again.",
|
||||||
|
icon: const Icon(Icons.error, size: 40.0, color: Colors.red),
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
duration: const Duration(milliseconds: 800),
|
||||||
|
backgroundColor: Colors.yellow,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void setBound(LatLngBounds bounds) {
|
void setBound(LatLngBounds bounds) {
|
||||||
currentBound.clear();
|
currentBound.clear();
|
||||||
|
|||||||
@ -111,7 +111,7 @@ class LoginPage extends StatelessWidget {
|
|||||||
snackPosition:
|
snackPosition:
|
||||||
SnackPosition.TOP,
|
SnackPosition.TOP,
|
||||||
duration: const Duration(
|
duration: const Duration(
|
||||||
milliseconds: 800),
|
seconds: 3),
|
||||||
backgroundColor: Colors.yellow,
|
backgroundColor: Colors.yellow,
|
||||||
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
//icon:Image(image:AssetImage("assets/images/dora.png"))
|
||||||
);
|
);
|
||||||
|
|||||||
@ -111,10 +111,14 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget getActionButton(BuildContext context, Destination destination) {
|
Widget getActionButton(BuildContext context, Destination destination) {
|
||||||
|
assert(() {
|
||||||
print("getActionButton ${destinationController.rogainingCounted.value}");
|
print("getActionButton ${destinationController.rogainingCounted.value}");
|
||||||
print("getActionButton ${destinationController.distanceToStart()}");
|
print("getActionButton ${destinationController.distanceToStart()}");
|
||||||
print("getActionButton ${destination.cp}");
|
print("getActionButton ${destination.cp}");
|
||||||
print("getActionButton ${DestinationController.ready_for_goal}");
|
print("getActionButton ${DestinationController.ready_for_goal}");
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
// ...2024-04-03 Akira デバッグモードのみ出力するようにした。
|
||||||
|
|
||||||
Destination cdest = destinationController
|
Destination cdest = destinationController
|
||||||
.festuretoDestination(indexController.currentFeature[0]);
|
.festuretoDestination(indexController.currentFeature[0]);
|
||||||
|
|||||||
@ -181,7 +181,12 @@ class _MapWidgetState extends State<MapWidget> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _centerMapOnUser() {
|
void _centerMapOnUser() {
|
||||||
|
assert(() {
|
||||||
print("showBottomSheet ${destinationController.shouldShowBottomSheet}");
|
print("showBottomSheet ${destinationController.shouldShowBottomSheet}");
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
// 2024-04-03 Akira Log enabled only debug mode..
|
||||||
|
//
|
||||||
//if (destinationController.shouldShowBottomSheet) {
|
//if (destinationController.shouldShowBottomSheet) {
|
||||||
destinationController.centerMapToCurrentLocation();
|
destinationController.centerMapToCurrentLocation();
|
||||||
//}
|
//}
|
||||||
|
|||||||
Reference in New Issue
Block a user