قرار المالك 2026-07-27: باك إند سيرو PHP هو المعتمد، وتطبيقاته المجرّبة ميدانياً تحل محل إعادة البناء المؤرشفة. سيرو نفسه لم يُمسّ. الخريطة: backend · payment_server · loction_server · ride_server · passenger_server · docker · dashboard · stress_test → الجذر siro_rider → apps/rider siro_driver → apps/driver siro_admin → dashboards/admin siro_service → dashboards/service android_bot → apps/android_bot socialBot → apps/socialBot نُسخ المتعقَّب في git سيرو فقط عبر `git archive` (3,198 ملفاً / ~169 م.ب) لا `cp -r` — فاستُثنيت مخلفات البناء تلقائياً. بلا أي تعديل محتوى عمداً: كل ما يلي يصير فرقاً مقروءاً مقابل المصدر. لم يُستورد وسببه: siromove.com (الموقع التسويقي يبقى marketing/ في تريبز، سيرو فيه 8 ملفات) · docs و planning (تريبز له docs/ الخاص) · deploy.sh (ليس نشراً على سيرفر بل `git add . && git push origin --all` — فخّ في مستودع آخر) · transit_dashboard (بانتظار قرار مصير backend-transit و dashboards/transit-web). ⚠️ لا يبني بعد — ثلاثة نواقص متوقعة ومقصودة: 1. `.env` و `lib/env/env.g.dart` غير متعقَّبين في سيرو (أسرار لكل مستأجر): كل تطبيق فلاتر يحتاج .env خاصاً ثم توليد env.g.dart بـ build_runner. 2. إعدادات Firebase (9 ملفات google-services.json و GoogleService-Info.plist) يستبعدها .gitignore تريبز — ولكل مستأجر مشروع Firebase خاص أصلاً. 3. apps/driver في سيرو يشير إلى `../../Intaleq/packages/get` خارج المستودع → يجب ضمّ الحزم داخله أسوة بـ apps/rider. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
118 lines
3.8 KiB
Dart
Executable File
118 lines
3.8 KiB
Dart
Executable File
import 'package:siro_driver/constant/currency.dart';
|
|
import 'dart:io';
|
|
|
|
import 'package:siro_driver/constant/links.dart';
|
|
import 'package:siro_driver/controller/functions/crud.dart';
|
|
import 'package:siro_driver/views/widgets/mydialoug.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_confetti/flutter_confetti.dart';
|
|
import 'package:flutter_overlay_window/flutter_overlay_window.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:location/location.dart';
|
|
|
|
import '../../constant/box_name.dart';
|
|
import '../../main.dart';
|
|
import '../auth/captin/login_captin_controller.dart';
|
|
import '../home/payment/captain_wallet_controller.dart';
|
|
|
|
Future<void> getPermissionOverlay() async {
|
|
if (Platform.isAndroid) {
|
|
final bool status = await FlutterOverlayWindow.isPermissionGranted();
|
|
if (status == false) {
|
|
MyDialog().getDialog(
|
|
'Allow overlay permission'.tr,
|
|
'To display orders instantly, please grant permission to draw over other apps.'
|
|
.tr,
|
|
() async {
|
|
Get.back();
|
|
await FlutterOverlayWindow.requestPermission();
|
|
},
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
Future<void> showDriverGiftClaim(BuildContext context) async {
|
|
if (box.read(BoxName.is_claimed).toString() == '0' ||
|
|
box.read(BoxName.is_claimed) == null) {
|
|
final country = box.read(BoxName.countryCode)?.toString() ?? 'Jordan';
|
|
final giftAmount = country == 'Jordan' ? '3' : '300';
|
|
MyDialog().getDialog(
|
|
'You have gift $giftAmount ${CurrencyHelper.currency}'.tr, 'This for new registration'.tr, () async {
|
|
Get.back();
|
|
var res = await CRUD().post(link: AppLink.updateDriverClaim, payload: {
|
|
'driverId': box.read(BoxName.driverID),
|
|
});
|
|
if (res != 'failure') {
|
|
Get.find<CaptainWalletController>()
|
|
.addDriverWallet('new driver', giftAmount, giftAmount);
|
|
Confetti.launch(
|
|
context,
|
|
options:
|
|
const ConfettiOptions(particleCount: 100, spread: 70, y: 0.6),
|
|
);
|
|
box.write(BoxName.is_claimed, '1');
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
Future<void> closeOverlayIfFound() async {
|
|
if (Platform.isAndroid) {
|
|
bool isOverlayActive = await FlutterOverlayWindow.isActive();
|
|
if (isOverlayActive) {
|
|
await FlutterOverlayWindow.closeOverlay();
|
|
}
|
|
}
|
|
}
|
|
|
|
final location = Location();
|
|
Future<void> getLocationPermission() async {
|
|
bool serviceEnabled;
|
|
PermissionStatus permissionGranted;
|
|
|
|
// Check if location services are enabled
|
|
serviceEnabled = await location.serviceEnabled();
|
|
if (!serviceEnabled) {
|
|
serviceEnabled = await location.requestService();
|
|
if (!serviceEnabled) {
|
|
// Location services are still not enabled, handle the error
|
|
return;
|
|
}
|
|
}
|
|
|
|
// Check if the app has permission to access location
|
|
permissionGranted = await location.hasPermission();
|
|
if (permissionGranted == PermissionStatus.denied) {
|
|
permissionGranted = await location.requestPermission();
|
|
if (permissionGranted != PermissionStatus.granted) {
|
|
// Location permission is still not granted, handle the error
|
|
permissionGranted = await location.requestPermission();
|
|
return;
|
|
}
|
|
}
|
|
if (permissionGranted.toString() == 'PermissionStatus.granted') {
|
|
box.write(BoxName.locationPermission, 'true');
|
|
Get.find<LoginDriverController>().update();
|
|
}
|
|
// update();
|
|
}
|
|
|
|
Future<void> getOverLay(String myListString) async {
|
|
bool isOverlayActive = await FlutterOverlayWindow.isActive();
|
|
if (isOverlayActive) {
|
|
await FlutterOverlayWindow.closeOverlay();
|
|
}
|
|
await FlutterOverlayWindow.showOverlay(
|
|
enableDrag: true,
|
|
flag: OverlayFlag.focusPointer,
|
|
visibility: NotificationVisibility.visibilityPublic,
|
|
positionGravity: PositionGravity.auto,
|
|
height: 700,
|
|
width: WindowSize.matchParent,
|
|
startPosition: const OverlayPosition(0, -150),
|
|
);
|
|
|
|
await FlutterOverlayWindow.shareData(myListString);
|
|
}
|