نسخة كاملة من مستودع سيرو عند ecfe7568 لتكون أساس تطبيق «انطلق». نُسخ المتعقَّب في git فقط (12,509 ملفاً / 302 م.ب) بـ git archive، لا `cp -r` — فاستُثنيت تلقائياً مخلفات البناء (build · node_modules · .dart_tool · .gradle · Pods ≈ 10.7 غ.ب) وكل ما يستثنيه .gitignore. هذا الكوميت **بلا أي تعديل عمداً** حتى يكون كل ما يليه فرقاً مقروءاً مقابل سيرو الأصلي. سيرو نفسه لم يُمسّ. ⚠️ لا يبني بعد: `.env` و`lib/env/env.g.dart` غير متعقَّبين في سيرو (وهذا صحيح — أسرار لكل مستأجر). كل تطبيق فلاتر هنا يحتاج .env خاصاً بانطلق ثم توليد env.g.dart عبر build_runner. لا تُنسخ أسرار سيرو. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
61 lines
1.9 KiB
Dart
Executable File
61 lines
1.9 KiB
Dart
Executable File
import 'package:get/get.dart';
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
import '../../constant/box_name.dart';
|
|
import '../../main.dart';
|
|
import '../../print.dart';
|
|
import '../../views/widgets/mydialoug.dart';
|
|
import '../auth/captin/login_captin_controller.dart';
|
|
|
|
class LocationPermissions {
|
|
// late Location location;
|
|
|
|
// Future locationPermissions() async {
|
|
// location = Location();
|
|
// var permissionStatus = await location.requestPermission();
|
|
// if (permissionStatus == PermissionStatus.denied) {
|
|
// // The user denied the location permission.
|
|
// Get.defaultDialog(title: 'GPS Required Allow !.'.tr, middleText: '');
|
|
// return null;
|
|
// }
|
|
// }
|
|
}
|
|
|
|
Future<void> getPermissionLocation() async {
|
|
final PermissionStatus status = await Permission.locationAlways.status;
|
|
if (!await Permission.locationAlways.serviceStatus.isEnabled) {
|
|
Log.print('status.isGranted: ${status.isGranted}');
|
|
// box.write(BoxName.locationPermission, 'true');
|
|
await Permission.locationAlways.request();
|
|
Get.put(LoginDriverController()).update();
|
|
MyDialog().getDialog(
|
|
'Enable Location Permission'.tr, // {en:ar}
|
|
'Allowing location access will help us display orders near you. Please enable it now.'
|
|
.tr, // {en:ar}
|
|
() async {
|
|
Get.back();
|
|
box.write(BoxName.locationPermission, 'true');
|
|
await Permission.locationAlways.request();
|
|
},
|
|
);
|
|
}
|
|
}
|
|
|
|
Future<void> getPermissionLocation1() async {
|
|
PermissionStatus status = await Permission.locationWhenInUse.request();
|
|
|
|
if (status.isGranted) {
|
|
// After granting when in use, request "always" location permission
|
|
status = await Permission.locationAlways.request();
|
|
|
|
if (status.isGranted) {
|
|
print("Background location permission granted");
|
|
} else {
|
|
print("Background location permission denied");
|
|
}
|
|
} else {
|
|
print("Location permission denied");
|
|
await openAppSettings();
|
|
}
|
|
}
|