المجلدات وأسماء حزم dart واستيراداتها: siro_rider → intaleq_rider siro_driver → intaleq_driver siro_admin → intaleq_admin siro_service → intaleq_service شمل ذلك `name:` في كل pubspec وكل `package:siro_*` في الاستيرادات (115 ملفاً في rider وحده)، وإشارات أسماء المجلدات في docs/ وتعليق في backend/Admin/notifications/broadcast.php. لم تبقَ إشارة واحدة (تحقّقت). + ضُمّت حزم get و get_storage داخل intaleq_driver/packages/ وحُوّلت مساراتها الثلاثة من `../../Intaleq/packages/*` إلى `./packages/*`. كانت تُحل عرضاً إلى مجلد App/Intaleq القديم المجاور — تبعية خارج المستودع تنكسر بأول نقل. لم يبقَ في أي تطبيق تبعية مسار خارج الشجرة. ⚠️ لم تُمسّ بعد: هويات المتاجر (applicationId · PRODUCT_BUNDLE_IDENTIFIER · shorebird app_id) ولا الألوان ولا النصوص المرئية ولا النطاقات — كل منها كوميت منفصل، والهويات تحتاج قرار المالك. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
59 lines
1.7 KiB
Dart
Executable File
59 lines
1.7 KiB
Dart
Executable File
import 'dart:convert';
|
|
|
|
import 'package:intaleq_driver/constant/box_name.dart';
|
|
import 'package:intaleq_driver/constant/links.dart';
|
|
import 'package:intaleq_driver/controller/functions/crud.dart';
|
|
import 'package:intaleq_driver/main.dart';
|
|
import 'package:intaleq_driver/views/widgets/error_snakbar.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
class AssuranceHealthController extends GetxController {
|
|
bool isLoading = false;
|
|
Map tripCount = {};
|
|
|
|
Future getTripCountByCaptain() async {
|
|
var res = await CRUD().get(link: AppLink.getTripCountByCaptain, payload: {
|
|
"driver_id": box.read(BoxName.driverID).toString(),
|
|
});
|
|
if (res != 'failure') {
|
|
tripCount = jsonDecode(res)['message'];
|
|
update();
|
|
}
|
|
}
|
|
|
|
Future<void> addDriverHealthAssurance({
|
|
String? driverId,
|
|
String? assured,
|
|
required String healthInsuranceProvider,
|
|
}) async {
|
|
// Define the URL to your PHP backend
|
|
|
|
// Data to be sent to the backend
|
|
Map<String, String> data = {
|
|
"driver_id": box.read(BoxName.driverID).toString(),
|
|
"assured": '1',
|
|
"health_insurance_provider": healthInsuranceProvider,
|
|
};
|
|
|
|
try {
|
|
// Send the POST request to your backend
|
|
var response = await CRUD()
|
|
.post(link: AppLink.addHealthInsuranceProvider, payload: data);
|
|
|
|
if (response != 'failure') {
|
|
// Handle success (e.g., show a success message)
|
|
|
|
mySnackbarSuccess(
|
|
"You have successfully opted for health insurance.".tr);
|
|
} else {
|
|
// Handle failure (e.g., show an error message)
|
|
print("Failed to save health assurance data");
|
|
mySnackbarError("Please enter a health insurance status.".tr);
|
|
}
|
|
} catch (e) {
|
|
// Handle any errors
|
|
print("Error: $e");
|
|
}
|
|
}
|
|
}
|