9/19/2
This commit is contained in:
@@ -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,14 +89,16 @@ class SmsSignupEgypt extends StatelessWidget {
|
||||
)
|
||||
: const SizedBox()),
|
||||
// Submit button
|
||||
MyElevatedButton(
|
||||
onPressed: () async {
|
||||
!registerCaptainController.isSent
|
||||
? await registerCaptainController.sendOtpMessage()
|
||||
: await registerCaptainController.verifySMSCode();
|
||||
},
|
||||
title: 'Submit'.tr,
|
||||
),
|
||||
registerCaptainController.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: MyElevatedButton(
|
||||
onPressed: () async {
|
||||
!registerCaptainController.isSent
|
||||
? await registerCaptainController.sendOtpMessage()
|
||||
: await registerCaptainController.verifySMSCode();
|
||||
},
|
||||
title: 'Submit'.tr,
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
||||
@@ -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();
|
||||
},
|
||||
|
||||
@@ -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()
|
||||
// );
|
||||
print(AppLink.addDriverPaymentPoints);
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome5.closed_captioning,
|
||||
size: 29,
|
||||
color: AppColor.blueColor,
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
// // // polylineCoordinates.toString()
|
||||
// // );
|
||||
// Get.to(SmsSignupEgypt());
|
||||
// // print(AppLink.addDriverPaymentPoints);
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// FontAwesome5.closed_captioning,
|
||||
// size: 29,
|
||||
// color: AppColor.blueColor,
|
||||
// ),
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
],
|
||||
)),
|
||||
);
|
||||
|
||||
@@ -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();
|
||||
await paymentController.payWithPayMobWallet(
|
||||
context,
|
||||
pricePoint.toStringAsFixed(2),
|
||||
box.read(BoxName.countryCode) == 'Egypt'
|
||||
? 'EGP'
|
||||
: 'JOD', () async {
|
||||
await captainWalletController.addDriverPaymentPoints(
|
||||
'visa-in', pricePoint);
|
||||
await captainWalletController.addDriverWallet(
|
||||
'visa-in', countPoint);
|
||||
await captainWalletController.addSeferWallet(
|
||||
'visa-in', pricePoint.toString());
|
||||
await captainWalletController
|
||||
.getCaptainWalletFromBuyPoints();
|
||||
});
|
||||
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(
|
||||
'visa-in', pricePoint);
|
||||
await captainWalletController
|
||||
.addDriverWallet(
|
||||
'visa-in', countPoint);
|
||||
await captainWalletController
|
||||
.addSeferWallet(
|
||||
'visa-in', pricePoint.toString());
|
||||
await captainWalletController
|
||||
.getCaptainWalletFromBuyPoints();
|
||||
});
|
||||
}
|
||||
Get.back();
|
||||
}));
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user