update fixes

This commit is contained in:
2023-11-24 11:58:17 +05:30
parent 23fde37e3d
commit d8fd352a62
11 changed files with 187 additions and 64 deletions

View File

@ -72,6 +72,16 @@ ImageProvider getFinishImage() {
}
}
ImageProvider getReceiptImage() {
DestinationController destinationController =
Get.find<DestinationController>();
if (destinationController.photos.isNotEmpty) {
return FileImage(destinationController.photos[0]);
} else {
return const AssetImage('assets/images/money.png');
}
}
class CameraPage extends StatelessWidget {
bool? manulaCheckin = false;
bool? buyPointPhoto = false;
@ -454,7 +464,7 @@ class BuyPointCamera extends StatelessWidget {
height: 370,
decoration: BoxDecoration(
image: DecorationImage(
image: getFinishImage(), fit: BoxFit.cover)),
image: getReceiptImage(), fit: BoxFit.cover)),
),
),
),

View File

@ -510,7 +510,7 @@ class DestinationController extends GetxController {
lat: la,
lon: ln,
is_checkin: isCheckin,
created_at: DateTime.now().microsecondsSinceEpoch);
created_at: DateTime.now().millisecondsSinceEpoch);
var res = await db.insertGps(gps_data);
print("==gps res == ${res}");
}
@ -559,10 +559,10 @@ class DestinationController extends GetxController {
LengthUnit.Meter, LatLng(latFs, lonFs), LatLng(la, ln));
Destination des = festuretoDestination(fs);
print(
"--- position is ---- ${position.longitude}, --- ${position.longitude}----");
//print(
// "--- position is ---- ${position.longitude}, --- ${position.longitude}----");
print("--- distFs ---- $distFs, --- ${des.checkin_radious}----");
//print("--- distFs ---- $distFs, --- ${des.checkin_radious}----");
if (distFs <= des.checkin_radious! && skipGps == false) {
//print("--- 789 ---- $skip_gps----");
//near a location
@ -571,6 +571,7 @@ class DestinationController extends GetxController {
break;
}
}
pushGPStoServer();
//print("--- 123 ---- $skip_gps----");
} catch (e) {
//print("An error occurred: $e");
@ -581,6 +582,19 @@ class DestinationController extends GetxController {
}
}
Future<void> pushGPStoServer() async {
try {
await Future.delayed(const Duration(minutes: 5));
ExternalService().pushGPS();
} catch (e) {
//print("An error occurred: $e");
await pushGPStoServer();
} finally {
//print("--- End of pushGPStoServer function, calling recursively ---");
await pushGPStoServer();
}
}
void addToRogaining(double lat, double lon, int destinationId) async {
DatabaseHelper db = DatabaseHelper.instance;
List<Destination> d = await db.getDestinationById(destinationId);
@ -665,7 +679,7 @@ class DestinationController extends GetxController {
DateTime now = DateTime.now();
String formattedDate = DateFormat('yyyy-MM-dd HH:mm:ss').format(now);
await addGPStoDB(destination.lat!, destination.lon!, isCheckin: 1);
await addGPStoDB(currentLat, currentLon, isCheckin: 1);
// print("------ checkin event $eventCode ------");
ExternalService()
@ -869,9 +883,6 @@ class DestinationController extends GetxController {
// ---------- database ------------------///
void addDestinations(Destination dest) {
// print(
// '------ destination controller in add destination ${dest.checkin_radious} ---- :::::');
DatabaseHelper db = DatabaseHelper.instance;
db.getDestinationByLatLon(dest.lat!, dest.lon!).then((value) {
if (value.isNotEmpty) {
@ -947,40 +958,16 @@ class DestinationController extends GetxController {
}
void populateDestinations() {
//print(
// "--------- destination controller populsting destinations ----------- ::::::");
DatabaseHelper db = DatabaseHelper.instance;
destinations.clear();
db.getDestinations().then((value) {
destinationCount.value = 0;
for (Destination d in value) {
// print(
// "------ destination controller populating destination-------- ${d.checkedin}-------- :::::");
//print("-----populated----- ${d.toMap()}");
destinations.add(d);
}
if (destinations.isEmpty) {
rogainingCounted.value = false;
}
// destinationCount.value = 0;
//print(
// "------ destination controller destinationcount-------- $destinationCount-------- :::::");
// MatrixService.getDestinations(value).then((mat){
// print(" matrix is ------- ${mat}");
// matrix = mat;
// try{
// getRoutePoints();
// destinationCount.value = destinations.length;
// }
// catch(_){
// skip_gps = false;
// return;
// }
// });
});
}

View File

@ -130,6 +130,26 @@ class DrawerPage extends StatelessWidget {
width: 0,
height: 0,
),
indexController.currentUser.isNotEmpty
? ListTile(
leading: const Icon(Icons.delete_forever),
title: Text("ユーザーデータを削除する".tr),
onTap: () {
String token = indexController.currentUser[0]['token'];
AuthService.deleteUser(token).then((value) {
if (value.isNotEmpty) {
indexController.logout();
Get.toNamed(AppPages.TRAVEL);
Get.snackbar("ユーザーデータを削除する",
"データを削除するためにユーザーの同意が設定されています アプリとサーバーでユーザーデータが削除されました");
}
});
},
)
: const SizedBox(
width: 0,
height: 0,
),
// ListTile(
// leading: const Icon(Icons.person),
// title: Text("profile".tr),

View File

@ -45,9 +45,16 @@ class _PermissionHandlerScreenState extends State<PermissionHandlerScreen> {
content: const SingleChildScrollView(
child: ListBody(
children: <Widget>[
Text('このアプリでは、位置情報の収集を行います。'),
Text('ぎふナビ "アプリへようこそ!\n'),
Text('収集データ:\n'),
Text(
'岐阜ナビアプリではチェックポイントの自動チェックインの機能を可能にするために、現在地のデータが収集されます。アプリを閉じている時や、使用していないときにも収集されます。位置情報は、個人を特定できない統計的な情報として、ユーザーの個人情報とは一切結びつかない形で送信されます。お知らせの配信、位置情報の利用を許可しない場合は、この後表示されるダイアログで「許可しない」を選択してください。'),
'岐阜ナビアプリをより快適にご利用いただくために、チェックポイントの自動チェックインのための位置情報を収集しています。また、撮影した画像やチェックインした時間を収集し、チャレンジの勝者を決定します。\n'),
Text('お客様のデータの使用方法:\n'),
Text(
'お客様のデータは、アプリを改善し、競争力のある魅力的な体験を提供するのに役立ちます。お客様の位置情報と画像は、個人を特定できない統計データとして処理され、いかなる個人情報にもリンクされないようにしています\n'),
Text('お客様の管理:\n'),
Text(
'お客様はご自身のデータを完全に管理することができます。アプリの設定でいつでも同意を撤回することができます。位置情報の収集に同意しなくても、ぎふナビを楽しむことはできますが、自動チェックインや競技への参加など、一部の機能が制限されることを覚えておいてください。位置情報、画像、時刻情報の利用に同意する場合は「許可」を選択してください。許可しない場合は、「許可しない」を選択してください。あなたの選択は、アプリの他の機能を使用することに影響しません。\n'),
],
),
),