This commit is contained in:
Hamza-Ayed
2024-09-19 06:55:42 +03:00
parent 85ece97855
commit b09e0da403
22 changed files with 352 additions and 186 deletions

View File

@@ -54,8 +54,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = 23
targetSdk = flutter.targetSdkVersion
versionCode = 85
versionName = '1.5.85'
versionCode = 88
versionName = '1.5.88`'
multiDexEnabled =true
}

View File

@@ -20,14 +20,12 @@
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<!-- <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" /> -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

@@ -63,18 +63,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:
@@ -95,18 +95,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"
path:
dependency: transitive
description:
@@ -164,10 +164,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"
vector_math:
dependency: transitive
description:
@@ -180,10 +180,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"
sdks:
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"

View File

@@ -4,7 +4,7 @@ import FirebaseCore
import GoogleMaps
// import Constants
@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(

View File

@@ -9,6 +9,7 @@ class BoxName {
static const String myList = "myList";
static const String bodyOrder = "bodyOrder";
static const String gender = "gender";
static const String phoneWallet = "phoneWallet";
static const String IsSavedPhones = "IsSavedPhones";
static const String carType = "carType";
static const String isFirstTime = "isFirstTime";

View File

@@ -8,7 +8,8 @@ class AppLink {
static final String seferPaymentServer = '${Env.seferPaymentServer}/ride';
static final String seferAlexandriaServer = Env.seferAlexandriaServer;
static final String seferCairoServer = Env.seferCairoServer;
static final String seferGizaServer = Env.seferGizaServer;
static const String seferGizaServer = 'https://gizasefer.online/sefer';
// static final String seferGizaServer = Env.seferGizaServer;
static final String endPoint =
box.read(BoxName.serverChosen) ?? Env.seferCairoServer;

View File

@@ -96,7 +96,8 @@ class RegisterCaptainController extends GetxController {
sendOtpMessage() async {
SmsEgyptController smsEgyptController = Get.put(SmsEgyptController());
isLoading = true;
update();
int randomNumber = Random().nextInt(100000) + 1;
isLoading = true;
update();
@@ -156,6 +157,8 @@ class RegisterCaptainController extends GetxController {
}
}
}
isLoading = false;
update();
}
verifySMSCode() async {

View File

@@ -134,10 +134,10 @@ class FirebaseMessagesController extends GetxController {
'body': message.notification!.body
});
} else if (message.notification!.title == 'Cancel Trip') {
// if (Platform.isAndroid) {
// NotificationController().showNotification(
// 'Cancel Trip'.tr, 'Passenger Cancel Trip'.tr, 'cancel', '');
// }
if (Platform.isAndroid) {
NotificationController().showNotification(
'Cancel Trip'.tr, 'Passenger Cancel Trip'.tr, 'cancel', '');
}
cancelTripDialog();
} else if (message.notification!.title == 'VIP Order') {
var myListString = message.data['DriverList'];
@@ -166,7 +166,7 @@ class FirebaseMessagesController extends GetxController {
} else if (message.notification!.title! == 'message From passenger') {
if (Platform.isAndroid) {
NotificationController()
.showNotification('message From passenger', ''.tr, 'tone2', '');
.showNotification('message From passenger'.tr, ''.tr, 'tone2', '');
}
passengerDialog(message.notification!.body!);
@@ -448,7 +448,7 @@ class FirebaseMessagesController extends GetxController {
// ));
// }
void sendNotificationAll(String title, body) async {
void sendNotificationAll(String title, body, tone) async {
// Get the token you want to subtract.
String token = box.read(BoxName.tokenFCM);
tokens = box.read(BoxName.tokens);
@@ -490,19 +490,34 @@ class FirebaseMessagesController extends GetxController {
'Authorization': 'Bearer $accessToken',
},
body: jsonEncode({
'notification': <String, dynamic>{
'message': {
'token': token,
'notification': {
'title': title,
'body': body,
'sound': 'ding.wav'
},
'priority': 'high',
'data': <String, dynamic>{
'click_action': 'FLUTTER_NOTIFICATION_CLICK',
'id': '1',
'status': 'done'
// 'data': {
// 'DriverList': jsonEncode(data),
// },
'android': {
'priority': 'high', // Set priority to high
'notification': {
'sound': tone,
},
'to': tokens[i],
}))
},
'apns': {
'headers': {
'apns-priority': '10', // Set APNs priority to 10
},
'payload': {
'aps': {
'sound': tone,
},
},
},
},
}),
)
.whenComplete(() {})
.catchError((e) {});
}
@@ -568,16 +583,32 @@ class FirebaseMessagesController extends GetxController {
'Authorization': 'Bearer $accessToken',
},
body: jsonEncode({
'notification': <String, dynamic>{
'message': {
'token': token,
'notification': {
'title': title,
'body': body,
'sound': tone
},
'data': {
'passengerList': map,
},
'priority': 'high',
'to': token,
'android': {
'priority': 'high', // Set priority to high
'notification': {
'sound': tone,
},
},
'apns': {
'headers': {
'apns-priority': '10', // Set APNs priority to 10
},
'payload': {
'aps': {
'sound': tone,
},
},
},
},
}),
);
@@ -593,7 +624,7 @@ class FirebaseMessagesController extends GetxController {
}
void sendNotificationToPassengerTokenCALL(
String title, body, token, List<String> map) async {
String title, body, token, List<String> map, String tone) async {
try {
String serviceAccountKeyJson = '''{
"type": "service_account",
@@ -635,14 +666,18 @@ class FirebaseMessagesController extends GetxController {
'passengerList': jsonEncode(map),
},
'android': {
'priority': 'high', // Set priority to high
'notification': {
'sound': 'iphone_ringtone.wav',
'sound': tone,
},
},
'apns': {
'headers': {
'apns-priority': '10', // Set APNs priority to 10
},
'payload': {
'aps': {
'sound': 'iphone_ringtone.wav',
'sound': tone,
},
},
},
@@ -707,11 +742,15 @@ class FirebaseMessagesController extends GetxController {
'DriverList': jsonEncode([]),
},
'android': {
'priority': 'high', // Set priority to high
'notification': {
'sound': tone,
},
},
'apns': {
'headers': {
'apns-priority': '10', // Set APNs priority to 10
},
'payload': {
'aps': {
'sound': tone,
@@ -779,11 +818,15 @@ class FirebaseMessagesController extends GetxController {
'DriverList': jsonEncode(data),
},
'android': {
'priority': 'high', // Set priority to high
'notification': {
'sound': tone,
},
},
'apns': {
'headers': {
'apns-priority': '10', // Set APNs priority to 10
},
'payload': {
'aps': {
'sound': tone,
@@ -809,7 +852,7 @@ class FirebaseMessagesController extends GetxController {
}
void sendNotificationToDriverMapPolyline(String title, String body,
String token, List<String> data, String polylineJson) async {
String token, List<String> data, String polylineJson, String tone) async {
try {
String serviceAccountKeyJson = '''{
"type": "service_account",
@@ -841,18 +884,32 @@ class FirebaseMessagesController extends GetxController {
'Authorization': 'Bearer $accessToken',
},
body: jsonEncode({
'notification': <String, dynamic>{
'message': {
'token': token,
'notification': {
'title': title,
'body': body,
// 'sound': 'tone2.wav',
'sound': 'order.wav'
},
'data': {
'DriverList': data,
'PolylineJson': polylineJson,
'DriverList': jsonEncode(data),
},
'android': {
'priority': 'high', // Set priority to high
'notification': {
'sound': tone,
},
},
'apns': {
'headers': {
'apns-priority': '10', // Set APNs priority to 10
},
'payload': {
'aps': {
'sound': tone,
},
},
},
},
'priority': 'high',
'to': token,
}),
);

View File

@@ -14,11 +14,10 @@ import '../home/captin/home_captain_controller.dart';
class NotificationController extends GetxController {
final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
// Initializes the local notifications plugin
Future<void> initNotifications() async {
const AndroidInitializationSettings android =
AndroidInitializationSettings('app_icon');
AndroidInitializationSettings('@mipmap/launcher_icon');
const InitializationSettings initializationSettings =
InitializationSettings(android: android);
@@ -175,3 +174,67 @@ class NotificationController extends GetxController {
// display a dialog with the notification details, tap ok to go to another page
}
}
// import 'package:flutter_local_notifications/flutter_local_notifications.dart';
// import 'package:get/get.dart';
// import 'package:timezone/data/latest.dart' as tz;
// import 'package:timezone/timezone.dart' as tz;
// class NotificationController extends GetxController {
// final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
// FlutterLocalNotificationsPlugin();
// @override
// void onInit() {
// super.onInit();
// initNotifications();
// tz.initializeTimeZones();
// }
// // Initializes the local notifications plugin
// Future<void> initNotifications() async {
// const AndroidInitializationSettings android =
// AndroidInitializationSettings('@mipmap/launcher_icon');
// const InitializationSettings initializationSettings =
// InitializationSettings(android: android);
// await _flutterLocalNotificationsPlugin.initialize(initializationSettings);
// }
// // Displays a notification with the given title and message
// void showNotification(
// String title, String message, String tone, String payLoad) async {
// AndroidNotificationDetails android = AndroidNotificationDetails(
// 'your channel id', 'your channel name',
// importance: Importance.max,
// priority: Priority.high,
// showWhen: false,
// sound: RawResourceAndroidNotificationSound(tone));
// NotificationDetails details = NotificationDetails(android: android);
// await _flutterLocalNotificationsPlugin.show(0, title, message, details);
// }
// // Schedules a notification for a specific time
// Future<void> scheduleNotification(
// String title, String body, DateTime scheduledTime) async {
// await _flutterLocalNotificationsPlugin.zonedSchedule(
// 0,
// title,
// body,
// tz.TZDateTime.from(scheduledTime, tz.local),
// const NotificationDetails(
// android: AndroidNotificationDetails(
// 'your_channel_id',
// 'your_channel_name',
// channelDescription: 'your_channel_description',
// importance: Importance.max,
// priority: Priority.high,
// showWhen: false,
// ),
// ),
// androidAllowWhileIdle: true,
// uiLocalNotificationDateInterpretation:
// UILocalNotificationDateInterpretation.absoluteTime,
// matchDateTimeComponents: DateTimeComponents.time,
// );
// }
// }

View File

@@ -5,6 +5,10 @@ import 'package:flutter_overlay_window/flutter_overlay_window.dart';
import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';
import '../../constant/box_name.dart';
import '../../main.dart';
import '../auth/captin/login_captin_controller.dart';
Future<void> getPermissionOverlay() async {
if (Platform.isAndroid) {
final bool status = await FlutterOverlayWindow.isPermissionGranted();
@@ -23,17 +27,22 @@ Future<void> getPermissionOverlay() async {
}
Future<void> getPermissionLocation() async {
final PermissionStatus status = await Permission.location.request();
if (status.isDenied) {
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();
await FlutterOverlayWindow.requestPermission();
},
);
final PermissionStatus status = await Permission.location.status;
if (!status.isGranted) {
// Log.print('status.isGranted: ${status.isGranted}');
box.write(BoxName.locationPermission, 'true');
await Permission.location.request();
Get.find<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.location.request();
// },
// );
}
}

View File

@@ -521,6 +521,7 @@ class MapDriverController extends GetxController {
Get.back();
if (distanceToDestination < 150) {
// todo add scam from start point and dont move
// finishRideFromDriver1();
}
MyDialog().getDialog('you are not moved yet !'.tr, '', () {
Get.back();

View File

@@ -32,6 +32,7 @@ class PaymentController extends GetxController {
// double.parse(Get.find<MapDriverController>().totalPricePassenger);
int? selectedAmount = 0;
List<dynamic> totalPassengerWalletDetails = [];
final walletphoneController = TextEditingController();
String passengerTotalWalletAmount = '';
String ip = '1';
DateTime now = DateTime.now();

View File

@@ -144,7 +144,7 @@ class PaymobPaymentWallet {
}) async {
final Map<String, dynamic> data = {
"source": {
"identifier": box.read(BoxName.phoneDriver).toString(),
"identifier": box.read(BoxName.phoneWallet).toString(),
"subtype": "WALLET",
},
"payment_token": paymentToken,

View File

@@ -108,15 +108,18 @@ void main() async {
await WakelockPlus.enable();
// Request location permission
PermissionStatus status = await Permission.location.request();
if (status.isDenied) {
WidgetsBinding.instance.addPostFrameCallback((_) {
getPermissionLocation();
});
return;
// PermissionStatus status = await Permission.location.request();
// if (status.isDenied) {
// WidgetsBinding.instance.addPostFrameCallback((_) {
// getPermissionLocation();
// });
// return;
// }
PermissionStatus status1 = await Permission.location.status;
if (status1.isGranted) {
await LocationController().startLocationUpdates();
}
await LocationController().startLocationUpdates();
await GetStorage.init();
Stripe.publishableKey = AK.publishableKeyStripe;

View File

@@ -3,6 +3,7 @@ import 'package:SEFER/controller/auth/captin/register_captin_controller.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';
import 'package:SEFER/views/widgets/my_textField.dart';
import 'package:SEFER/views/widgets/mycircular.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -88,7 +89,9 @@ class SmsSignupEgypt extends StatelessWidget {
)
: const SizedBox()),
// Submit button
MyElevatedButton(
registerCaptainController.isLoading
? const MyCircularProgressIndicator()
: MyElevatedButton(
onPressed: () async {
!registerCaptainController.isSent
? await registerCaptainController.sendOtpMessage()

View File

@@ -5,6 +5,7 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';
import '../../../constant/box_name.dart';
import '../../../constant/colors.dart';
@@ -13,6 +14,7 @@ import '../../../constant/style.dart';
import '../../../controller/auth/apple_sigin.dart';
import '../../../controller/auth/captin/login_captin_controller.dart';
import '../../../controller/auth/google_sign.dart';
import '../../../controller/functions/overlay_permisssion.dart';
import '../../../main.dart';
import '../../widgets/elevated_btn.dart';
import '../../widgets/my_scafold.dart';
@@ -410,6 +412,14 @@ class LoginCaptin extends StatelessWidget {
title: "Allow Location Access".tr,
onPressed: () async {
// await Get.put(LocationBackgroundController()); //////
PermissionStatus status =
await Permission.location.status;
if (!status.isGranted) {
// WidgetsBinding.instance.addPostFrameCallback((_) {
getPermissionLocation();
// });
return;
}
box.write(BoxName.locationPermission, 'true');
controller.update();
},

View File

@@ -1,6 +1,7 @@
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/main.dart';
import 'package:SEFER/views/auth/captin/cards/egypt_card_a_i.dart';
import 'package:SEFER/views/auth/captin/cards/sms_signup.dart';
import 'package:flutter/material.dart';
import 'package:flutter_font_icons/flutter_font_icons.dart';
import 'package:bubble_head/bubble.dart';
@@ -177,7 +178,7 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
// onPressed: () async {
// // Get.to(() => EgyptCardAI());
// // print(box.read(BoxName.myList));
//
// List<String> d = [
// "30.003028,31.2419628",
// "30.0955661,31.2665336",
@@ -214,54 +215,36 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
// "8",
// "5.00"
// ];
//
// try {
// print('Before showing overlay: ${box.read('some_key')}');
//
// // Ensure any existing overlay is closed before showing a new one
//
// bool isOverlayActive =
// await FlutterOverlayWindow.isActive();
// if (isOverlayActive) {
// await FlutterOverlayWindow.closeOverlay();
// }
// await FlutterOverlayWindow.showOverlay(
// enableDrag: true,
// overlayTitle: d[0],
// overlayContent: d[1],
// flag: OverlayFlag.focusPointer,
// visibility: NotificationVisibility.visibilityPublic,
// positionGravity: PositionGravity.auto,
// height: 700,
// width: WindowSize.matchParent,
// startPosition: const OverlayPosition(0, -170),
// );
//
// await FlutterOverlayWindow.shareData(d);
//
// print('After showing overlay: ${box.read('some_key')}');
// } catch (e) {
// FirebaseMessagesController().sendNotificationToDriverMAP(
// 'Order'.tr,
// 'from: ',
// // jsonDecode(value)['message'].toString(),
// // 'd3JaCCFAQeu8QTxRnlC1sB:APA91bFuRjbVK32obIFYXFTI4iwsZEPrrgwvPouob2bXivID-W4aXz51J_OIJ2nHpNU2ocOvGLD1Ip65rLViAFx5qHVE-c8FabBwBi5fSQ-lDTQfe36xxKsc9DU-sTyj_FoYrrMnLNVi',
// 'dN7B10MgQKOR13R5wnBqTN:APA91bHAlcfrOhxXdMYB8akJeeJzQ4lxfx7UhOpP0dcjGtRdKXSD9x6jiEoz6ULnQK5Hc030_VRUAV6Q8qGj-RmlbLAm4wppc4gv_Ri4oEbHHwONP5c41-341YkVqsFYTCRaHz7VpUoj',
// d,
// 'order.wav');
// try {} catch (e) {
// print('Error showing overlay: $e');
// }
// final Bubble _bubble = Bubble(showCloseButton: true);
// try {
// await _bubble.startBubbleHead(sendAppToBackground: false);
// } on PlatformException {
// print('Failed to call startBubbleHead');
// }
// // final Bubble _bubble = Bubble(showCloseButton: true);
// // try {
// // await _bubble.startBubbleHead(sendAppToBackground: false);
// // } on PlatformException {
// // print('Failed to call startBubbleHead');
// // }
// Bubble().startBubbleHead(sendAppToBackground: true);
// }
// // Bubble().startBubbleHead(sendAppToBackground: true);
// // }
// Future<void> stopBubbleHead() async {
// try {
// await _bubble.stopBubbleHead();
// } on PlatformException {
// print('Failed to call stopBubbleHead');
// }
// }
//
// // // send data to ovelay
// // Future<void> stopBubbleHead() async {
// // try {
// // await _bubble.stopBubbleHead();
// // } on PlatformException {
// // print('Failed to call stopBubbleHead');
// // }
// // }
// //
// // // // send data to ovelay
// },
// icon: const Icon(
// FontAwesome5.grin_tears,
@@ -271,35 +254,36 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
// );
// }),
// ),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(color: AppColor.blueColor),
borderRadius: BorderRadius.circular(15)),
child: Builder(builder: (context) {
return IconButton(
onPressed: () async {
// FirebaseMessagesController().sendNotificationToAnyWithoutData(
// 'Order'.tr,
// 'from: ',
// // jsonDecode(value)['message'].toString(),
// 'dEugS-JOT4Ka5riF4s5TEN:APA91bEDL_W7BuEQGbyL-RMaKiMWDlURXhFuaybe5WurTUV8K5eIooSGe22yY22_U2hEZcfPr46ig1v--l00dbOGiivazxvmTyhUyQQW6lJsuIN-wordGtBxtREyeYtEKvxIa1J4ApEu',
// 'order.wav'
// // AnimatedContainer(
// duration: const Duration(microseconds: 200),
// width: controller.widthMapTypeAndTraffic,
// decoration: BoxDecoration(
// color: AppColor.secondaryColor,
// border: Border.all(color: AppColor.blueColor),
// borderRadius: BorderRadius.circular(15)),
// child: Builder(builder: (context) {
// return IconButton(
// onPressed: () async {
// // FirebaseMessagesController().sendNotificationToAnyWithoutData(
// // 'Order'.tr,
// // 'from: ',
// // // jsonDecode(value)['message'].toString(),
// // 'dEugS-JOT4Ka5riF4s5TEN:APA91bEDL_W7BuEQGbyL-RMaKiMWDlURXhFuaybe5WurTUV8K5eIooSGe22yY22_U2hEZcfPr46ig1v--l00dbOGiivazxvmTyhUyQQW6lJsuIN-wordGtBxtREyeYtEKvxIa1J4ApEu',
// // 'order.wav'
// // polylineCoordinates.toString()
// // // polylineCoordinates.toString()
// // );
// Get.to(SmsSignupEgypt());
// // print(AppLink.addDriverPaymentPoints);
// },
// icon: const Icon(
// FontAwesome5.closed_captioning,
// size: 29,
// color: AppColor.blueColor,
// ),
// );
print(AppLink.addDriverPaymentPoints);
},
icon: const Icon(
FontAwesome5.closed_captioning,
size: 29,
color: AppColor.blueColor,
),
);
}),
),
// }),
// ),
],
)),
);

View File

@@ -8,6 +8,7 @@ import 'package:SEFER/controller/payment/payment_controller.dart';
import '../../../constant/box_name.dart';
import '../../../main.dart';
import '../../widgets/elevated_btn.dart';
import '../../widgets/my_textField.dart';
class PointsCaptain extends StatelessWidget {
PaymentController paymentController = Get.put(PaymentController());
@@ -65,21 +66,48 @@ class PointsCaptain extends StatelessWidget {
title: 'Pay with Wallet'.tr,
onPressed: () async {
Get.back();
Get.defaultDialog(
barrierDismissible: false,
title: 'Insert Wallet phone number'.tr,
content: Form(
key: paymentController.formKey,
child: MyTextForm(
controller:
paymentController.walletphoneController,
label: 'Insert Wallet phone number'.tr,
hint: 'Insert Wallet phone number'.tr,
type: TextInputType.phone)),
confirm: MyElevatedButton(
title: 'OK'.tr,
onPressed: () async {
Get.back();
if (paymentController.formKey.currentState!
.validate()) {
box.write(
BoxName.phoneWallet,
paymentController
.walletphoneController.text);
await paymentController.payWithPayMobWallet(
context,
pricePoint.toStringAsFixed(2),
box.read(BoxName.countryCode) == 'Egypt'
? 'EGP'
: 'JOD', () async {
await captainWalletController.addDriverPaymentPoints(
await captainWalletController
.addDriverPaymentPoints(
'visa-in', pricePoint);
await captainWalletController.addDriverWallet(
await captainWalletController
.addDriverWallet(
'visa-in', countPoint);
await captainWalletController.addSeferWallet(
await captainWalletController
.addSeferWallet(
'visa-in', pricePoint.toString());
await captainWalletController
.getCaptainWalletFromBuyPoints();
});
}
Get.back();
}));
},
),
],

View File

@@ -37,19 +37,22 @@ class NotificationCaptain extends StatelessWidget {
onTap: () {
Get.defaultDialog(
title: res['title'],
titleStyle: AppStyle.title,
titleStyle: AppStyle.title.copyWith(
fontWeight: FontWeight.bold),
content: SizedBox(
width: Get.width * .8,
height: Get.height * .4,
child: Text(
res['body'],
style: AppStyle.title,
style: AppStyle.subtitle,
),
),
confirm: MyElevatedButton(
title: 'Ok',
onPressed: () {
//todo sql readen
notificationCaptainController
.updateNotification(res['id']);
}));
},
leading:

View File

@@ -92,9 +92,10 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
envied_generator: ^0.5.2
build_runner:
build_runner: ^2.4.6
flutter_launcher_icons:
android: "launcher_icon"