25-10-5/1
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:sefer_driver/constant/box_name.dart';
|
||||
import 'package:sefer_driver/constant/colors.dart';
|
||||
import 'package:sefer_driver/constant/links.dart';
|
||||
import 'package:sefer_driver/controller/functions/crud.dart';
|
||||
import 'package:sefer_driver/controller/functions/encrypt_decrypt.dart';
|
||||
import 'package:sefer_driver/main.dart';
|
||||
import 'package:sefer_driver/views/widgets/error_snakbar.dart';
|
||||
import 'package:sefer_driver/views/widgets/mydialoug.dart';
|
||||
@@ -24,9 +22,10 @@ class RatingController extends GetxController {
|
||||
|
||||
void _redirectToAppStore() async {
|
||||
// URLs for App Store and Google Play Store
|
||||
const appStoreUrl = 'https://apps.apple.com/app/6502189302';
|
||||
const appStoreUrl =
|
||||
'https://apps.apple.com/st/app/intaleq-driver/id6482995159';
|
||||
const playStoreUrl =
|
||||
'https://play.google.com/store/apps/details?id=com.sefer_driver';
|
||||
'https://play.google.com/store/apps/details?id=com.intaleq_driver';
|
||||
final url = GetPlatform.isIOS ? appStoreUrl : playStoreUrl;
|
||||
|
||||
if (await launchUrl(Uri.parse(url))) {
|
||||
@@ -59,13 +58,14 @@ class RatingController extends GetxController {
|
||||
if (res != 'failure') {
|
||||
try {
|
||||
// Attempt to parse the response as JSON
|
||||
final parsedResponse = jsonDecode(res);
|
||||
final parsedResponse = (res);
|
||||
|
||||
if (parsedResponse['status'] == 'success') {
|
||||
// Display a success message
|
||||
CRUD().post(link: AppLink.sendEmailRateingApp, payload: {
|
||||
"name": payload["name"],
|
||||
"email": payload["email"],
|
||||
"phone": payload["phone"],
|
||||
"rating": rating.toString(),
|
||||
"comment": payload["comment"],
|
||||
});
|
||||
|
||||
@@ -11,6 +11,8 @@ import 'package:sefer_driver/main.dart';
|
||||
import 'package:sefer_driver/views/home/Captin/home_captain/home_captin.dart';
|
||||
import 'package:sefer_driver/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../firebase/notification_service.dart';
|
||||
|
||||
// import '../home/captin/home_captain_controller.dart';
|
||||
|
||||
class RateController extends GetxController {
|
||||
@@ -67,12 +69,20 @@ class RateController extends GetxController {
|
||||
'driverID': box.read(BoxName.driverID).toString(),
|
||||
});
|
||||
|
||||
Get.find<FirebaseMessagesController>().sendNotificationToDriverMAP(
|
||||
'Wallet Added'.tr,
|
||||
'Wallet Added${(remainingFee).toStringAsFixed(0)}'.tr,
|
||||
Get.find<MapDriverController>().tokenPassenger,
|
||||
[],
|
||||
'tone2.wav');
|
||||
// Get.find<FirebaseMessagesController>().sendNotificationToDriverMAP(
|
||||
// 'Wallet Added'.tr,
|
||||
// 'Wallet Added${(remainingFee).toStringAsFixed(0)}'.tr,
|
||||
// Get.find<MapDriverController>().tokenPassenger,
|
||||
// [],
|
||||
// 'tone2.wav');
|
||||
NotificationService.sendNotification(
|
||||
target: Get.find<MapDriverController>().tokenPassenger.toString(),
|
||||
title: 'Wallet Added'.tr,
|
||||
body: 'Wallet Added${(remainingFee).toStringAsFixed(0)}'.tr,
|
||||
isTopic: false, // Important: this is a token
|
||||
tone: 'tone2',
|
||||
driverList: [],
|
||||
);
|
||||
walletChecked = 'true';
|
||||
// }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user