diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 4e2fda5..b269a90 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -89,7 +89,7 @@ PODS: - GTMSessionFetcher/Core - image_cropper (0.0.4): - Flutter - - TOCropViewController (~> 2.6.1) + - TOCropViewController (~> 2.7.4) - image_picker_ios (0.0.1): - Flutter - local_auth_darwin (0.0.1): @@ -106,7 +106,7 @@ PODS: - sqflite (0.0.3): - Flutter - FlutterMacOS - - TOCropViewController (2.6.1) + - TOCropViewController (2.7.4) - url_launcher_ios (0.0.1): - Flutter @@ -181,14 +181,14 @@ SPEC CHECKSUMS: GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de GTMSessionFetcher: 8000756fc1c19d2e5697b90311f7832d2e33f6cd - image_cropper: a3291c624a953049bc6a02e1f8c8ceb162a24b25 + image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 local_auth_darwin: 4d56c90c2683319835a61274b57620df9c4520ab nanopb: 438bc412db1928dac798aa6fd75726007be04262 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec - TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863 + TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654 url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe PODFILE CHECKSUM: 1959d098c91d8a792531a723c4a9d7e9f6a01e38 diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index beb37e3..6a98f50 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -16,7 +16,7 @@ import UIKit import Flutter import FirebaseCore -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( diff --git a/lib/constant/links.dart b/lib/constant/links.dart index 1eeabef..5f22229 100644 --- a/lib/constant/links.dart +++ b/lib/constant/links.dart @@ -20,6 +20,7 @@ class AppLink { static String getTokens = "$server/ride/firebase/get.php"; static String getAllTokenDrivers = "$server/ride/firebase/getALlTokenDrivers.php"; + static String getAllTokenPassengers = "$server/ride/firebase/getAllTokenPassengers.php"; static String addTokens = "$server/ride/firebase/add.php"; @@ -220,7 +221,8 @@ class AppLink { static String getAccount = "$authCaptin/getAccount.php"; //===================Admin Captin============ - + static String getDriversPhonesAndTokens = + "$server/Admin/AdminCaptain/getDriversPhonesAndTokens.php"; static String getPassengerDetailsByPassengerID = "$server/Admin/getPassengerDetailsByPassengerID.php"; static String getPassengerDetails = "$server/Admin/getPassengerDetails.php"; @@ -237,11 +239,13 @@ class AppLink { "$server/Admin/AdminRide/getRidesPerMonth.php"; static String getRidesDetails = "$server/Admin/AdminRide/get.php"; static String getPassengersStatic = "$serviceApp/getPassengersStatic.php"; + static String getRidesStatic = "$serviceApp/getRidesStatic.php"; + static String getEmployeeStatic = "$serviceApp/getEmployeeStatic.php"; static String getdriverstotalMonthly = "$serviceApp/getdriverstotalMonthly.php"; //////////////////////// - static String serviceApp = "$server/serviceApp"; + static String serviceApp = "$server/serviceapp"; static String editCarPlate = "$serviceApp/editCarPlate.php"; static String getComplaintAllData = "$serviceApp/getComplaintAllData.php"; static String getComplaintAllDataForDriver = @@ -259,4 +263,14 @@ class AppLink { static String addNotesDriver = "$serviceApp/addNotesDriver.php"; static String getCarPlateNotEdit = "$serviceApp/getCarPlateNotEdit.php"; static String addNotesPassenger = "$serviceApp/addNotesPassenger.php"; + ////// + static String sendSms = "https://sms.kazumi.me/api/sms/send-sms"; + static String senddlr = "https://sms.kazumi.me/api/sms/send-dlr"; + static String sendvalidity = "https://sms.kazumi.me/api/sms/send-validity"; + static String sendmany = "https://sms.kazumi.me/api/sms/send-many"; + static String checkCredit = "https://sms.kazumi.me/api/sms/check-credit"; + static String getSender = "$server/auth/sms/getSender.php"; + static String checkStatus = "https://sms.kazumi.me/api/sms/check-status"; + static String updatePhoneInvalidSMSPassenger = + "$server/auth/sms/updatePhoneInvalidSMSPassenger.php"; } diff --git a/lib/controller/admin/dashboard_controller.dart b/lib/controller/admin/dashboard_controller.dart index a5d0858..e70763a 100644 --- a/lib/controller/admin/dashboard_controller.dart +++ b/lib/controller/admin/dashboard_controller.dart @@ -1,16 +1,21 @@ import 'dart:convert'; +import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:sefer_admin1/constant/links.dart'; import 'package:sefer_admin1/controller/functions/crud.dart'; import '../../constant/api_key.dart'; +import '../../constant/box_name.dart'; +import '../../main.dart'; import '../../print.dart'; class DashboardController extends GetxController { bool isLoading = false; List dashbord = []; String creditSMS = '0'; + final formKey = GlobalKey(); + final smsText = TextEditingController(); Future getDashBoard() async { isLoading = true; @@ -36,6 +41,22 @@ class DashboardController extends GetxController { update(); } + sendSMSMethod() async { + if (formKey.currentState!.validate()) { + for (var phoneNumber in box.read(BoxName.tokensDrivers)['message']) { + // for (var i = 0; i < 2; i++) { + await CRUD().sendSmsEgypt( + phoneNumber['phone'].toString(), + // box.read(BoxName.tokensDrivers)['message'][i]['phone'].toString(), + smsText.text, + ); + // Log.print('CRUD().phoneDriversTest.: ${phoneNumber['phone']}'); + Future.delayed(const Duration(microseconds: 20)); + } + Get.back(); + } + } + @override void onInit() async { getDashBoard(); diff --git a/lib/controller/admin/static_controller.dart b/lib/controller/admin/static_controller.dart index f998dff..8ca0e54 100644 --- a/lib/controller/admin/static_controller.dart +++ b/lib/controller/admin/static_controller.dart @@ -5,6 +5,7 @@ import 'package:get/get.dart'; import '../../constant/links.dart'; import '../../models/model/passengers_model.dart'; +import '../../print.dart'; import '../functions/crud.dart'; class StaticController extends GetxController { @@ -14,11 +15,20 @@ class StaticController extends GetxController { var chartDataPassengers; var chartDataDrivers; var chartDataDriversCalling; + var chartDataRides; + var chartDataEmployee; + var chartDataEmployeeMaryam; + var chartDataEmployeeRawda; + var chartDataEmployeeMena; var chartDataDriversMatchingNotes; bool isLoading = false; String totalMonthlyPassengers = ''; + String totalMonthlyRides = ''; + String totalMonthlyEmployee = ''; String totalMonthlyDrivers = ''; late List passengersData; + late List ridesData; + late List employeeData; late List driversData; Future fetch() async { @@ -48,6 +58,98 @@ class StaticController extends GetxController { update(); // Notify the observers about the data and loading state change } + Future fetchRides() async { + isLoading = true; + update(); // Notify the observers about the loading state change + + var res = await CRUD().get( + link: AppLink.getRidesStatic, + payload: {}, + ); + jsonData1 = jsonDecode(res); + var jsonResponse = jsonDecode(res) as Map; + isLoading = false; + final List jsonData = jsonResponse['message']; + totalMonthlyRides = jsonData[0]['totalMonthly'].toString(); + ridesData = jsonData.map((item) { + return MonthlyRidesInstall.fromJson(item); + }).toList(); + final List spots = ridesData + .map((data) => FlSpot( + data.day.toDouble(), + data.totalRides.toDouble(), + )) + .toList(); + chartDataRides = spots; + + update(); // Notify the observers about the data and loading state change + } + + Future fetchEmployee() async { + isLoading = true; + update(); + + var res = await CRUD().get(link: AppLink.getEmployeeStatic, payload: {}); + var jsonResponse = jsonDecode(res) as Map; + isLoading = false; + + final List jsonData = jsonResponse['message']; + totalMonthlyRides = jsonData[0]['totalMonthly'].toString(); + + // Group data by employee + Map> employeeDataMap = {}; + + for (var item in jsonData) { + var employeeData = MonthlyEmployeeData.fromJson(item); + if (!employeeDataMap.containsKey(employeeData.name)) { + employeeDataMap[employeeData.name] = []; + } + employeeDataMap[employeeData.name]!.add(employeeData); + } + + // Create FlSpot data for each employee + List chartDataMaryam = []; + List chartDataRawda = []; + List chartDataMena = []; + + for (int day = 1; day <= DateTime.now().day; day++) { + chartDataMaryam.add(FlSpot( + day.toDouble(), + employeeDataMap['maryam'] + ?.firstWhere((e) => e.day == day, + orElse: () => MonthlyEmployeeData( + day: day, totalEmployees: 0, name: 'maryam')) + .totalEmployees + .toDouble() ?? + 0)); + chartDataRawda.add(FlSpot( + day.toDouble(), + employeeDataMap['rawda'] + ?.firstWhere((e) => e.day == day, + orElse: () => MonthlyEmployeeData( + day: day, totalEmployees: 0, name: 'rawda')) + .totalEmployees + .toDouble() ?? + 0)); + chartDataMena.add(FlSpot( + day.toDouble(), + employeeDataMap['mena'] + ?.firstWhere((e) => e.day == day, + orElse: () => MonthlyEmployeeData( + day: day, totalEmployees: 0, name: 'mena')) + .totalEmployees + .toDouble() ?? + 0)); + } + + // Combine spots into a single list if needed or keep them separate + chartDataEmployeeMaryam = chartDataMaryam; + chartDataEmployeeRawda = chartDataRawda; + chartDataEmployeeMena = chartDataMena; + + update(); + } + Future fetchDrivers() async { isLoading = true; update(); // Notify the observers about the loading state change @@ -92,6 +194,8 @@ class StaticController extends GetxController { Future getAll() async { await fetch(); + await fetchRides(); await fetchDrivers(); + await fetchEmployee(); } } diff --git a/lib/controller/firebase/firbase_messge.dart b/lib/controller/firebase/firbase_messge.dart index 8a206a1..ba1e7ed 100644 --- a/lib/controller/firebase/firbase_messge.dart +++ b/lib/controller/firebase/firbase_messge.dart @@ -11,6 +11,7 @@ import '../../constant/colors.dart'; import '../../constant/links.dart'; import '../../constant/style.dart'; import '../../main.dart'; +import '../../print.dart'; import '../../views/widgets/elevated_btn.dart'; import '../notification_controller.dart'; import 'local_notification.dart'; @@ -83,34 +84,38 @@ class FirebaseMessagesController extends GetxController { var currentPage = 1; var totalPages = 1; - Future getAllTokenDrivers({int page = 1}) async { + Future getAllTokenDrivers() async { isLoading = true; try { var res = await http.post( - Uri.parse(AppLink.getAllTokenDrivers), + Uri.parse(AppLink.getDriversPhonesAndTokens), headers: { 'Authorization': 'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}', }, body: { - 'page': page.toString(), + // 'page': page.toString(), }, ); var jsonResponse = jsonDecode(res.body); + Log.print('jsonResponse: ${jsonResponse}'); if (jsonResponse['status'] == 'success') { - var newData = jsonResponse['data'] as List; - if (page == 1) { - dataTokens.clear(); - tokens.clear(); - } - dataTokens.addAll(newData); - for (var item in newData) { - tokens.add(item['token']); - } - currentPage = int.parse(jsonResponse['currentPage']); - totalPages = jsonResponse['totalPages']; - box.write(BoxName.tokensDrivers, tokens); + // var newData = jsonResponse['data'] as List; + // Log.print('newData: ${newData}'); + // // if (page == 1) { + // // dataTokens.clear(); + // // tokens.clear(); + // // } + // dataTokens.addAll(newData); + // for (var item in newData) { + // tokens.add(item['token']); + // } + // currentPage = int.parse(jsonResponse['currentPage']); + // totalPages = jsonResponse['totalPages']; + box.write(BoxName.tokensDrivers, jsonResponse); + Log.print( + 'box.write(BoxName.tokensDrivers: ${box.read(BoxName.tokensDrivers)}'); } else { Get.defaultDialog( title: "Warning", middleText: "No more data available"); @@ -166,17 +171,20 @@ class FirebaseMessagesController extends GetxController { bool isSendingNotifications = false; Future loadAllPagesAndSendNotifications() async { isSendingNotifications = true; - currentPage = 1; + // currentPage = 1; - while (currentPage <= totalPages) { - await getAllTokenDrivers(page: currentPage); - await NotificationController().sendNotificationDrivers(); - print(tokens); - if (currentPage < totalPages) { - await Future.delayed(const Duration(seconds: 3)); - } - currentPage++; - } + // while (currentPage <= totalPages) { + // await getAllTokenDrivers(page: currentPage); + await getAllTokenDrivers(); + // Log.print('tokens: ${tokens}'); + await NotificationController().sendNotificationDrivers(); + // print(tokens); + + // if (currentPage < totalPages) { + // await Future.delayed(const Duration(seconds: 3)); + // } + // currentPage++; + // } isSendingNotifications = false; Get.snackbar("Success", "All notifications sent!"); @@ -189,7 +197,7 @@ class FirebaseMessagesController extends GetxController { while (currentPagePassenger <= totalPagesPassenger) { await getAllTokenPassenger(page: currentPagePassenger); - await NotificationController().sendNotificationDrivers(); + await NotificationController().sendNotificationPassengers(); print(tokensPassengers); if (currentPagePassenger < totalPagesPassenger) { await Future.delayed(const Duration(seconds: 3)); @@ -596,6 +604,7 @@ class FirebaseMessagesController extends GetxController { // Obtain an OAuth 2.0 access token final accessToken = await accessTokenManager.getAccessToken(); + // Log.print('accessToken: ${accessToken}'); // Send the notification final response = await http.post( @@ -612,9 +621,6 @@ class FirebaseMessagesController extends GetxController { 'title': title, 'body': body, }, - 'data': { - 'DriverList': jsonEncode([]), - }, 'android': { 'notification': { 'sound': tone, @@ -634,11 +640,11 @@ class FirebaseMessagesController extends GetxController { if (response.statusCode == 200) { print( 'Notification sent successfully. Status code: ${response.statusCode}'); - print('Response body: ${response.body}'); + // print('Response body: ${response.body}'); } else { print( 'Failed to send notification. Status code: ${response.statusCode}'); - print('Response body: ${response.body}'); + // print('Response body: ${response.body}'); } } catch (e) { print('Error sending notification: $e'); diff --git a/lib/controller/functions/crud.dart b/lib/controller/functions/crud.dart index e5cecfe..ea41bfe 100644 --- a/lib/controller/functions/crud.dart +++ b/lib/controller/functions/crud.dart @@ -9,6 +9,7 @@ import '../../constant/links.dart'; import '../../env/env.dart'; import '../../main.dart'; import '../../print.dart'; +import '../../views/widgets/elevated_btn.dart'; class CRUD { Future get({ @@ -37,7 +38,39 @@ class CRUD { return jsonData['status']; } + // } + Future sendWhatsAppAuth(String to) async { + var headers = { + 'Authorization': 'Bearer ${Env.whatsapp}', + 'Content-Type': 'application/json' + }; + var request = http.Request( + 'POST', + Uri.parse( + 'https://graph.facebook.com/v20.0/${Env.whatappID}/messages')); + + var bodyMap = { + "messaging_product": "whatsapp", + "to": to, + "type": "template", + "template": { + "name": "passengers_sefer_1", + "language": {"code": "ar"} + } + }; + + request.body = json.encode(bodyMap); + request.headers.addAll(headers); + + http.StreamedResponse response = await request.send(); + + if (response.statusCode == 200) { + print(await response.stream.bytesToString()); + } else { + print(response.reasonPhrase); + } + } Future getAgoraToken({ required String channelName, @@ -303,6 +336,26 @@ class CRUD { } else {} } + Future sendSmsEgypt(String phone, otp) async { + // String sender = await getSender(); + var headers = {'Content-Type': 'application/json'}; + var body = jsonEncode({ + "username": "Sefer", + "password": "E)Pu=an/@Z", + "message": otp, + "language": "e", + "sender": "Sefer Egy", + "receiver": phone + }); + + var res = await http.post( + Uri.parse(AppLink.sendSms), + body: body, + headers: headers, + ); + Log.print('res: ${res.body}'); + } + Future postPayMob({ required String link, Map? payload, @@ -483,4 +536,1349 @@ class CRUD { ); return json.decode(response.body); } + + List phoneDriversTest = [ + 201023248456, + 201023248456, + ]; + List phoneDrivers = [ + 201000038159, + 201000038736, + 201000064464, + 201000091230, + 201000136570, + 201000151861, + 201000198736, + 201000228580, + 201000237951, + 201000255720, + 201000287614, + 201000292939, + 201000304215, + 201000332271, + 201000392607, + 201000405678, + 201000426363, + 201000435451, + 201000480175, + 201000669808, + 201000692012, + 201000892261, + 201000927483, + 201001022044, + 201001088358, + 201001195138, + 201001216083, + 201001227223, + 201001231343, + 201001281229, + 201001324045, + 201001372270, + 201001448413, + 201001456101, + 201001460169, + 201001484302, + 201001486990, + 201001609106, + 201001614305, + 201001616098, + 201001695782, + 201001741428, + 201001868999, + 201001880988, + 201001917872, + 201001974843, + 201002026121, + 201002034349, + 201002050890, + 201002205527, + 201002211383, + 201002220298, + 201002380874, + 201002507461, + 201002524889, + 201002559121, + 201002593666, + 201002726223, + 201002757121, + 201002772429, + 201002831939, + 201002918886, + 201003008890, + 201003093029, + 201003111434, + 201003247072, + 201003284035, + 201003312497, + 201003322933, + 201003335753, + 201003395388, + 201003454075, + 201003457552, + 201003464748, + 201003516746, + 201003519354, + 201003562562, + 201003624502, + 201003660350, + 201003698426, + 201003732688, + 201003758852, + 201003769330, + 201003970205, + 201003973327, + 201004008170, + 201004034125, + 201004361687, + 201004362477, + 201004378446, + 201004508215, + 201004519539, + 201004558484, + 201004625077, + 201004658742, + 201004663695, + 201004712116, + 201004754688, + 201004770495, + 201004771729, + 201004800479, + 201004848413, + 201004965744, + 201005004603, + 201005094804, + 201005126645, + 201005145830, + 201005170670, + 201005215092, + 201005259664, + 201005285496, + 201005308188, + 201005315146, + 201005457333, + 201005457388, + 201005464946, + 201005467997, + 201005496502, + 201005591720, + 201005655832, + 201005748724, + 201005778338, + 201005802822, + 201005804981, + 201005840296, + 201005857716, + 201005894006, + 201006098594, + 201006119945, + 201006261655, + 201006336012, + 201006373310, + 201006399505, + 201006529560, + 201006550621, + 201006566057, + 201006568992, + 201006576933, + 201006642448, + 201006681860, + 201006701396, + 201006775356, + 201006833930, + 201006841969, + 201006874127, + 201006886819, + 201006905156, + 201006911892, + 201006953238, + 201006997521, + 201007006197, + 201007126077, + 201007135060, + 201007174032, + 201007210871, + 201007251945, + 201007420153, + 201007431781, + 201007436392, + 201007467887, + 201007526078, + 201007532774, + 201007536613, + 201007573334, + 201007581968, + 201007737308, + 201007740820, + 201007901024, + 201007910121, + 201008018110, + 201008053391, + 201008073697, + 201008235676, + 201008269802, + 201008306697, + 201008330262, + 201008360039, + 201008527428, + 201008529970, + 201008597171, + 201008698488, + 201008864162, + 201008872941, + 201008900034, + 201008940080, + 201008968686, + 201009033817, + 201009089217, + 201009120576, + 201009150184, + 201009171151, + 201009190006, + 201009225265, + 201009440993, + 201009752899, + 201009759313, + 201009793301, + 201009797500, + 201009804581, + 201009869329, + 201009886308, + 201009939077, + 201009945537, + 201009969727, + 201010025269, + 201010041236, + 201010107223, + 201010259482, + 201010376273, + 201010382250, + 201010490869, + 201010684229, + 201010743158, + 201010789827, + 201010866363, + 201010885870, + 201010887621, + 201010887705, + 201011205708, + 201011492446, + 201011508900, + 201011604297, + 201011723604, + 201011936165, + 201011953955, + 201011999310, + 201012036826, + 201012338391, + 201012342004, + 201012475707, + 201012530826, + 201012574024, + 201012775059, + 201012856677, + 201012962316, + 201013004000, + 201013135258, + 201013248449, + 201013327761, + 201013331683, + 201013725067, + 201014063641, + 201014242962, + 201014446768, + 201014626816, + 201014687816, + 201014714084, + 201014781950, + 201014786553, + 201015084707, + 201015162969, + 201015264416, + 201015328382, + 201015493716, + 201015554008, + 201015555050, + 201015654885, + 201015665467, + 201015736460, + 201015817826, + 201015994940, + 201016388436, + 201016408801, + 201016497939, + 201016565911, + 201016636646, + 201016748176, + 201017035902, + 201017062590, + 201017212144, + 201017435616, + 201017505135, + 201017567245, + 201017580860, + 201017650550, + 201017672180, + 201017690285, + 201017815188, + 201018042320, + 201018180201, + 201018416878, + 201018518723, + 201018861694, + 201018933273, + 201018984078, + 201019023091, + 201019069097, + 201019217036, + 201019266797, + 201019502290, + 201019782128, + 201019785811, + 201019859988, + 201020007540, + 201020060588, + 201020093997, + 201020170343, + 201020172859, + 201020178391, + 201020184220, + 201020235190, + 201020301781, + 201020335329, + 201020555412, + 201020649148, + 201020695352, + 201020847945, + 201020969782, + 201021017211, + 201021160682, + 201021222549, + 201021235129, + 201021394443, + 201021655556, + 201021736217, + 201021875274, + 201022226451, + 201022246204, + 201022265083, + 201022329267, + 201022446211, + 201022518181, + 201022660026, + 201023005090, + 201023069002, + 201023069907, + 201023095063, + 201023118846, + 201023130711, + 201023247045, + 201023248455, + 201023248456, + 201023248457, + 201023248488, + 201023626140, + 201023674737, + 201023790070, + 201023848787, + 201024052053, + 201024181778, + 201024420162, + 201024470224, + 201024501874, + 201024769948, + 201025075574, + 201025227216, + 201025255404, + 201025393959, + 201025412613, + 201025432017, + 201025463793, + 201025500060, + 201025581505, + 201025647745, + 201025737661, + 201025767385, + 201025887117, + 201026191863, + 201026200067, + 201026264611, + 201026300904, + 201026440737, + 201026773473, + 201026798518, + 201026807264, + 201027030168, + 201027234885, + 201027316763, + 201027481133, + 201027605557, + 201027719574, + 201027774092, + 201027775432, + 201027788822, + 201027994009, + 201028258757, + 201028313498, + 201028340666, + 201028603589, + 201028885144, + 201028912082, + 201029116604, + 201029135123, + 201029139900, + 201029296526, + 201029362080, + 201029484514, + 201029602004, + 201029777011, + 201029885806, + 201029929017, + 201029950342, + 201030014226, + 201030039804, + 201030047331, + 201030096464, + 201030145357, + 201030282895, + 201030356606, + 201030367702, + 201030382740, + 201030499449, + 201030530211, + 201030596294, + 201030673353, + 201030751777, + 201030806901, + 201030812036, + 201030885983, + 201030985581, + 201032073723, + 201032080240, + 201032197354, + 201032215558, + 201032599049, + 201032900804, + 201032960990, + 201032995929, + 201033006950, + 201033014117, + 201033053068, + 201033054527, + 201033087547, + 201033159408, + 201033499971, + 201033552484, + 201033598513, + 201033854635, + 201033970821, + 201040535096, + 201040873577, + 201050048044, + 201050774777, + 201050797017, + 201050894194, + 201050916243, + 201050923423, + 201060037563, + 201060040065, + 201060090105, + 201060156231, + 201060163215, + 201060208601, + 201060371260, + 201060444330, + 201060525792, + 201060577208, + 201060686267, + 201060794536, + 201060896771, + 201060906267, + 201060974333, + 201061099914, + 201061131720, + 201061337043, + 201061350410, + 201061489820, + 201061973544, + 201062031886, + 201062166038, + 201062319321, + 201062415502, + 201062603244, + 201062702907, + 201062718466, + 201062981863, + 201063103737, + 201063141018, + 201063251961, + 201063308303, + 201063525249, + 201063556251, + 201063600748, + 201063688477, + 201063831389, + 201063923914, + 201063955559, + 201064026674, + 201064054511, + 201064101887, + 201064153512, + 201064178167, + 201064312767, + 201064334558, + 201064468695, + 201064626776, + 201064630354, + 201064644619, + 201064684185, + 201064921214, + 201064982002, + 201065048819, + 201065050067, + 201065161321, + 201065286286, + 201065451010, + 201065601203, + 201065635907, + 201066228870, + 201066229104, + 201066253365, + 201066292351, + 201066465787, + 201066596220, + 201066730578, + 201067611319, + 201067696612, + 201067788258, + 201067791624, + 201067859062, + 201067889013, + 201067970457, + 201067986841, + 201068212833, + 201068640092, + 201068653978, + 201069074613, + 201069133688, + 201069483289, + 201069766969, + 201069938005, + 201070021630, + 201070076171, + 201070129941, + 201070290269, + 201070641133, + 201070665752, + 201080058399, + 201080068372, + 201080076746, + 201080269149, + 201080322306, + 201080351275, + 201080454035, + 201080688081, + 201080827009, + 201080931721, + 201080979919, + 201090009131, + 201090090088, + 201090119050, + 201090213039, + 201090333810, + 201090744905, + 201090809381, + 201091029772, + 201091467068, + 201091677319, + 201091729780, + 201091951144, + 201092955061, + 201092977597, + 201093030032, + 201093092520, + 201093122561, + 201093359914, + 201093594953, + 201093882353, + 201093981308, + 201094057691, + 201094186227, + 201094255708, + 201094584806, + 201094688043, + 201094688644, + 201094769303, + 201094924486, + 201094960584, + 201095032754, + 201095288771, + 201095667357, + 201095782382, + 201095956669, + 201096133443, + 201096148124, + 201096351318, + 201096567961, + 201096662301, + 201096725050, + 201096776146, + 201097229576, + 201097267405, + 201097761778, + 201097765410, + 201097846083, + 201097919136, + 201098123666, + 201098127395, + 201098166776, + 201098386668, + 201098582216, + 201098700882, + 201098957440, + 201099336257, + 201099412985, + 201099420820, + 201099530964, + 201099550606, + 201099600846, + 201099670072, + 201099785084, + 201099907868, + 201099915861, + 201099924551, + 201099981747, + 201099997143, + 201100038956, + 201100040727, + 201100074027, + 201100082801, + 201100170600, + 201100245413, + 201100316991, + 201100485561, + 201100583911, + 201100588511, + 201100667988, + 201100680306, + 201100711857, + 201100721522, + 201100726360, + 201101163626, + 201101371471, + 201101474377, + 201101512699, + 201101626410, + 201101795866, + 201101986128, + 201102192489, + 201102432276, + 201102563435, + 201102660856, + 201102752569, + 201102766374, + 201102779987, + 201104429778, + 201110110495, + 201110121075, + 201110144858, + 201110333451, + 201110600956, + 201110668338, + 201110797333, + 201110868027, + 201110921077, + 201111047616, + 201111105976, + 201111250676, + 201111282490, + 201111300613, + 201111512106, + 201111522040, + 201111528707, + 201111667567, + 201111697961, + 201111715992, + 201111716562, + 201111718210, + 201111751166, + 201111751446, + 201111754283, + 201111951209, + 201111981450, + 201112000443, + 201112022291, + 201112044799, + 201112105588, + 201112215276, + 201112235547, + 201112299884, + 201112524534, + 201112539202, + 201112591953, + 201112861834, + 201113001950, + 201113024717, + 201113305615, + 201113328519, + 201113512958, + 201113617737, + 201113701121, + 201113931993, + 201113999375, + 201114202318, + 201114211410, + 201114384428, + 201114568129, + 201114729635, + 201114776641, + 201114801155, + 201114988892, + 201115232474, + 201115299186, + 201115307275, + 201115440591, + 201115553247, + 201115605581, + 201115691406, + 201115790410, + 201115794827, + 201115801585, + 201115892867, + 201115934957, + 201115997592, + 201116036599, + 201116062390, + 201116155328, + 201116195736, + 201116360444, + 201116362464, + 201116397705, + 201116410122, + 201116646518, + 201116661682, + 201116662263, + 201116669877, + 201116684607, + 201116787624, + 201116951169, + 201116985014, + 201117008885, + 201117059617, + 201117246068, + 201117265855, + 201117558213, + 201117651958, + 201117663059, + 201117685256, + 201117730892, + 201117745888, + 201117937985, + 201118001729, + 201118002160, + 201118175123, + 201118243930, + 201118313079, + 201118331500, + 201118342702, + 201118636820, + 201118653148, + 201118674734, + 201118689666, + 201118706518, + 201118787900, + 201118882012, + 201118886390, + 201118970961, + 201119044711, + 201119079364, + 201119100748, + 201119137787, + 201119159545, + 201119187827, + 201119256418, + 201119298768, + 201119490066, + 201119499018, + 201119557005, + 201119601947, + 201119905035, + 201119928400, + 201119993654, + 201120071355, + 201120086686, + 201120161089, + 201120194397, + 201120272743, + 201120357820, + 201120732419, + 201120760088, + 201120777527, + 201120803031, + 201120840502, + 201120917643, + 201121000454, + 201121104000, + 201121115920, + 201121218416, + 201121262634, + 201121537458, + 201121539342, + 201121641905, + 201121645943, + 201121676093, + 201121721649, + 201121738274, + 201121833893, + 201121880293, + 201121904651, + 201121999951, + 201122130454, + 201122277009, + 201122352926, + 201122352929, + 201122441260, + 201122453889, + 201122466640, + 201122681852, + 201123138354, + 201123200082, + 201123237473, + 201123338071, + 201123355123, + 201123386341, + 201123606787, + 201123850040, + 201124166622, + 201124215002, + 201124355455, + 201124484309, + 201124525303, + 201124535519, + 201124554413, + 201124585917, + 201124868717, + 201124939986, + 201125111045, + 201125308780, + 201125388876, + 201125811384, + 201125869973, + 201126002027, + 201126047174, + 201126255847, + 201126312269, + 201126442254, + 201126625122, + 201126636750, + 201126659891, + 201126669098, + 201126946975, + 201127000498, + 201127009293, + 201127010150, + 201127029020, + 201127040489, + 201127068159, + 201127100040, + 201127233460, + 201127301093, + 201127315881, + 201128008500, + 201128144862, + 201128293924, + 201128316869, + 201128399780, + 201128482002, + 201128652929, + 201128716058, + 201128852395, + 201128872000, + 201128932455, + 201129157079, + 201129158922, + 201129706750, + 201129808001, + 201140276818, + 201140490935, + 201140823736, + 201140826987, + 201141094583, + 201141191135, + 201141231122, + 201141307507, + 201141385551, + 201141438922, + 201141473992, + 201141549347, + 201141573088, + 201141614543, + 201141675135, + 201141679102, + 201141679162, + 201141696200, + 201141724381, + 201141761526, + 201141822739, + 201141941402, + 201142001090, + 201142088851, + 201142136063, + 201142224902, + 201142381399, + 201142394076, + 201142461102, + 201142492474, + 201142783738, + 201142877782, + 201142889397, + 201142985578, + 201143123876, + 201143283485, + 201143335405, + 201143490888, + 201143631229, + 201143730080, + 201143791394, + 201143915554, + 201144038991, + 201144129961, + 201144175633, + 201144224787, + 201144294246, + 201144338541, + 201144352678, + 201144601683, + 201144626239, + 201144707747, + 201145000373, + 201145579943, + 201145611618, + 201145621795, + 201145809497, + 201145814704, + 201145828830, + 201145922310, + 201146055558, + 201146207812, + 201146445021, + 201146448910, + 201146461695, + 201146628267, + 201146791090, + 201147155402, + 201147181768, + 201147333047, + 201147429209, + 201147504941, + 201147769989, + 201147912222, + 201147965344, + 201148073829, + 201148140582, + 201148163794, + 201148283337, + 201148460674, + 201148504650, + 201148581664, + 201148656049, + 201149228245, + 201149363795, + 201149492463, + 201149518708, + 201150259592, + 201150300052, + 201150304075, + 201150343503, + 201150352022, + 201150451768, + 201150516739, + 201150533289, + 201150548146, + 201150647985, + 201150650378, + 201150793312, + 201150872150, + 201150921271, + 201151296487, + 201151458889, + 201151510446, + 201151593953, + 201151616245, + 201151845956, + 201151869870, + 201152054617, + 201152154482, + 201152184337, + 201152228476, + 201152336491, + 201152636067, + 201152851954, + 201152994061, + 201153086752, + 201153094925, + 201153260339, + 201153506778, + 201153508619, + 201153590337, + 201154004771, + 201154322032, + 201154404977, + 201154505875, + 201154554795, + 201154558329, + 201154566231, + 201154962800, + 201155018765, + 201155072426, + 201155110000, + 201155215891, + 201155394107, + 201155449375, + 201155465556, + 201155512282, + 201155540425, + 201155581701, + 201155617074, + 201155633622, + 201155705126, + 201155883321, + 201156012567, + 201156265716, + 201156422481, + 201156839185, + 201156894666, + 201156941320, + 201157009020, + 201157055175, + 201157121939, + 201157347771, + 201157566765, + 201157693835, + 201158232008, + 201158313756, + 201158342680, + 201158601956, + 201158680006, + 201158913381, + 201158937603, + 201159109401, + 201159430166, + 201159519690, + 201159555233, + 201159775543, + 201200008264, + 201200205662, + 201200225120, + 201200240122, + 201200360155, + 201200395648, + 201200520512, + 201200622072, + 201200622129, + 201200678667, + 201200751933, + 201200757011, + 201200811161, + 201200999580, + 201201025700, + 201201155000, + 201201294180, + 201201312691, + 201201383512, + 201201421326, + 201201491025, + 201201621622, + 201201840871, + 201202000888, + 201202211450, + 201202530513, + 201202665435, + 201202912341, + 201203014151, + 201203039750, + 201203181372, + 201203456879, + 201203477332, + 201204023121, + 201204281981, + 201204514017, + 201204688081, + 201204855400, + 201204977751, + 201205000292, + 201205031905, + 201205686247, + 201205759040, + 201206017464, + 201206600861, + 201206975332, + 201207121802, + 201207372344, + 201207616444, + 201207750441, + 201208085263, + 201208414347, + 201208977177, + 201210023938, + 201210583591, + 201210588038, + 201210732122, + 201210818176, + 201210945113, + 201211066299, + 201211079908, + 201211161032, + 201211795422, + 201211986162, + 201212145380, + 201212258721, + 201212479538, + 201220444133, + 201220612822, + 201220724766, + 201220820976, + 201220914219, + 201221041254, + 201221138834, + 201221212426, + 201221212824, + 201221278704, + 201221280828, + 201221328517, + 201221408219, + 201221732389, + 201221800122, + 201221954550, + 201222143516, + 201222278308, + 201222282205, + 201222332047, + 201222517257, + 201222620610, + 201222695023, + 201222748994, + 201222781707, + 201222967787, + 201222971467, + 201223234257, + 201223336884, + 201223376686, + 201223401519, + 201223456731, + 201223521664, + 201223596905, + 201223671633, + 201223705456, + 201223838760, + 201223874421, + 201223940650, + 201224050760, + 201224053907, + 201224213162, + 201224217248, + 201224236042, + 201224353363, + 201224380088, + 201224483706, + 201224508493, + 201224535248, + 201224661061, + 201224752065, + 201224825057, + 201224911013, + 201224927485, + 201224970278, + 201224971527, + 201225001313, + 201225015388, + 201225294141, + 201225301553, + 201225328559, + 201225460762, + 201225570507, + 201225656181, + 201225958509, + 201226262906, + 201226291683, + 201226315730, + 201226416059, + 201226461243, + 201226595175, + 201226655253, + 201226672939, + 201226757626, + 201226782942, + 201226790797, + 201226965492, + 201226994629, + 201227070538, + 201227314954, + 201227757571, + 201227831100, + 201227885100, + 201228030501, + 201228216918, + 201228781347, + 201228922343, + 201228946285, + 201229082850, + 201229123460, + 201229974967, + 201270550493, + 201270565699, + 201270626113, + 201271122314, + 201271132209, + 201271133956, + 201271160173, + 201271401468, + 201272021184, + 201272072854, + 201272336635, + 201272649581, + 201272939093, + 201273024547, + 201273073912, + 201273114754, + 201273170033, + 201273273705, + 201273808399, + 201273888510, + 201273943548, + 201274050210, + 201274206995, + 201274302911, + 201274527249, + 201274768678, + 201274793455, + 201274842863, + 201275200924, + 201275298194, + 201275610030, + 201275624989, + 201275662461, + 201275668382, + 201275901512, + 201276330019, + 201276624302, + 201276766553, + 201277014277, + 201277117926, + 201277131373, + 201277606290, + 201277740069, + 201277773181, + 201277855345, + 201277862323, + 201278119893, + 201278324075, + 201278378190, + 201278539943, + 201278956638, + 201279236054, + 201279296936, + 201279803133, + 201279872337, + 201279920962, + 201280024389, + 201280256821, + 201280433297, + 201280832425, + 201280838169, + 201281011857, + 201281181008, + 201281659132, + 201281802541, + 201281898421, + 201282199565, + 201282427635, + 201283170305, + 201283329751, + 201283991212, + 201284350745, + 201284436627, + 201284601547, + 201285060920, + 201285686701, + 201285980741, + 201286065056, + 201286254841, + 201287277734, + 201287585360, + 201287839817, + 201288006876, + 201288090780, + 201288199133, + 201288326620, + 201288446043, + 201288496608, + 201288863470, + 201289006333, + 201289354010, + 201289488182, + 201289723337, + 201289723730, + 201289920270, + 201500085192, + 201500263335, + 201500567444, + 201500791104, + 201500888614, + 201501355877, + 201501538118, + 201501602948, + 201501877880, + 201503227949, + 201507255344, + 201507416444, + 201508325183, + 201550132936, + 201550707584, + 201550801300, + 201550817512, + 201550861194, + 201550919395, + 201551141835, + 201551233318, + 201551418313, + 201551421493, + 201551465551, + 201551500674, + 201551630844, + 201551980169, + 201553022775, + 201553077785, + 201553222768, + 201553324455, + 201553335619, + 201553540894, + 201553684030, + 201553806016, + 201553996793, + 201554435301, + 201554666842, + 201554752044, + 201555000205, + 201555116452, + 201555181159, + 201555310975, + 201555320344, + 201555402805, + 201555408958, + 201555577228, + 201555583558, + 201555604325, + 201555791055, + 201555888091, + 201555944650, + 201556206194, + 201556754333, + 201557454447, + 201557567007, + 201557770122, + 201558550454, + 201559170967, + 201559975610, + 21142703233 + ]; } diff --git a/lib/controller/notification_controller.dart b/lib/controller/notification_controller.dart index d1017f7..143ca3d 100644 --- a/lib/controller/notification_controller.dart +++ b/lib/controller/notification_controller.dart @@ -1,12 +1,15 @@ import 'package:flutter/widgets.dart'; import 'package:get/get.dart'; import 'package:sefer_admin1/constant/box_name.dart'; +import 'package:sefer_admin1/constant/links.dart'; import 'package:sefer_admin1/controller/firebase/firbase_messge.dart'; +import 'package:sefer_admin1/controller/functions/crud.dart'; import 'package:sefer_admin1/main.dart'; import 'package:sefer_admin1/views/widgets/elevated_btn.dart'; import 'package:sefer_admin1/views/widgets/my_textField.dart'; import '../constant/style.dart'; +import '../print.dart'; class NotificationController extends GetxController { final formKey = GlobalKey(); @@ -54,14 +57,37 @@ class NotificationController extends GetxController { confirm: MyElevatedButton( title: 'send'.tr, onPressed: () async { - tokensDriver = box.read(BoxName.tokensDrivers); - if (formKey.currentState!.validate()) { - for (var i = 0; i < tokensDriver.length; i++) { - print(tokensDriver.length); - // FirebaseMessagesController().sendNotificationToAnyWithoutData( - // title.text, body.text, tokensDriver[i]); - } + // tokensDriver = box.read(BoxName.tokensDrivers)['message']; + // Log.print('tokensDriver: ${tokensDriver}'); + // if (formKey.currentState!.validate()) { + box.read(BoxName.tokensDrivers)['message'].length; + for (var i = 0; + i < box.read(BoxName.tokensDrivers)['message'].length; + i++) { + // for (var i = 0; i < 2; i++) { + // print(i); + var res = await CRUD() + .post(link: AppLink.addNotificationCaptain, payload: { + "driverID": box + .read(BoxName.tokensDrivers)['message'][i]['id'] + .toString(), + "title": title.text, + "body": body.text, + }); + Log.print('res: ${res}'); + // Log.print('tokensDriver[i]: ${tokensDriver[i]}'); + Future.delayed(const Duration(microseconds: 50)); + + FirebaseMessagesController().sendNotificationToAnyWithoutData( + title.text, + body.text, + box + .read(BoxName.tokensDrivers)['message'][i]['token'] + .toString(), + 'tone2.wav'); } + Get.back(); + // } }), cancel: MyElevatedButton( title: 'cancel', @@ -115,3 +141,52 @@ class NotificationController extends GetxController { })); } } +// يلا دلوقتي! تطبيق سفر جاهز عشان تبدأ تستقبل الطلبات +// • افتح التطبيق دلوقتي، واستعد إنك تستقبل طلبات أكتر. كل ما تكون فاتح، فرصتك في الطلبات بتزيد! +// 2. خليك فاتح واستقبل طلبات أكتر مع تطبيق سفر +// • وجودك متصل في التطبيق هيخليك تستقبل طلبات أكتر. افتح التطبيق دلوقتي وما تفوتش الفرصة! +// 3. فرصتك لزيادة دخلك مع تطبيق سفر تبدأ من دلوقتي! +// • مجرد إنك تفتح التطبيق مش هيأثر عليك، بالعكس، هيزود فرصتك في طلبات أكتر. افتح التطبيق واشترك دلوقتي! + +//sms +// link sefer driver is https://shorturl.at/IHJcm1. +// // ميزات الأمان بعد 500 رحلة: +// • “بعد 500 رحلة مع سفر، تحصل على مميزات أمان إضافية لضمان راحتك.” +// • “نوفر لك ميزات أمان متقدمة بعد 500 رحلة لتجربة قيادة أكثر أمانًا.” +// • “مع 500 رحلة، تحصل على دعم أمني متقدم لتوفير أفضل تجربة قيادة.” +// 2. ميزات الصيانة: +// • “احصل على خدمات صيانة مجانية بعد عدد معين من الرحلات مع سفر.” +// • “استمتع بخدمات صيانة حصرية عند الوصول إلى عدد محدد من الرحلات.” +// • “مع سفر، نقدم لك عروض صيانة مميزة لتحافظ على سيارتك في أفضل حال.” +// 3. ميزات فتح حسابات البنوك: +// • “مع سفر، يمكنك فتح حساب بنكي بسهولة واستفادة من عروض مميزة.” +// • “افتح حساب بنكي مع تطبيق سفر واستفد من خدمات مالية حصرية.” +// • “نساعدك على فتح حساب بنكي بأفضل العروض بالتعاون مع البنوك المحلية.” +// 4. ميزات ورود السيارات ومعارض السيارات الخاصة بنا: +// • “استمتع بعروض مميزة لشراء السيارات من معارض سفر الحصرية.” +// • “اختر سيارتك المثالية من معارض سفر بأسعار تنافسية وخدمات مميزة.” +// • “نقدم لك أفضل عروض السيارات من معارضنا لتسهيل امتلاك سيارتك الجديدة.” +// 5. ميزات أوفر كار: +// • “أوفر كار من سفر توفر لك سيارات اقتصادية لزيادة دخلك بكفاءة.” +// • “مع أوفر كار، يمكنك العمل بسيارات اقتصادية وتحقيق أرباح أكبر.” +// • “تطبيق سفر يقدم لك أوفر كار، الخيار الاقتصادي المثالي لزيادة دخلك.” +// 6. مستوى الدخل المحدود والطلبات الاقتصادية: +// • “لأصحاب الدخل المحدود، وفرنا طلبات اقتصادية تضمن لك زيادة دخلك.” +// • “الطلبات الاقتصادية من سفر تساعدك على زيادة دخلك بسهولة وفعالية.” +// • “استفد من طلبات اقتصادية تناسب أصحاب الدخل المحدود لزيادة أرباحك.” +// 7. طلبات الليل: +// • “مع طلبات الليل من سفر، زود دخلك واستفد من فرص إضافية في المساء.” +// • “لا تفوت فرصة طلبات الليل مع سفر، زود دخلك في أي وقت.” +// • “طلبات الليل من سفر توفر لك فرصًا إضافية لتحقيق دخل أعلى.” +// 8. طلبات الكمفورت الأكثر راحة والسيارات المكيفة: +// • “قدّم خدمة مريحة مع طلبات الكمفورت من سفر والسيارات المكيفة.” +// • “طلبات الكمفورت توفر تجربة راقية للركاب بسيارات مكيفة ومريحة.” +// • “مع سفر، سيارات الكمفورت المكيفة تضمن راحة الركاب وزيادة الطلبات.” +// 9. طلبات السبيد: +// • “استقبل طلبات السبيد مع سفر لتقديم رحلات أسرع وزيادة دخلك.” +// • “طلبات السبيد توفر لك فرصة إكمال المزيد من الرحلات في وقت أقل.” +// • “مع طلبات السبيد من سفر، تقدم خدمة سريعة وفعالة لزيادة الأرباح.” +// 10. الطلبات الثابتة والمعتدلة السعر والنسبة الثابتة 8%: +// • “مع نسبة ثابتة 8%، تحصل على أفضل عروض الأسعار مع سفر.” +// • “استمتع بنسبة ثابتة 8%، أقل نسبة بين المنافسين لزيادة دخلك.” +// • “طلبات سفر الثابتة تضمن لك دخلاً مستقراً بنسبة أقل من 8%.” diff --git a/lib/models/model/passengers_model.dart b/lib/models/model/passengers_model.dart index 3f97d00..c044e56 100644 --- a/lib/models/model/passengers_model.dart +++ b/lib/models/model/passengers_model.dart @@ -11,6 +11,34 @@ class MonthlyPassengerInstall { int.parse(json['totalPassengers'].toString().split(':')[0])); } +class MonthlyRidesInstall { + int day; + int totalRides; + + MonthlyRidesInstall({required this.day, required this.totalRides}); + + factory MonthlyRidesInstall.fromJson(Map json) => + MonthlyRidesInstall( + day: int.parse(json['day'].toString().split('-')[2]), + totalRides: int.parse(json['totalRides'].toString().split(':')[0])); +} + +class MonthlyEmployeeData { + int day; + int totalEmployees; + String name; + + MonthlyEmployeeData( + {required this.day, required this.totalEmployees, required this.name}); + + factory MonthlyEmployeeData.fromJson(Map json) => + MonthlyEmployeeData( + day: int.parse(json['date'].toString().split('-')[2]), // Extract day + totalEmployees: json['count'], + name: json['NAME'], + ); +} + class MonthlyDriverInstall { int day; int totalDrivers; diff --git a/lib/views/admin/admin_home_page.dart b/lib/views/admin/admin_home_page.dart index 2d5cd95..08d3ab3 100644 --- a/lib/views/admin/admin_home_page.dart +++ b/lib/views/admin/admin_home_page.dart @@ -8,12 +8,15 @@ import 'package:sefer_admin1/controller/admin/static_controller.dart'; import 'package:sefer_admin1/controller/notification_controller.dart'; import 'package:sefer_admin1/views/admin/captain/drivers_cant_registe.dart'; import 'package:sefer_admin1/views/admin/captain/register_captain.dart'; +import 'package:sefer_admin1/views/widgets/elevated_btn.dart'; +import 'package:sefer_admin1/views/widgets/my_textField.dart'; import 'package:sefer_admin1/views/widgets/mycircular.dart'; import '../../constant/links.dart'; import '../../constant/style.dart'; import '../../controller/functions/crud.dart'; import '../../controller/functions/gemeni.dart'; +import '../../print.dart'; import '../widgets/my_scafold.dart'; import 'captain/captain.dart'; import 'passenger/passenger.dart'; @@ -339,12 +342,63 @@ class AdminHomePage extends StatelessWidget { Get.to(() => const StaticDash()); }, ), + AdminWidgetsDashBoard( + title: 'send Whatsapp to Drivers', + onPressed: () async { + Get.defaultDialog( + title: 'Are you sure to send by WhatsApp ?', + middleText: '', + confirm: MyElevatedButton( + title: 'Ok', + kolor: AppColor.greenColor, + onPressed: () async { + Log.print( + 'CRUD().phoneDriversTest.: ${CRUD().phoneDriversTest}'); + for (var phoneNumber + in CRUD().phoneDrivers) { + await CRUD().sendWhatsAppAuth( + phoneNumber.toString()); + } + }), + cancel: MyElevatedButton( + title: 'cancel', + kolor: AppColor.redColor, + onPressed: () => Get.back())); + }), AdminWidgetsDashBoard( title: 'send notification Drivers', onPressed: () async { await Get.put(NotificationController()) .getTokensDrivers(); }), + AdminWidgetsDashBoard( + title: 'send SMS Drivers', + onPressed: () async { + Get.defaultDialog( + title: 'Are you sure to send SMS ?', + middleText: '', + content: Padding( + padding: const EdgeInsets.all(8.0), + child: Form( + key: dashboardController.formKey, + child: MyTextForm( + controller: + dashboardController.smsText, + label: 'label', + hint: 'hint', + type: TextInputType.name)), + ), + confirm: MyElevatedButton( + title: 'Ok', + kolor: AppColor.greenColor, + onPressed: () async { + dashboardController.sendSMSMethod(); + }), + cancel: MyElevatedButton( + title: 'cancel', + kolor: AppColor.redColor, + onPressed: () => Get.back())); + }), AdminWidgetsDashBoard( title: 'send notification Passengers', onPressed: () async { diff --git a/lib/views/admin/static/static.dart b/lib/views/admin/static/static.dart index 2bb0b70..64e8ace 100644 --- a/lib/views/admin/static/static.dart +++ b/lib/views/admin/static/static.dart @@ -230,8 +230,7 @@ class StaticDash extends StatelessWidget { lineBarsData: [ LineChartBarData( isStepLineChart: true, - spots: staticController - .chartDataDriversCalling, + spots: staticController.chartDataRides, isCurved: true, color: Colors .deepPurpleAccent, // Custom color @@ -241,7 +240,8 @@ class StaticDash extends StatelessWidget { true), // Show dots on each point belowBarData: BarAreaData( show: true, - color: Colors.deepPurpleAccent + color: const Color.fromARGB( + 255, 65, 144, 86) .withOpacity( 0.3), // Custom gradient color ), @@ -267,7 +267,7 @@ class StaticDash extends StatelessWidget { ), bottomTitles: AxisTitles( axisNameWidget: Text( - 'Total Drivers on month are Calliing ${staticController.staticList[0]['totalMonthlyCallingDrivers']}' + 'Total Rides on month ${staticController.totalMonthlyRides}' .tr, style: AppStyle.subtitle, ), @@ -279,7 +279,7 @@ class StaticDash extends StatelessWidget { ), leftTitles: AxisTitles( axisNameWidget: Text( - 'Counts of Drivers on days'.tr, + 'Counts of Rides on days'.tr, style: const TextStyle( fontSize: 14, fontWeight: FontWeight.bold), @@ -308,6 +308,160 @@ class StaticDash extends StatelessWidget { const SizedBox( height: 5, ), + SizedBox( + height: Get.height * .3, + width: double.maxFinite, + child: Padding( + padding: const EdgeInsets.all(6), + child: Container( + decoration: AppStyle.boxDecoration1, + height: MediaQuery.of(context).size.height * 0.4, + child: LineChart( + LineChartData( + lineBarsData: [ + LineChartBarData( + spots: staticController + .chartDataEmployeeMaryam, + isCurved: true, + color: + Colors.blue, // Custom color for Maryam + barWidth: 3, + dotData: const FlDotData(show: true), + belowBarData: BarAreaData( + show: true, + color: Colors.blue.withOpacity(0.3)), + ), + LineChartBarData( + spots: + staticController.chartDataEmployeeRawda, + isCurved: true, + color: Colors.red, // Custom color for Rawda + barWidth: 3, + dotData: const FlDotData(show: true), + belowBarData: BarAreaData( + show: true, + color: Colors.red.withOpacity(0.3)), + ), + LineChartBarData( + spots: + staticController.chartDataEmployeeMena, + isCurved: true, + color: + Colors.green, // Custom color for Mena + barWidth: 3, + dotData: const FlDotData(show: true), + belowBarData: BarAreaData( + show: true, + color: Colors.green.withOpacity(0.3)), + ), + ], + titlesData: const FlTitlesData( + bottomTitles: AxisTitles( + sideTitles: SideTitles(showTitles: true), + ), + leftTitles: AxisTitles( + sideTitles: SideTitles(showTitles: true), + ), + ), + gridData: const FlGridData(show: true), + borderData: FlBorderData(show: true), + ), + ), + ), + ), + ), + // SizedBox( + // height: Get.height * .3, + // width: double.maxFinite, + // // decoration: AppStyle.boxDecoration1, + // child: Padding( + // padding: const EdgeInsets.all(6), + // child: Container( + // decoration: AppStyle.boxDecoration1, + // height: MediaQuery.of(context).size.height * 0.4, + // child: LineChart( + // LineChartData( + // lineBarsData: [ + // LineChartBarData( + // isStepLineChart: true, + // spots: staticController + // .chartDataDriversCalling, + // isCurved: true, + // color: Colors + // .deepPurpleAccent, // Custom color + // barWidth: 3, // Thinner line + // dotData: const FlDotData( + // show: + // true), // Show dots on each point + // belowBarData: BarAreaData( + // show: true, + // color: Colors.deepPurpleAccent + // .withOpacity( + // 0.3), // Custom gradient color + // ), + // isStrokeJoinRound: true, + // shadow: const BoxShadow( + // color: Colors.yellow, + // blurRadius: 4, + // offset: Offset(2, 2), + // ), + // ), + // ], + // showingTooltipIndicators: const [], + // titlesData: FlTitlesData( + // show: true, + // topTitles: AxisTitles( + // axisNameWidget: Text( + // 'Days'.tr, + // style: const TextStyle( + // fontSize: 14, + // fontWeight: FontWeight.bold), + // ), + // axisNameSize: 30, + // ), + // bottomTitles: AxisTitles( + // axisNameWidget: Text( + // 'Total Drivers on month are Calliing ${staticController.staticList[0]['totalMonthlyCallingDrivers']}' + // .tr, + // style: AppStyle.subtitle, + // ), + // axisNameSize: 30, + // sideTitles: const SideTitles( + // reservedSize: 30, + // showTitles: true, + // ), + // ), + // leftTitles: AxisTitles( + // axisNameWidget: Text( + // 'Counts of Drivers on days'.tr, + // style: const TextStyle( + // fontSize: 14, + // fontWeight: FontWeight.bold), + // ), + // axisNameSize: 30, + // sideTitles: const SideTitles( + // reservedSize: 30, + // showTitles: true, + // ), + // ), + // ), + // gridData: const FlGridData(show: true), + // borderData: FlBorderData( + // show: true, + // border: const Border( + // bottom: + // BorderSide(color: Colors.blueAccent), + // left: + // BorderSide(color: Colors.blueAccent), + // ), + // ), + // ), + // ), + // ), + // )), + // const SizedBox( + // height: 5, + // ), SizedBox( height: Get.height * .3, width: double.maxFinite, diff --git a/macos/Podfile b/macos/Podfile index b52666a..62045fb 100644 --- a/macos/Podfile +++ b/macos/Podfile @@ -1,5 +1,5 @@ -platform :osx, '10.15' - +# platform :osx, '10.15' +platform :ios, '14.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/macos/Podfile.lock b/macos/Podfile.lock deleted file mode 100644 index 5e7dfdf..0000000 --- a/macos/Podfile.lock +++ /dev/null @@ -1,181 +0,0 @@ -PODS: - - AppAuth (1.7.5): - - AppAuth/Core (= 1.7.5) - - AppAuth/ExternalUserAgent (= 1.7.5) - - AppAuth/Core (1.7.5) - - AppAuth/ExternalUserAgent (1.7.5): - - AppAuth/Core - - file_selector_macos (0.0.1): - - FlutterMacOS - - Firebase/CoreOnly (10.25.0): - - FirebaseCore (= 10.25.0) - - Firebase/Messaging (10.25.0): - - Firebase/CoreOnly - - FirebaseMessaging (~> 10.25.0) - - firebase_core (2.32.0): - - Firebase/CoreOnly (~> 10.25.0) - - FlutterMacOS - - firebase_messaging (14.9.4): - - Firebase/CoreOnly (~> 10.25.0) - - Firebase/Messaging (~> 10.25.0) - - firebase_core - - FlutterMacOS - - FirebaseCore (10.25.0): - - FirebaseCoreInternal (~> 10.0) - - GoogleUtilities/Environment (~> 7.12) - - GoogleUtilities/Logger (~> 7.12) - - FirebaseCoreInternal (10.29.0): - - "GoogleUtilities/NSData+zlib (~> 7.8)" - - FirebaseInstallations (10.29.0): - - FirebaseCore (~> 10.0) - - GoogleUtilities/Environment (~> 7.8) - - GoogleUtilities/UserDefaults (~> 7.8) - - PromisesObjC (~> 2.1) - - FirebaseMessaging (10.25.0): - - FirebaseCore (~> 10.0) - - FirebaseInstallations (~> 10.0) - - GoogleDataTransport (~> 9.3) - - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - - GoogleUtilities/Environment (~> 7.8) - - GoogleUtilities/Reachability (~> 7.8) - - GoogleUtilities/UserDefaults (~> 7.8) - - nanopb (< 2.30911.0, >= 2.30908.0) - - flutter_secure_storage_macos (6.1.1): - - FlutterMacOS - - FlutterMacOS (1.0.0) - - google_sign_in_ios (0.0.1): - - AppAuth (>= 1.7.4) - - Flutter - - FlutterMacOS - - GoogleSignIn (~> 7.1) - - GTMSessionFetcher (>= 3.4.0) - - GoogleDataTransport (9.4.1): - - GoogleUtilities/Environment (~> 7.7) - - nanopb (< 2.30911.0, >= 2.30908.0) - - PromisesObjC (< 3.0, >= 1.2) - - GoogleSignIn (7.1.0): - - AppAuth (< 2.0, >= 1.7.3) - - GTMAppAuth (< 5.0, >= 4.1.1) - - GTMSessionFetcher/Core (~> 3.3) - - GoogleUtilities/AppDelegateSwizzler (7.13.3): - - GoogleUtilities/Environment - - GoogleUtilities/Logger - - GoogleUtilities/Network - - GoogleUtilities/Privacy - - GoogleUtilities/Environment (7.13.3): - - GoogleUtilities/Privacy - - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/Logger (7.13.3): - - GoogleUtilities/Environment - - GoogleUtilities/Privacy - - GoogleUtilities/Network (7.13.3): - - GoogleUtilities/Logger - - "GoogleUtilities/NSData+zlib" - - GoogleUtilities/Privacy - - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (7.13.3)": - - GoogleUtilities/Privacy - - GoogleUtilities/Privacy (7.13.3) - - GoogleUtilities/Reachability (7.13.3): - - GoogleUtilities/Logger - - GoogleUtilities/Privacy - - GoogleUtilities/UserDefaults (7.13.3): - - GoogleUtilities/Logger - - GoogleUtilities/Privacy - - GTMAppAuth (4.1.1): - - AppAuth/Core (~> 1.7) - - GTMSessionFetcher/Core (< 4.0, >= 3.3) - - GTMSessionFetcher (3.5.0): - - GTMSessionFetcher/Full (= 3.5.0) - - GTMSessionFetcher/Core (3.5.0) - - GTMSessionFetcher/Full (3.5.0): - - GTMSessionFetcher/Core - - nanopb (2.30910.0): - - nanopb/decode (= 2.30910.0) - - nanopb/encode (= 2.30910.0) - - nanopb/decode (2.30910.0) - - nanopb/encode (2.30910.0) - - path_provider_foundation (0.0.1): - - Flutter - - FlutterMacOS - - PromisesObjC (2.4.0) - - sqflite (0.0.3): - - Flutter - - FlutterMacOS - - url_launcher_macos (0.0.1): - - FlutterMacOS - -DEPENDENCIES: - - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`) - - firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`) - - firebase_messaging (from `Flutter/ephemeral/.symlinks/plugins/firebase_messaging/macos`) - - flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`) - - FlutterMacOS (from `Flutter/ephemeral`) - - google_sign_in_ios (from `Flutter/ephemeral/.symlinks/plugins/google_sign_in_ios/darwin`) - - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) - - sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/darwin`) - - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) - -SPEC REPOS: - trunk: - - AppAuth - - Firebase - - FirebaseCore - - FirebaseCoreInternal - - FirebaseInstallations - - FirebaseMessaging - - GoogleDataTransport - - GoogleSignIn - - GoogleUtilities - - GTMAppAuth - - GTMSessionFetcher - - nanopb - - PromisesObjC - -EXTERNAL SOURCES: - file_selector_macos: - :path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos - firebase_core: - :path: Flutter/ephemeral/.symlinks/plugins/firebase_core/macos - firebase_messaging: - :path: Flutter/ephemeral/.symlinks/plugins/firebase_messaging/macos - flutter_secure_storage_macos: - :path: Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos - FlutterMacOS: - :path: Flutter/ephemeral - google_sign_in_ios: - :path: Flutter/ephemeral/.symlinks/plugins/google_sign_in_ios/darwin - path_provider_foundation: - :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin - sqflite: - :path: Flutter/ephemeral/.symlinks/plugins/sqflite/darwin - url_launcher_macos: - :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos - -SPEC CHECKSUMS: - AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa - file_selector_macos: 54fdab7caa3ac3fc43c9fac4d7d8d231277f8cf2 - Firebase: 0312a2352584f782ea56f66d91606891d4607f06 - firebase_core: b5b8b60dad71f93132bbaa21e8d1379367d824f0 - firebase_messaging: d821ad7103878837085612e389fe66203c5c6c0c - FirebaseCore: 7ec4d0484817f12c3373955bc87762d96842d483 - FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934 - FirebaseInstallations: 913cf60d0400ebd5d6b63a28b290372ab44590dd - FirebaseMessaging: 88950ba9485052891ebe26f6c43a52bb62248952 - flutter_secure_storage_macos: 59459653abe1adb92abbc8ea747d79f8d19866c9 - FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 - google_sign_in_ios: 07375bfbf2620bc93a602c0e27160d6afc6ead38 - GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a - GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db - GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 - GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de - GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 - nanopb: 438bc412db1928dac798aa6fd75726007be04262 - path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 - PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 - sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec - url_launcher_macos: 5f437abeda8c85500ceb03f5c1938a8c5a705399 - -PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3 - -COCOAPODS: 1.15.2 diff --git a/pubspec.lock b/pubspec.lock index 2a22a30..3efa288 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -700,18 +700,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -788,18 +788,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mime: dependency: transitive description: @@ -1040,10 +1040,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" timing: dependency: transitive description: @@ -1136,10 +1136,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.5" watcher: dependency: transitive description: @@ -1168,10 +1168,10 @@ packages: dependency: transitive description: name: win32 - sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb" + sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" url: "https://pub.dev" source: hosted - version: "5.5.0" + version: "5.5.4" xdg_directories: dependency: transitive description: