2/14/1
This commit is contained in:
@@ -9,7 +9,7 @@ if (localPropertiesFile.exists()) {
|
|||||||
|
|
||||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||||
if (flutterRoot == null) {
|
if (flutterRoot == null) {
|
||||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||||
}
|
}
|
||||||
|
|
||||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||||
@@ -71,6 +71,7 @@ android {
|
|||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
|
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,24 @@
|
|||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||||
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
|
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
|
||||||
|
<!-- Permissions required by the SDK -->
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||||
|
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||||
|
|
||||||
|
<!-- Permissions required by the Demo App -->
|
||||||
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
|
||||||
|
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
|
||||||
|
<uses-feature android:name="android.hardware.camera" />
|
||||||
|
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||||
|
|
||||||
|
|
||||||
<application android:label="SEFER" android:name="${applicationName}" android:icon="@mipmap/launcher_icon">
|
<application android:label="SEFER" android:name="${applicationName}" android:icon="@mipmap/launcher_icon">
|
||||||
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
|
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#Thu Aug 03 17:06:53 EET 2023
|
#Thu Aug 03 17:06:53 EET 2023
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
# distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
|
|
||||||
<key>GMSApiKey</key>
|
<key>GMSApiKey</key>
|
||||||
<string>YOUR_API_KEY</string>
|
<string>YOUR_API_KEY</string>
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
@@ -11,9 +12,9 @@
|
|||||||
<string>Use Face ID to securely authenticate payment accounts.</string>
|
<string>Use Face ID to securely authenticate payment accounts.</string>
|
||||||
|
|
||||||
<key>NSMicrophoneUsageDescription</key>
|
<key>NSMicrophoneUsageDescription</key>
|
||||||
<string>This app requires access to your microphone to record audio, allowing you to add voice recordings to your photos and videos.</string>
|
<string>This app requires access to your microphone to record audio, allowing you to add voice recordings to your photos and videos and access to connect to a call.</string>
|
||||||
<key>NSCameraUsageDescription</key>
|
<key>NSCameraUsageDescription</key>
|
||||||
<string>Sefer app requires access to your camera in order to scan QR codes and capture images for uploading.</string>
|
<string>Sefer app requires access to your camera in order to scan QR codes and capture images for uploading and access to connect to a call.</string>
|
||||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||||
<string>This app needs access to your location to provide you with the best ride experience. Your location data will be used to find the nearest available cars and connect you with the closest captain for efficient and convenient rides.</string>
|
<string>This app needs access to your location to provide you with the best ride experience. Your location data will be used to find the nearest available cars and connect you with the closest captain for efficient and convenient rides.</string>
|
||||||
<key>FirebaseAppDelegateProxyEnabled</key>
|
<key>FirebaseAppDelegateProxyEnabled</key>
|
||||||
@@ -37,11 +38,11 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>16</string>
|
<string>17</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.36</string>
|
<string>1.37</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
|
|||||||
@@ -32,4 +32,8 @@ class AK {
|
|||||||
static final String payPalClientId = Env.payPalClientId;
|
static final String payPalClientId = Env.payPalClientId;
|
||||||
static final String payPalSecret = Env.payPalSecret;
|
static final String payPalSecret = Env.payPalSecret;
|
||||||
static final String geminiApi = Env.geminiApi;
|
static final String geminiApi = Env.geminiApi;
|
||||||
|
static const String agoraAppId = '12994c6e707543e68d5638894d04f989';
|
||||||
|
static const String agoraChannelName = 'seferCall';
|
||||||
|
static const String agoraToken =
|
||||||
|
'007eJxTYCjrVT009+knq6WOp9gqgx77z/CIjHtQ7PBrUdB1CZWUhUcUGAyNLC1Nks1SzQ3MTU2MU80sUkzNjC0sLE1SDEzSLC0sK4XPpjYEMjIEfg5lYWSAQBCfk6E4NS21yDkxJ4eBAQD1PiDo';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ class AppLink {
|
|||||||
static String deleteRides = "$ride/rides/delete.php";
|
static String deleteRides = "$ride/rides/delete.php";
|
||||||
|
|
||||||
//-----------------DriverPayment------------------
|
//-----------------DriverPayment------------------
|
||||||
|
static String adddriverScam = "$ride/driver_scam/add.php";
|
||||||
|
static String getdriverScam = "$ride/driver_scam/get.php";
|
||||||
|
|
||||||
|
////-----------------DriverPayment------------------
|
||||||
static String addDriverpayment = "$ride/payment/add.php";
|
static String addDriverpayment = "$ride/payment/add.php";
|
||||||
static String addDriverPaymentPoints = "$ride/driverPayment/add.php";
|
static String addDriverPaymentPoints = "$ride/driverPayment/add.php";
|
||||||
static String getDriverPaymentPoints = "$ride/driverWallet/get.php";
|
static String getDriverPaymentPoints = "$ride/driverWallet/get.php";
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import '../../views/home/Captin/orderCaptin/order_request_page.dart';
|
|||||||
import '../home/map_passenger_controller.dart';
|
import '../home/map_passenger_controller.dart';
|
||||||
import '../home/payment/captain_wallet_controller.dart';
|
import '../home/payment/captain_wallet_controller.dart';
|
||||||
import '../payment/payment_controller.dart';
|
import '../payment/payment_controller.dart';
|
||||||
|
import 'local_notification.dart';
|
||||||
|
|
||||||
class FirebaseMessagesController extends GetxController {
|
class FirebaseMessagesController extends GetxController {
|
||||||
final fcmToken = FirebaseMessaging.instance;
|
final fcmToken = FirebaseMessaging.instance;
|
||||||
@@ -128,6 +129,9 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
|
|
||||||
void fireBaseTitles(RemoteMessage message) {
|
void fireBaseTitles(RemoteMessage message) {
|
||||||
if (message.notification!.title! == 'Order') {
|
if (message.notification!.title! == 'Order') {
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
NotificationController().showNotification('Order', '', 'order');
|
||||||
|
}
|
||||||
var myListString = message.data['DriverList'];
|
var myListString = message.data['DriverList'];
|
||||||
// print(myListString);
|
// print(myListString);
|
||||||
// print('9999999999999myListString999999999999999');
|
// print('9999999999999myListString999999999999999');
|
||||||
@@ -146,33 +150,57 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
// print('9999999999999my Apply Ride 999999999999999');
|
// print('9999999999999my Apply Ride 999999999999999');
|
||||||
var myList = jsonDecode(passengerList) as List<dynamic>;
|
var myList = jsonDecode(passengerList) as List<dynamic>;
|
||||||
driverID = myList[2].toString();
|
driverID = myList[2].toString();
|
||||||
|
NotificationController().showNotification(
|
||||||
driverAppliedTripSnakBar();
|
'Apply Order', 'Driver Applied the Ride for You'.tr, 'order');
|
||||||
|
// driverAppliedTripSnakBar();
|
||||||
} else if (message.notification!.title! == 'Promo') {
|
} else if (message.notification!.title! == 'Promo') {
|
||||||
|
NotificationController()
|
||||||
|
.showNotification('Promo', 'Show latest promo'.tr, 'order');
|
||||||
Get.to(const PromosPassengerPage());
|
Get.to(const PromosPassengerPage());
|
||||||
} else if (message.notification!.title == 'Cancel Trip') {
|
} else if (message.notification!.title == 'Cancel Trip') {
|
||||||
|
NotificationController().showNotification(
|
||||||
|
'Cancel Trip'.tr, 'Passenger Cancel Trip'.tr, 'order');
|
||||||
cancelTripDialog();
|
cancelTripDialog();
|
||||||
} else if (message.notification!.title! == 'DriverIsGoingToPassenger') {
|
} else if (message.notification!.title! == 'DriverIsGoingToPassenger') {
|
||||||
Get.snackbar('Driver is Going To Passenger', '',
|
NotificationController().showNotification('Driver is Going To You'.tr,
|
||||||
backgroundColor: AppColor.greenColor);
|
'Please stay on the picked point.'.tr, 'order');
|
||||||
|
// Get.snackbar('Driver is Going To Passenger', '',
|
||||||
|
// backgroundColor: AppColor.greenColor);
|
||||||
} else if (message.notification!.title! == 'RideIsBegin') {
|
} else if (message.notification!.title! == 'RideIsBegin') {
|
||||||
Get.snackbar('RideIsBegin', '', backgroundColor: AppColor.greenColor);
|
// Get.snackbar('RideIsBegin', '', backgroundColor: AppColor.greenColor);
|
||||||
|
NotificationController()
|
||||||
|
.showNotification('Trip is Begin'.tr, ''.tr, 'order');
|
||||||
update();
|
update();
|
||||||
} else if (message.notification!.title! == 'Hi ,I will go now') {
|
} else if (message.notification!.title! == 'Hi ,I will go now') {
|
||||||
Get.snackbar('Hi ,I will go now', '',
|
// Get.snackbar('Hi ,I will go now', '',
|
||||||
backgroundColor: AppColor.greenColor);
|
// backgroundColor: AppColor.greenColor);
|
||||||
|
NotificationController().showNotification(
|
||||||
|
'Passenger come to you'.tr, 'Hi ,I will go now'.tr, 'order');
|
||||||
update();
|
update();
|
||||||
} else if (message.notification!.title! == 'Hi ,I Arrive your site') {
|
} else if (message.notification!.title! == 'Hi ,I Arrive your site') {
|
||||||
|
NotificationController()
|
||||||
|
.showNotification('Hi ,I Arrive your site'.tr, ''.tr, 'order');
|
||||||
driverArrivePassengerDialoge();
|
driverArrivePassengerDialoge();
|
||||||
|
|
||||||
update();
|
update();
|
||||||
} else if (message.notification!.title! == 'Driver Finish Trip') {
|
} else if (message.notification!.title! == 'Driver Finish Trip') {
|
||||||
var myListString = message.data['passengerList'];
|
var myListString = message.data['passengerList'];
|
||||||
var driverList = jsonDecode(myListString) as List<dynamic>;
|
var driverList = jsonDecode(myListString) as List<dynamic>;
|
||||||
|
NotificationController().showNotification(
|
||||||
|
'Driver Finish Trip'.tr,
|
||||||
|
'you will pay to Driver'.tr +
|
||||||
|
' ${Get.find<MapPassengerController>().totalPassenger} \$'.tr,
|
||||||
|
'order');
|
||||||
if (Get.find<PaymentController>().isCashChecked == false &&
|
if (Get.find<PaymentController>().isCashChecked == false &&
|
||||||
Get.find<PaymentController>().isWalletChecked == true) {
|
Get.find<PaymentController>().isWalletChecked == true) {
|
||||||
driverFinishTripDialoge(driverList);
|
driverFinishTripDialoge(driverList);
|
||||||
} else {
|
} else if (double.parse(box.read(BoxName.passengerWalletTotal)) < 0) {
|
||||||
|
CRUD().post(link: AppLink.addPassengersWallet, payload: {
|
||||||
|
'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||||
|
'balance':
|
||||||
|
((-1) * double.parse(box.read(BoxName.passengerWalletTotal)))
|
||||||
|
.toString()
|
||||||
|
});
|
||||||
Get.to(() => RateDriverFromPassenger(), arguments: {
|
Get.to(() => RateDriverFromPassenger(), arguments: {
|
||||||
'driverId': driverList[0].toString(),
|
'driverId': driverList[0].toString(),
|
||||||
'rideId': driverList[1].toString(),
|
'rideId': driverList[1].toString(),
|
||||||
@@ -184,6 +212,11 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
// .tr,
|
// .tr,
|
||||||
// 'message',
|
// 'message',
|
||||||
// backgroundColor: AppColor.redColor);
|
// backgroundColor: AppColor.redColor);
|
||||||
|
NotificationController().showNotification(
|
||||||
|
'Driver Cancel Your Trip'.tr,
|
||||||
|
'you will pay to Driver you will be pay the cost of driver time look to your SEFER Wallet'
|
||||||
|
.tr,
|
||||||
|
'order');
|
||||||
Get.find<MapPassengerController>().restCounter();
|
Get.find<MapPassengerController>().restCounter();
|
||||||
Get.offAll(const MapPagePassenger());
|
Get.offAll(const MapPagePassenger());
|
||||||
}
|
}
|
||||||
@@ -213,6 +246,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
|
|
||||||
Future<dynamic> cancelTripDialog() {
|
Future<dynamic> cancelTripDialog() {
|
||||||
return Get.defaultDialog(
|
return Get.defaultDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
title: 'Passenger Cancel Trip'.tr,
|
title: 'Passenger Cancel Trip'.tr,
|
||||||
middleText: '',
|
middleText: '',
|
||||||
confirm: MyElevatedButton(
|
confirm: MyElevatedButton(
|
||||||
|
|||||||
29
lib/controller/firebase/local_notification.dart
Normal file
29
lib/controller/firebase/local_notification.dart
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class NotificationController extends GetxController {
|
||||||
|
final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
|
||||||
|
FlutterLocalNotificationsPlugin();
|
||||||
|
|
||||||
|
// 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) 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,7 +31,7 @@ class LocationController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void startLocationUpdates() async {
|
void startLocationUpdates() async {
|
||||||
_locationTimer = Timer.periodic(const Duration(seconds: 20), (timer) async {
|
_locationTimer = Timer.periodic(const Duration(seconds: 10), (timer) async {
|
||||||
try {
|
try {
|
||||||
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
||||||
|
|
||||||
@@ -97,11 +97,11 @@ class LocationController extends GetxController {
|
|||||||
: null)!;
|
: null)!;
|
||||||
|
|
||||||
// Print location details
|
// Print location details
|
||||||
print('myLocation: ${myLocation}');
|
// print('myLocation: ${myLocation}');
|
||||||
print('Accuracy: ${_locationData.accuracy}');
|
// print('Accuracy: ${_locationData.accuracy}');
|
||||||
print('Latitude: ${_locationData.latitude}');
|
// print('Latitude: ${_locationData.latitude}');
|
||||||
print('Longitude: ${_locationData.longitude}');
|
// print('Longitude: ${_locationData.longitude}');
|
||||||
print('Time: ${_locationData.time}');
|
// print('Time: ${_locationData.time}');
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:ride/constant/box_name.dart';
|
import 'package:ride/constant/box_name.dart';
|
||||||
|
import 'package:ride/controller/home/captin/map_driver_controller.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import '../../../constant/links.dart';
|
import '../../../constant/links.dart';
|
||||||
@@ -204,11 +205,12 @@ class HomeCaptainController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addToken() async {
|
addToken() async {
|
||||||
box.write(BoxName.statusDriverLocation, 'off');
|
|
||||||
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
||||||
'token': box.read(BoxName.tokenDriver),
|
'token': box.read(BoxName.tokenDriver),
|
||||||
'captain_id': box.read(BoxName.driverID).toString()
|
'captain_id': box.read(BoxName.driverID).toString()
|
||||||
}).then((value) => print('Token Added'));
|
}).then((value) => print('Token Added'));
|
||||||
|
MapDriverController().driverCallPassenger();
|
||||||
|
// box.write(BoxName.statusDriverLocation, 'off');
|
||||||
}
|
}
|
||||||
|
|
||||||
getPaymentToday() async {
|
getPaymentToday() async {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
||||||
import 'package:ride/constant/style.dart';
|
import 'package:ride/constant/style.dart';
|
||||||
|
import 'package:ride/controller/home/captin/home_captain_controller.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
import '../../../constant/api_key.dart';
|
import '../../../constant/api_key.dart';
|
||||||
@@ -45,6 +46,7 @@ class MapDriverController extends GetxController {
|
|||||||
late String step3;
|
late String step3;
|
||||||
late String step4;
|
late String step4;
|
||||||
late String duration;
|
late String duration;
|
||||||
|
late String totalCost;
|
||||||
late String distance;
|
late String distance;
|
||||||
late String name;
|
late String name;
|
||||||
late String phone;
|
late String phone;
|
||||||
@@ -242,6 +244,46 @@ class MapDriverController extends GetxController {
|
|||||||
tokenPassenger);
|
tokenPassenger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isSocialPressed = false;
|
||||||
|
driverCallPassenger() async {
|
||||||
|
String scam = await getDriverScam();
|
||||||
|
if (scam != 'failure') {
|
||||||
|
if (int.parse(scam) > 3) {
|
||||||
|
box.write(BoxName.statusDriverLocation, 'on');
|
||||||
|
Get.find<LocationController>().stopLocationUpdates();
|
||||||
|
await CRUD().post(link: AppLink.addNotificationCaptain, payload: {
|
||||||
|
'driverID': box.read(BoxName.driverID),
|
||||||
|
'title': 'scams operations'.tr,
|
||||||
|
'body':
|
||||||
|
'you have connect to passengers and let them cancel the order'.tr,
|
||||||
|
});
|
||||||
|
} else if (isSocialPressed == true) {
|
||||||
|
box.write(BoxName.statusDriverLocation, 'off');
|
||||||
|
await CRUD().post(link: AppLink.adddriverScam, payload: {
|
||||||
|
'driverID': box.read(BoxName.driverID),
|
||||||
|
'passengerID': passengerId,
|
||||||
|
'rideID': rideId,
|
||||||
|
'isDriverCalledPassenger': '$isSocialPressed'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> getDriverScam() async {
|
||||||
|
var res = await CRUD().post(link: AppLink.getdriverScam, payload: {
|
||||||
|
'driverID': box.read(BoxName.driverID),
|
||||||
|
});
|
||||||
|
if (res == 'failure') {
|
||||||
|
print('Scam is failure');
|
||||||
|
box.write(BoxName.statusDriverLocation, 'off');
|
||||||
|
return '0';
|
||||||
|
}
|
||||||
|
var d = jsonDecode(res);
|
||||||
|
print('Scam is ');
|
||||||
|
print(d['message'][0]['count']);
|
||||||
|
return d['message'][0]['count'];
|
||||||
|
}
|
||||||
|
|
||||||
void startRideFromDriver() async {
|
void startRideFromDriver() async {
|
||||||
changeRideToBeginToPassenger();
|
changeRideToBeginToPassenger();
|
||||||
isPassengerInfoWindow = false;
|
isPassengerInfoWindow = false;
|
||||||
@@ -283,14 +325,20 @@ class MapDriverController extends GetxController {
|
|||||||
// 'RideIsBegin', box.read(BoxName.name).toString(), tokenPassenger);
|
// 'RideIsBegin', box.read(BoxName.name).toString(), tokenPassenger);
|
||||||
}
|
}
|
||||||
|
|
||||||
addWaittingTimeCostFromPassengerToDriverWallet() async {
|
calculateDistanseBetweenDriverAndPassengerLocation() {
|
||||||
double distance2 = Geolocator.distanceBetween(
|
double distance2 = Geolocator.distanceBetween(
|
||||||
latLngpassengerLocation.latitude,
|
latLngpassengerLocation.latitude,
|
||||||
latLngpassengerLocation.longitude,
|
latLngpassengerLocation.longitude,
|
||||||
Get.find<LocationController>().myLocation.latitude,
|
Get.find<LocationController>().myLocation.latitude,
|
||||||
Get.find<LocationController>().myLocation.longitude,
|
Get.find<LocationController>().myLocation.longitude,
|
||||||
);
|
);
|
||||||
if (distance2 > 80) {
|
return distance2;
|
||||||
|
}
|
||||||
|
|
||||||
|
addWaittingTimeCostFromPassengerToDriverWallet() async {
|
||||||
|
double distance2 = calculateDistanseBetweenDriverAndPassengerLocation();
|
||||||
|
|
||||||
|
if (distance2 > 40) {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
title: 'Your are far from passenger location'.tr,
|
title: 'Your are far from passenger location'.tr,
|
||||||
middleText:
|
middleText:
|
||||||
@@ -321,6 +369,7 @@ class MapDriverController extends GetxController {
|
|||||||
'passenger_id': passengerId,
|
'passenger_id': passengerId,
|
||||||
'balance': (cost * -1).toString()
|
'balance': (cost * -1).toString()
|
||||||
});
|
});
|
||||||
|
box.write(BoxName.statusDriverLocation, 'off');
|
||||||
Get.offAll(HomeCaptain());
|
Get.offAll(HomeCaptain());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -335,21 +384,30 @@ class MapDriverController extends GetxController {
|
|||||||
'rideTimeFinish': DateTime.now().toString(),
|
'rideTimeFinish': DateTime.now().toString(),
|
||||||
'status': 'Finished'
|
'status': 'Finished'
|
||||||
});
|
});
|
||||||
Get.back();
|
if (walletChecked == 'true') {
|
||||||
|
await CRUD().post(link: AppLink.addPassengersWallet, payload: {
|
||||||
|
'passenger_id': passengerId,
|
||||||
|
'ba lance': ((-1) * double.parse(totalCost)).toString()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get.back();
|
||||||
Future.delayed(const Duration(milliseconds: 300));
|
Future.delayed(const Duration(milliseconds: 300));
|
||||||
|
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||||
|
'Driver Finish Trip',
|
||||||
|
'you will pay to Driver'.tr + ' $totalCost \$'.tr,
|
||||||
|
tokenPassenger,
|
||||||
|
[
|
||||||
|
box.read(BoxName.driverID),
|
||||||
|
rideId,
|
||||||
|
box.read(BoxName.tokenDriver),
|
||||||
|
],
|
||||||
|
);
|
||||||
Get.to(() => RatePassenger(), arguments: {
|
Get.to(() => RatePassenger(), arguments: {
|
||||||
'rideId': rideId,
|
'rideId': rideId,
|
||||||
'passengerId': passengerId,
|
'passengerId': passengerId,
|
||||||
'driverId': driverId
|
'driverId': driverId
|
||||||
});
|
});
|
||||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
|
||||||
'Driver Finish Trip',
|
|
||||||
box.read(BoxName.name).toString(),
|
|
||||||
tokenPassenger, [
|
|
||||||
box.read(BoxName.driverID),
|
|
||||||
rideId,
|
|
||||||
box.read(BoxName.tokenDriver),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cancelCheckRidefromPassenger() async {
|
void cancelCheckRidefromPassenger() async {
|
||||||
@@ -623,6 +681,7 @@ class MapDriverController extends GetxController {
|
|||||||
passengerLocation = Get.arguments['passengerLocation'];
|
passengerLocation = Get.arguments['passengerLocation'];
|
||||||
passengerDestination = Get.arguments['passengerDestination'];
|
passengerDestination = Get.arguments['passengerDestination'];
|
||||||
duration = Get.arguments['Duration'];
|
duration = Get.arguments['Duration'];
|
||||||
|
totalCost = Get.arguments['totalCost'];
|
||||||
passengerId = Get.arguments['passengerId'];
|
passengerId = Get.arguments['passengerId'];
|
||||||
driverId = Get.arguments['driverId'];
|
driverId = Get.arguments['driverId'];
|
||||||
distance = Get.arguments['Distance'];
|
distance = Get.arguments['Distance'];
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:ride/constant/links.dart';
|
import 'package:ride/constant/links.dart';
|
||||||
import 'package:ride/constant/style.dart';
|
import 'package:ride/constant/style.dart';
|
||||||
import 'package:ride/main.dart';
|
import 'package:ride/main.dart';
|
||||||
|
import 'package:ride/views/home/Captin/home_captain/home_captin.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
import '../../../constant/box_name.dart';
|
import '../../../constant/box_name.dart';
|
||||||
@@ -95,12 +96,16 @@ class OrderRequestController extends GetxController {
|
|||||||
'status': 'Refused'
|
'status': 'Refused'
|
||||||
});
|
});
|
||||||
Get.back();
|
Get.back();
|
||||||
|
// applied = true;
|
||||||
sql.insertData({
|
sql.insertData({
|
||||||
'order_id': orderID,
|
'order_id': orderID,
|
||||||
'created_at': DateTime.now().toString(),
|
'created_at': DateTime.now().toString(),
|
||||||
'driver_id': box.read(BoxName.driverID).toString(),
|
'driver_id': box.read(BoxName.driverID).toString(),
|
||||||
|
'rideId': orderID
|
||||||
}, TableName.driverOrdersRefuse);
|
}, TableName.driverOrdersRefuse);
|
||||||
getRefusedOrderByCaptain();
|
getRefusedOrderByCaptain();
|
||||||
|
box.write(BoxName.statusDriverLocation, 'off');
|
||||||
update();
|
update();
|
||||||
|
// Get.offAll(HomeCaptain());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:ride/controller/home/payment/captain_wallet_controller.dart';
|
import 'package:ride/controller/home/payment/captain_wallet_controller.dart';
|
||||||
import 'package:ride/views/home/my_wallet/walet_captain.dart';
|
|
||||||
|
|
||||||
import '../../../../constant/style.dart';
|
import '../../../../constant/style.dart';
|
||||||
import '../../../../views/widgets/elevated_btn.dart';
|
import '../../../../views/widgets/elevated_btn.dart';
|
||||||
@@ -34,7 +33,7 @@ class ConnectWidget extends StatelessWidget {
|
|||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
title: double.parse(captainWalletController.totalPoints) <
|
title: double.parse(captainWalletController.totalPoints) <
|
||||||
-100
|
-100
|
||||||
? 'You dont have Points'
|
? 'You dont have Points'.tr
|
||||||
: 'You Are Stopped For this Day !'.tr,
|
: 'You Are Stopped For this Day !'.tr,
|
||||||
titleStyle: AppStyle.title,
|
titleStyle: AppStyle.title,
|
||||||
content: Text(
|
content: Text(
|
||||||
|
|||||||
@@ -184,10 +184,11 @@ class MapPassengerController extends GetxController {
|
|||||||
late double totalME = 0;
|
late double totalME = 0;
|
||||||
late double tax = 0;
|
late double tax = 0;
|
||||||
late double totalPassenger = 0;
|
late double totalPassenger = 0;
|
||||||
|
late double totalCostPassenger = 0;
|
||||||
late double totalDriver = 0;
|
late double totalDriver = 0;
|
||||||
late double averageDuration = 0;
|
late double averageDuration = 0;
|
||||||
late double costDuration = 0;
|
late double costDuration = 0;
|
||||||
late double cost = 0;
|
late double costDistance = 0;
|
||||||
late double distance = 0;
|
late double distance = 0;
|
||||||
late double duration = 0;
|
late double duration = 0;
|
||||||
|
|
||||||
@@ -514,19 +515,24 @@ class MapPassengerController extends GetxController {
|
|||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
rideTimerBegin = false;
|
rideTimerBegin = false;
|
||||||
isRideFinished = true;
|
isRideFinished = true;
|
||||||
update();
|
update();
|
||||||
//print('rideTimerBegin: $rideTimerBegin');
|
//print('rideTimerBegin: $rideTimerBegin');
|
||||||
//print('isRideFinished: $isRideFinished');
|
//print('isRideFinished: $isRideFinished');
|
||||||
if (Get.find<PaymentController>().isWalletChecked == true &&
|
// if (Get.find<PaymentController>().isWalletChecked == true &&
|
||||||
Get.find<PaymentController>().isCashChecked == false) {
|
// Get.find<PaymentController>().isCashChecked == false) {
|
||||||
await CRUD().post(link: AppLink.addPassengersWallet, payload: {
|
// if (double.parse(box.read(BoxName.passengerWalletTotal)) < 0) {
|
||||||
'passenger_id': box.read(BoxName.passengerID).toString(),
|
// totalPassenger = totalCostPassenger +
|
||||||
'balance': ((-1) * totalPassenger).toString()
|
// double.parse(box.read(BoxName.passengerWalletTotal));
|
||||||
});
|
// } else {
|
||||||
}
|
// totalPassenger = totalCostPassenger + 0;
|
||||||
|
// }
|
||||||
|
// await CRUD().post(link: AppLink.addPassengersWallet, payload: {
|
||||||
|
// 'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||||
|
// 'balance': ((-1) * totalPassenger).toString()
|
||||||
|
// });
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void getBeginRideFromDriver() async {
|
void getBeginRideFromDriver() async {
|
||||||
@@ -699,10 +705,10 @@ class MapPassengerController extends GetxController {
|
|||||||
List<String> body = [
|
List<String> body = [
|
||||||
'${data[0]["start_location"]['lat']},${data[0]["start_location"]['lng']}',
|
'${data[0]["start_location"]['lat']},${data[0]["start_location"]['lng']}',
|
||||||
'${data[0]["end_location"]['lat']},${data[0]["end_location"]['lng']}',
|
'${data[0]["end_location"]['lat']},${data[0]["end_location"]['lng']}',
|
||||||
totalPassenger.toString(),
|
totalPassenger.toStringAsFixed(2),
|
||||||
totalDriver.toString(),
|
totalDriver.toStringAsFixed(2),
|
||||||
durationToRide.toString(),
|
durationToRide.toString(),
|
||||||
distance.toString(),
|
distance.toStringAsFixed(2),
|
||||||
dataCarsLocationByPassenger['message'][carsOrder]['driver_id']
|
dataCarsLocationByPassenger['message'][carsOrder]['driver_id']
|
||||||
.toString(),
|
.toString(),
|
||||||
box.read(BoxName.passengerID).toString(),
|
box.read(BoxName.passengerID).toString(),
|
||||||
@@ -727,7 +733,7 @@ class MapPassengerController extends GetxController {
|
|||||||
placesCoordinate[2],
|
placesCoordinate[2],
|
||||||
placesCoordinate[3],
|
placesCoordinate[3],
|
||||||
placesCoordinate[4],
|
placesCoordinate[4],
|
||||||
cost.toStringAsFixed(2)
|
costDistance.toStringAsFixed(2)
|
||||||
];
|
];
|
||||||
FirebaseMessagesController().sendNotificationToDriverMAP(
|
FirebaseMessagesController().sendNotificationToDriverMAP(
|
||||||
'Order',
|
'Order',
|
||||||
@@ -781,6 +787,7 @@ class MapPassengerController extends GetxController {
|
|||||||
changeConfirmRide();
|
changeConfirmRide();
|
||||||
} else {
|
} else {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
title: 'There no Driver Aplly your order sorry for that '.tr,
|
title: 'There no Driver Aplly your order sorry for that '.tr,
|
||||||
middleText: 'try next time .',
|
middleText: 'try next time .',
|
||||||
confirm: MyElevatedButton(
|
confirm: MyElevatedButton(
|
||||||
@@ -956,9 +963,9 @@ class MapPassengerController extends GetxController {
|
|||||||
clearPlacesDestination();
|
clearPlacesDestination();
|
||||||
clearPolyline();
|
clearPolyline();
|
||||||
data = [];
|
data = [];
|
||||||
await CRUD().post(link: AppLink.updateDriverOrder, payload: {
|
await CRUD().post(link: AppLink.updateRides, payload: {
|
||||||
"order_id": rideId.toString(), // Convert to String
|
"id": rideId.toString(), // Convert to String
|
||||||
"status": 'Cancel'
|
"status": 'notApplyFromAnyDriver'
|
||||||
});
|
});
|
||||||
rideConfirm = false;
|
rideConfirm = false;
|
||||||
shouldFetch = false;
|
shouldFetch = false;
|
||||||
@@ -1780,8 +1787,14 @@ class MapPassengerController extends GetxController {
|
|||||||
if (decode["status"] == "success") {
|
if (decode["status"] == "success") {
|
||||||
//print(totalPassenger);
|
//print(totalPassenger);
|
||||||
var firstElement = decode["message"][0];
|
var firstElement = decode["message"][0];
|
||||||
totalPassenger = totalPassenger -
|
if (double.parse(box.read(BoxName.passengerWalletTotal)) < 0) {
|
||||||
(totalPassenger * int.parse(firstElement['amount']) / 100);
|
totalPassenger = totalCostPassenger -
|
||||||
|
(totalCostPassenger * int.parse(firstElement['amount']) / 100);
|
||||||
|
} else {
|
||||||
|
totalPassenger = totalCostPassenger -
|
||||||
|
(totalCostPassenger * int.parse(firstElement['amount']) / 100);
|
||||||
|
}
|
||||||
|
|
||||||
totalDriver = totalDriver -
|
totalDriver = totalDriver -
|
||||||
(totalDriver * int.parse(firstElement['amount']) / 100);
|
(totalDriver * int.parse(firstElement['amount']) / 100);
|
||||||
promoTaken = true;
|
promoTaken = true;
|
||||||
@@ -1814,34 +1827,51 @@ class MapPassengerController extends GetxController {
|
|||||||
averageDuration = (durationToRide / 60) / distance;
|
averageDuration = (durationToRide / 60) / distance;
|
||||||
costDuration = (durationToRide / 60) * averageDuration * 0.016;
|
costDuration = (durationToRide / 60) * averageDuration * 0.016;
|
||||||
print('costDuration----- $costDuration');
|
print('costDuration----- $costDuration');
|
||||||
var totalDriver1 = cost + costDuration;
|
print('costDistance----- $costDistance');
|
||||||
totalPassenger = totalDriver1 + (totalDriver1 * .16);
|
print(
|
||||||
|
'passengerWalletTotal----- ${box.read(BoxName.passengerWalletTotal)}');
|
||||||
|
var totalDriver1 = costDistance + costDuration;
|
||||||
|
totalCostPassenger = totalDriver1 + (totalDriver1 * .16);
|
||||||
totalDriver = totalDriver1 + (totalDriver1 * .16);
|
totalDriver = totalDriver1 + (totalDriver1 * .16);
|
||||||
tax = totalPassenger * .16;
|
tax = totalCostPassenger * .16;
|
||||||
totalME = totalPassenger - tax;
|
totalME = totalCostPassenger - tax;
|
||||||
|
|
||||||
|
if (double.parse(box.read(BoxName.passengerWalletTotal)) < 0) {
|
||||||
|
totalPassenger = totalCostPassenger +
|
||||||
|
(-1) * (double.parse(box.read(BoxName.passengerWalletTotal)));
|
||||||
|
} else {
|
||||||
|
totalPassenger = totalCostPassenger;
|
||||||
|
}
|
||||||
|
|
||||||
update();
|
update();
|
||||||
if (currentTime.hour >= 22) {
|
if (currentTime.hour >= 22) {
|
||||||
cost = distance * 0.23;
|
costDistance = distance * 0.23;
|
||||||
update();
|
update();
|
||||||
} else if (currentTime.hour < 5) {
|
} else if (currentTime.hour < 5) {
|
||||||
cost = distance * 0.25;
|
costDistance = distance * 0.25;
|
||||||
update();
|
update();
|
||||||
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
|
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
|
||||||
if (averageDuration > 2.5) {
|
if (averageDuration > 2.5) {
|
||||||
cost = distance * 0.25;
|
costDistance = distance * 0.25;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
cost = distance * 0.21;
|
costDistance = distance * 0.21;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cost = distance * 0.21;
|
costDistance = distance * 0.21;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
//print('cost $cost');
|
//print('cost $cost');
|
||||||
if (totalPassenger < 1) {
|
if (totalCostPassenger < 1) {
|
||||||
totalPassenger = 1;
|
totalCostPassenger = 1;
|
||||||
totalDriver = 1;
|
if (double.parse(box.read(BoxName.passengerWalletTotal)) < 0) {
|
||||||
|
totalPassenger = totalCostPassenger +
|
||||||
|
(-1) * (double.parse(box.read(BoxName.passengerWalletTotal)));
|
||||||
|
} else {
|
||||||
|
totalPassenger = totalCostPassenger;
|
||||||
|
}
|
||||||
|
|
||||||
update();
|
update();
|
||||||
// if (totalDriver < .5) {
|
// if (totalDriver < .5) {
|
||||||
// totalDriver = .75;
|
// totalDriver = .75;
|
||||||
@@ -1851,8 +1881,8 @@ class MapPassengerController extends GetxController {
|
|||||||
// totalDriver = .90;
|
// totalDriver = .90;
|
||||||
// totalME = .06;
|
// totalME = .06;
|
||||||
// update();
|
// update();
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
|
|
||||||
// buttomSheetMapPage();
|
// buttomSheetMapPage();
|
||||||
changeBottomSheetShown();
|
changeBottomSheetShown();
|
||||||
|
|||||||
@@ -459,6 +459,9 @@ class PaymentController extends GetxController {
|
|||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
timestamp = now.millisecondsSinceEpoch;
|
timestamp = now.millisecondsSinceEpoch;
|
||||||
|
if (box.read(BoxName.passengerWalletTotal) == null) {
|
||||||
|
box.write(BoxName.passengerWalletTotal, '0');
|
||||||
|
}
|
||||||
getPassengerWallet();
|
getPassengerWallet();
|
||||||
final localAuth = LocalAuthentication();
|
final localAuth = LocalAuthentication();
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:ride/constant/box_name.dart';
|
|||||||
import 'package:ride/constant/links.dart';
|
import 'package:ride/constant/links.dart';
|
||||||
import 'package:ride/controller/functions/crud.dart';
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
import 'package:ride/main.dart';
|
import 'package:ride/main.dart';
|
||||||
|
import 'package:ride/views/widgets/my_textField.dart';
|
||||||
|
|
||||||
import '../../views/widgets/elevated_btn.dart';
|
import '../../views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
@@ -37,24 +38,30 @@ class ProfileController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
updatField(String columnName) async {
|
updatField(String columnName, TextInputType type) async {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
title: '${'Update'.tr} $columnName',
|
title: '${'Update'.tr} $columnName',
|
||||||
content: Column(
|
content: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: Get.width * .7,
|
width: Get.width * .7,
|
||||||
child: TextField(
|
child: MyTextForm(
|
||||||
controller: txtController,
|
controller: txtController,
|
||||||
decoration: const InputDecoration(
|
label: 'type here'.tr,
|
||||||
border: OutlineInputBorder(), hintText: 'type here'),
|
hint: 'type here',
|
||||||
),
|
type: type)
|
||||||
|
// TextField(
|
||||||
|
// controller: txtController,
|
||||||
|
// decoration: const InputDecoration(
|
||||||
|
// border: OutlineInputBorder(), hintText: 'type here'),
|
||||||
|
// ),
|
||||||
|
|
||||||
),
|
),
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title: 'Update'.tr,
|
title: 'Update'.tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
updateColumn({
|
updateColumn({
|
||||||
'id': prfoileData['id'].toString(),
|
'id': box.read(BoxName.passengerID),
|
||||||
columnName: txtController.text,
|
columnName: txtController.text,
|
||||||
});
|
});
|
||||||
if (columnName == 'first_name') {
|
if (columnName == 'first_name') {
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import 'package:flutter_stripe/flutter_stripe.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:get_storage/get_storage.dart';
|
import 'package:get_storage/get_storage.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:ride/controller/home/map_passenger_controller.dart';
|
|
||||||
|
|
||||||
import 'constant/api_key.dart';
|
import 'constant/api_key.dart';
|
||||||
import 'constant/credential.dart';
|
import 'constant/credential.dart';
|
||||||
import 'constant/info.dart';
|
import 'constant/info.dart';
|
||||||
import 'controller/firebase/firbase_messge.dart';
|
import 'controller/firebase/firbase_messge.dart';
|
||||||
|
import 'controller/firebase/local_notification.dart';
|
||||||
import 'controller/local/local_controller.dart';
|
import 'controller/local/local_controller.dart';
|
||||||
import 'controller/local/translations.dart';
|
import 'controller/local/translations.dart';
|
||||||
import 'firebase_options.dart';
|
import 'firebase_options.dart';
|
||||||
@@ -33,13 +33,25 @@ Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
|||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
await NotificationController().initNotifications();
|
||||||
await GetStorage.init();
|
await GetStorage.init();
|
||||||
await AC().gAK();
|
await AC().gAK();
|
||||||
print(
|
print(
|
||||||
'local is t ${WidgetsBinding.instance.platformDispatcher.locale.countryCode}');
|
'local is t ${WidgetsBinding.instance.platformDispatcher.locale.countryCode}');
|
||||||
print(Get.deviceLocale!.countryCode);
|
print(Get.deviceLocale!.countryCode);
|
||||||
Stripe.publishableKey = AK.publishableKey;
|
Stripe.publishableKey = AK.publishableKey;
|
||||||
|
final navigatorKey = GlobalKey<NavigatorState>();
|
||||||
|
|
||||||
|
/// 2/5: set navigator key to ZegoUIKitPrebuiltCallInvitationService
|
||||||
|
// ZegoUIKitPrebuiltCallInvitationService().setNavigatorKey(navigatorKey);
|
||||||
|
|
||||||
|
// ZegoUIKit().initLog().then((value) {
|
||||||
|
// ZegoUIKitPrebuiltCallInvitationService().useSystemCallingUI(
|
||||||
|
// [ZegoUIKitSignalingPlugin()],
|
||||||
|
// );
|
||||||
|
|
||||||
|
// runApp(MyApp(navigatorKey: navigatorKey));
|
||||||
|
// });
|
||||||
//StripeKey.publishableKey;
|
//StripeKey.publishableKey;
|
||||||
if (Platform.isAndroid || Platform.isIOS) {
|
if (Platform.isAndroid || Platform.isIOS) {
|
||||||
await Firebase.initializeApp(
|
await Firebase.initializeApp(
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ class DbSql {
|
|||||||
CREATE TABLE IF NOT EXISTS ${TableName.driverOrdersRefuse}(
|
CREATE TABLE IF NOT EXISTS ${TableName.driverOrdersRefuse}(
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
order_id TEXT,
|
order_id TEXT,
|
||||||
|
rideId TEXT UNIQUE,
|
||||||
created_at TEXT,
|
created_at TEXT,
|
||||||
driver_id TEXT
|
driver_id TEXT
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: AppColor.greenColor,
|
backgroundColor: AppColor.greenColor,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
title: Text('Captain Home'.tr),
|
title: Text('Home'.tr),
|
||||||
actions: [
|
actions: [
|
||||||
GetBuilder<LocationController>(
|
GetBuilder<LocationController>(
|
||||||
builder: (locationController) => locationController.isLoading
|
builder: (locationController) => locationController.isLoading
|
||||||
@@ -58,7 +58,19 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
orderRequestController.countRefuse.toString(),
|
orderRequestController.countRefuse.toString(),
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
)))
|
))),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
// NotificationController()
|
||||||
|
// .showNotification('Order', 'hi this is', 'tone2');
|
||||||
|
// Get.to(() => CallPage(callID: '111'));
|
||||||
|
// MapDriverController().getDriverScam();
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.call,
|
||||||
|
size: 29,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
drawer: DrawerCaptain(),
|
drawer: DrawerCaptain(),
|
||||||
|
|||||||
@@ -98,7 +98,11 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
MainAxisAlignment.spaceAround,
|
MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
|
controller.isSocialPressed = true;
|
||||||
|
await controller
|
||||||
|
.driverCallPassenger();
|
||||||
|
|
||||||
launchCommunication('phone',
|
launchCommunication('phone',
|
||||||
controller.phone.toString(), '');
|
controller.phone.toString(), '');
|
||||||
},
|
},
|
||||||
@@ -107,22 +111,30 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
color: AppColor.blueColor,
|
color: AppColor.blueColor,
|
||||||
)),
|
)),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
|
controller.isSocialPressed = true;
|
||||||
|
await controller
|
||||||
|
.driverCallPassenger();
|
||||||
|
|
||||||
launchCommunication(
|
launchCommunication(
|
||||||
'whatsapp',
|
'whatsapp',
|
||||||
controller.phone.toString(),
|
controller.phone.toString(),
|
||||||
'${'Hello this is Captain'.tr} ${box.read(BoxName.nameDriver)}');
|
'${'Hello this is Driver'.tr} ${box.read(BoxName.nameDriver)}');
|
||||||
},
|
},
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
FontAwesome.whatsapp,
|
FontAwesome.whatsapp,
|
||||||
color: AppColor.greenColor,
|
color: AppColor.greenColor,
|
||||||
)),
|
)),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
|
controller.isSocialPressed = true;
|
||||||
|
await controller
|
||||||
|
.driverCallPassenger();
|
||||||
|
|
||||||
launchCommunication(
|
launchCommunication(
|
||||||
'sms',
|
'sms',
|
||||||
controller.phone.toString(),
|
controller.phone.toString(),
|
||||||
'${'Hello this is Captain'.tr} ${box.read(BoxName.nameDriver)}');
|
'${'Hello this is Driver'.tr} ${box.read(BoxName.nameDriver)}');
|
||||||
},
|
},
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.sms_rounded,
|
Icons.sms_rounded,
|
||||||
@@ -130,6 +142,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
)),
|
)),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
controller.isSocialPressed = true;
|
||||||
launchCommunication(
|
launchCommunication(
|
||||||
'email',
|
'email',
|
||||||
controller.phone.toString(),
|
controller.phone.toString(),
|
||||||
@@ -203,7 +216,10 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
? MyElevatedButton(
|
? MyElevatedButton(
|
||||||
title: 'I arrive you'.tr,
|
title: 'I arrive you'.tr,
|
||||||
kolor: AppColor.yellowColor,
|
kolor: AppColor.yellowColor,
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
|
if (controller
|
||||||
|
.calculateDistanseBetweenDriverAndPassengerLocation() <
|
||||||
|
40) {
|
||||||
FirebaseMessagesController()
|
FirebaseMessagesController()
|
||||||
.sendNotificationToPassengerToken(
|
.sendNotificationToPassengerToken(
|
||||||
'Hi ,I Arrive your site'
|
'Hi ,I Arrive your site'
|
||||||
@@ -215,8 +231,10 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
[]);
|
[]);
|
||||||
controller
|
controller
|
||||||
.startTimerToShowDriverWaitPassengerDuration();
|
.startTimerToShowDriverWaitPassengerDuration();
|
||||||
controller.isArrivedSend =
|
controller
|
||||||
|
.isArrivedSend =
|
||||||
false;
|
false;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
: const SizedBox()
|
: const SizedBox()
|
||||||
],
|
],
|
||||||
@@ -259,9 +277,18 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
.tr,
|
.tr,
|
||||||
kolor: AppColor
|
kolor: AppColor
|
||||||
.deepPurpleAccent,
|
.deepPurpleAccent,
|
||||||
onPressed: () async {
|
onPressed: () {
|
||||||
FirebaseMessagesController()
|
Get.defaultDialog(
|
||||||
.sendNotificationToPassengerToken(
|
title:
|
||||||
|
'Are you sure to cancel?'
|
||||||
|
.tr,
|
||||||
|
confirm:
|
||||||
|
MyElevatedButton(
|
||||||
|
title:
|
||||||
|
'Yes'.tr,
|
||||||
|
onPressed:
|
||||||
|
() async {
|
||||||
|
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||||
'Driver Cancel Your Trip'
|
'Driver Cancel Your Trip'
|
||||||
.tr,
|
.tr,
|
||||||
'You will be pay the cost to driver or we will get it from you on next trip'
|
'You will be pay the cost to driver or we will get it from you on next trip'
|
||||||
@@ -274,6 +301,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
controller
|
controller
|
||||||
.isdriverWaitTimeEnd =
|
.isdriverWaitTimeEnd =
|
||||||
false;
|
false;
|
||||||
|
}));
|
||||||
})
|
})
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
],
|
],
|
||||||
|
|||||||
25
lib/views/home/Captin/orderCaptin/call.dart
Normal file
25
lib/views/home/Captin/orderCaptin/call.dart
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
// import 'package:flutter/material.dart';
|
||||||
|
// import 'package:ride/constant/api_key.dart';
|
||||||
|
// import 'package:ride/constant/box_name.dart';
|
||||||
|
// import 'package:ride/main.dart';
|
||||||
|
// import 'package:zego_uikit_prebuilt_call/zego_uikit_prebuilt_call.dart';
|
||||||
|
|
||||||
|
// class CallPage extends StatelessWidget {
|
||||||
|
// const CallPage({Key? key, required this.callID}) : super(key: key);
|
||||||
|
// final String callID;
|
||||||
|
|
||||||
|
// @override
|
||||||
|
// Widget build(BuildContext context) {
|
||||||
|
// return ZegoUIKitPrebuiltCall(
|
||||||
|
// appID: AK
|
||||||
|
// .zegoCloudAppID, // Fill in the appID that you get from ZEGOCLOUD Admin Console.
|
||||||
|
// appSign: AK
|
||||||
|
// .zegoCloudAppSIGN, // Fill in the appSign that you get from ZEGOCLOUD Admin Console.
|
||||||
|
// userID: box.read(BoxName.passengerID) ?? box.read(BoxName.driverID),
|
||||||
|
// userName: box.read(BoxName.name) ?? box.read(BoxName.nameDriver),
|
||||||
|
// callID: callID,
|
||||||
|
// // You can also use groupVideo/groupVoice/oneOnOneVoice to make more types of calls.
|
||||||
|
// config: ZegoUIKitPrebuiltCallConfig.oneOnOneVoiceCall(),
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
@@ -223,6 +223,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
'passengerLocation': myList[0].toString(),
|
'passengerLocation': myList[0].toString(),
|
||||||
'passengerDestination': myList[1].toString(),
|
'passengerDestination': myList[1].toString(),
|
||||||
'Duration': myList[4].toString(),
|
'Duration': myList[4].toString(),
|
||||||
|
'totalCost': myList[2].toString(),
|
||||||
'Distance': myList[5].toString(),
|
'Distance': myList[5].toString(),
|
||||||
'name': myList[8].toString(),
|
'name': myList[8].toString(),
|
||||||
'phone': myList[10].toString(),
|
'phone': myList[10].toString(),
|
||||||
@@ -276,8 +277,6 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
box.read(BoxName.nameDriver).toString(),
|
box.read(BoxName.nameDriver).toString(),
|
||||||
box.read(BoxName.tokenDriver).toString(),
|
box.read(BoxName.tokenDriver).toString(),
|
||||||
];
|
];
|
||||||
orderRequestController.refuseOrder(
|
|
||||||
myList[16].toString(), body.toString());
|
|
||||||
|
|
||||||
FirebaseMessagesController()
|
FirebaseMessagesController()
|
||||||
.sendNotificationToPassengerToken(
|
.sendNotificationToPassengerToken(
|
||||||
@@ -287,6 +286,8 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
// box.read(BoxName.tokenDriver).toString(),
|
// box.read(BoxName.tokenDriver).toString(),
|
||||||
bodyToPassenger,
|
bodyToPassenger,
|
||||||
);
|
);
|
||||||
|
orderRequestController.refuseOrder(
|
||||||
|
myList[16].toString(), body.toString());
|
||||||
},
|
},
|
||||||
kolor: AppColor.redColor,
|
kolor: AppColor.redColor,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:ride/constant/box_name.dart';
|
||||||
import 'package:ride/constant/info.dart';
|
import 'package:ride/constant/info.dart';
|
||||||
import 'package:ride/controller/payment/payment_controller.dart';
|
import 'package:ride/controller/payment/payment_controller.dart';
|
||||||
|
import 'package:ride/main.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
@@ -13,13 +15,49 @@ import '../../../controller/home/map_passenger_controller.dart';
|
|||||||
GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||||
Get.put(PaymentController());
|
Get.put(PaymentController());
|
||||||
return GetBuilder<MapPassengerController>(
|
return GetBuilder<MapPassengerController>(
|
||||||
builder: (controller) => controller.isBottomSheetShown &&
|
builder: (controller) =>
|
||||||
controller.rideConfirm == false
|
controller.isBottomSheetShown && controller.rideConfirm == false
|
||||||
? Positioned(
|
? Positioned(
|
||||||
left: 5,
|
left: 5,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
right: 5,
|
right: 5,
|
||||||
child: AnimatedContainer(
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
double.parse(box.read(BoxName.passengerWalletTotal)) <
|
||||||
|
0 &&
|
||||||
|
controller.data.isNotEmpty
|
||||||
|
? Container(
|
||||||
|
decoration: AppStyle.boxDecoration.copyWith(
|
||||||
|
color: AppColor.redColor.withOpacity(.5)),
|
||||||
|
height: 50,
|
||||||
|
width: Get.width * .94,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 8),
|
||||||
|
child: Text(
|
||||||
|
'Your trip cost is'.tr +
|
||||||
|
' ${controller.totalCostPassenger.toStringAsFixed(2)} '
|
||||||
|
'But you have a negative salary of'
|
||||||
|
.tr +
|
||||||
|
'${double.parse(box.read(BoxName.passengerWalletTotal)).toStringAsFixed(2)}'
|
||||||
|
' in your'
|
||||||
|
.tr +
|
||||||
|
' ${AppInformation.appName}'
|
||||||
|
' wallet due to a previous trip.'
|
||||||
|
.tr,
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
),
|
||||||
|
))
|
||||||
|
: const SizedBox(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
AnimatedContainer(
|
||||||
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||||
curve: Curves.easeInCirc,
|
curve: Curves.easeInCirc,
|
||||||
onEnd: () {
|
onEnd: () {
|
||||||
@@ -41,14 +79,15 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
color: AppColor.accentColor,
|
color: AppColor.accentColor,
|
||||||
offset: Offset(2, 2)),
|
offset: Offset(2, 2)),
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color:
|
color: AppColor.accentColor
|
||||||
AppColor.accentColor.withOpacity(.4),
|
.withOpacity(.4),
|
||||||
offset: const Offset(-2, -2))
|
offset: const Offset(-2, -2))
|
||||||
],
|
],
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(15))),
|
Radius.circular(15))),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: Get.width * .15,
|
width: Get.width * .15,
|
||||||
@@ -100,11 +139,13 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
width: Get.width * .14,
|
width: Get.width * .14,
|
||||||
height: Get.height * .06,
|
height: Get.height * .06,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.secondaryColor,
|
color: AppColor
|
||||||
|
.secondaryColor,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
width: 2,
|
width: 2,
|
||||||
color: AppColor.greenColor)),
|
color: AppColor
|
||||||
|
.greenColor)),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
||||||
@@ -114,8 +155,10 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
),
|
),
|
||||||
controller.promoTaken
|
controller.promoTaken
|
||||||
? const Icon(
|
? const Icon(
|
||||||
Icons.filter_vintage_rounded,
|
Icons
|
||||||
color: AppColor.redColor,
|
.filter_vintage_rounded,
|
||||||
|
color:
|
||||||
|
AppColor.redColor,
|
||||||
)
|
)
|
||||||
: const SizedBox(
|
: const SizedBox(
|
||||||
height: 0,
|
height: 0,
|
||||||
@@ -138,17 +181,18 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
color: AppColor.accentColor,
|
color: AppColor.accentColor,
|
||||||
offset: Offset(2, 2)),
|
offset: Offset(2, 2)),
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: AppColor.accentColor.withOpacity(.4),
|
color: AppColor.accentColor
|
||||||
|
.withOpacity(.4),
|
||||||
offset: const Offset(-2, -2))
|
offset: const Offset(-2, -2))
|
||||||
],
|
],
|
||||||
borderRadius:
|
borderRadius: const BorderRadius.all(
|
||||||
const BorderRadius.all(Radius.circular(15))),
|
Radius.circular(15))),
|
||||||
child: controller.data.isEmpty
|
child: controller.data.isEmpty
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: Center(
|
: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsets.symmetric(
|
||||||
const EdgeInsets.symmetric(horizontal: 5),
|
horizontal: 5),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
@@ -165,7 +209,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
style: AppStyle.subtitle,
|
style: AppStyle.subtitle,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
controller.data[0]['start_address']
|
controller.data[0]
|
||||||
|
['start_address']
|
||||||
.toString(),
|
.toString(),
|
||||||
style: AppStyle.subtitle,
|
style: AppStyle.subtitle,
|
||||||
)
|
)
|
||||||
@@ -173,8 +218,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
const Icon(
|
const Icon(Icons
|
||||||
Icons.location_searching_rounded),
|
.location_searching_rounded),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 10,
|
width: 10,
|
||||||
),
|
),
|
||||||
@@ -183,7 +228,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
style: AppStyle.subtitle,
|
style: AppStyle.subtitle,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
controller.data[0]['end_address'],
|
controller.data[0]
|
||||||
|
['end_address'],
|
||||||
style: AppStyle.subtitle,
|
style: AppStyle.subtitle,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -202,16 +248,19 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.secondaryColor,
|
color: AppColor
|
||||||
|
.secondaryColor,
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(12),
|
BorderRadius.circular(
|
||||||
|
12),
|
||||||
// border: Border.all(),
|
// border: Border.all(),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.monetization_on,
|
Icons.monetization_on,
|
||||||
color: Colors.green[400],
|
color:
|
||||||
|
Colors.green[400],
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
@@ -223,8 +272,7 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
},
|
},
|
||||||
child: GetBuilder<
|
child: GetBuilder<
|
||||||
PaymentController>(
|
PaymentController>(
|
||||||
builder:
|
builder: (paymentController) =>
|
||||||
(paymentController) =>
|
|
||||||
paymentController
|
paymentController
|
||||||
.isCashChecked
|
.isCashChecked
|
||||||
? Text(
|
? Text(
|
||||||
@@ -255,7 +303,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
.secondaryColor,
|
.secondaryColor,
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius
|
BorderRadius
|
||||||
.circular(12),
|
.circular(
|
||||||
|
12),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -263,22 +312,21 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
Icons
|
Icons
|
||||||
.qr_code_2_rounded,
|
.qr_code_2_rounded,
|
||||||
color: Colors
|
color: Colors
|
||||||
.green[400],
|
.green[
|
||||||
|
400],
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap:
|
||||||
if (controller
|
() {
|
||||||
.promoTaken ==
|
if (controller.promoTaken ==
|
||||||
false) {
|
false) {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
title: 'Add Promo'.tr,
|
title: 'Add Promo'.tr,
|
||||||
content: Column(
|
content: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width:
|
width: Get.width * .7,
|
||||||
Get.width * .7,
|
child: TextFormField(
|
||||||
child:
|
|
||||||
TextFormField(
|
|
||||||
controller: controller.promo,
|
controller: controller.promo,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: 'Promo Code'.tr,
|
labelText: 'Promo Code'.tr,
|
||||||
@@ -313,10 +361,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title:
|
title: 'Add Promo'.tr,
|
||||||
'Add Promo'.tr,
|
onPressed: () async {
|
||||||
onPressed:
|
|
||||||
() async {
|
|
||||||
controller.applyPromoCodeToPassenger();
|
controller.applyPromoCodeToPassenger();
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -324,16 +370,15 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
'You have promo!'
|
'You have promo!'.tr,
|
||||||
.tr,
|
|
||||||
'',
|
'',
|
||||||
backgroundColor:
|
backgroundColor: AppColor.redColor);
|
||||||
AppColor
|
|
||||||
.redColor);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(
|
child:
|
||||||
'Add Promo'.tr,
|
Text(
|
||||||
|
'Add Promo'
|
||||||
|
.tr,
|
||||||
style: AppStyle
|
style: AppStyle
|
||||||
.title,
|
.title,
|
||||||
),
|
),
|
||||||
@@ -373,8 +418,10 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
'How Many Passengers?'
|
'How Many Passengers?'
|
||||||
.tr,
|
.tr,
|
||||||
titleStyle:
|
titleStyle:
|
||||||
AppStyle.title,
|
AppStyle
|
||||||
content: Column(
|
.title,
|
||||||
|
content:
|
||||||
|
Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Allowed up to 4 Passengers.'
|
'Allowed up to 4 Passengers.'
|
||||||
@@ -391,25 +438,22 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
32,
|
32,
|
||||||
onSelectedItemChanged:
|
onSelectedItemChanged:
|
||||||
(index) {
|
(index) {
|
||||||
controller.onChangedPassengerCount(
|
controller.onChangedPassengerCount(index +
|
||||||
index +
|
|
||||||
1);
|
1);
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
Text('1 Passenger'
|
Text('1 Passenger'.tr),
|
||||||
.tr),
|
Text('2 Passengers'.tr),
|
||||||
Text('2 Passengers'
|
Text('3 Passengers'.tr),
|
||||||
.tr),
|
Text('4 Passengers'.tr),
|
||||||
Text('3 Passengers'
|
|
||||||
.tr),
|
|
||||||
Text('4 Passengers'
|
|
||||||
.tr),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title: 'Back',
|
title:
|
||||||
onPressed: () =>
|
'Back',
|
||||||
|
onPressed:
|
||||||
|
() =>
|
||||||
Get.back(),
|
Get.back(),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@@ -418,7 +462,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
: MyElevatedButton(
|
: MyElevatedButton(
|
||||||
title: 'Confirm Selection'
|
title:
|
||||||
|
'Confirm Selection'
|
||||||
.tr,
|
.tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
controller
|
controller
|
||||||
@@ -436,6 +481,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
: const SizedBox());
|
: const SizedBox());
|
||||||
}
|
}
|
||||||
@@ -467,7 +514,7 @@ class Details extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Cost for .21/km ${controller.cost.toStringAsFixed(2)} ',
|
'Cost for .21/km ${controller.costDistance.toStringAsFixed(2)} ',
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -157,6 +157,8 @@ class CashConfirmPageShown extends StatelessWidget {
|
|||||||
title: 'Next as Cash \$\$!'.tr,
|
title: 'Next as Cash \$\$!'.tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
paymentController.isCashChecked = true;
|
paymentController.isCashChecked = true;
|
||||||
|
paymentController.isWalletChecked = false;
|
||||||
|
paymentController.update();
|
||||||
controller.changeCashConfirmPageShown();
|
controller.changeCashConfirmPageShown();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ import 'package:ride/constant/box_name.dart';
|
|||||||
import 'package:ride/main.dart';
|
import 'package:ride/main.dart';
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
|
import '../../../controller/firebase/local_notification.dart';
|
||||||
import '../../../controller/functions/tts.dart';
|
import '../../../controller/functions/tts.dart';
|
||||||
import '../../../controller/home/map_passenger_controller.dart';
|
import '../../../controller/home/map_passenger_controller.dart';
|
||||||
|
import '../Captin/orderCaptin/call.dart';
|
||||||
|
|
||||||
GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||||
final textToSpeechController = Get.put(TextToSpeechController());
|
final textToSpeechController = Get.put(TextToSpeechController());
|
||||||
@@ -99,6 +101,26 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
AnimatedContainer(
|
||||||
|
duration: const Duration(microseconds: 200),
|
||||||
|
width: controller.widthMapTypeAndTraffic,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
border: Border.all(),
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
NotificationController()
|
||||||
|
.showNotification('Order', 'hi this is', 'tone1');
|
||||||
|
// Get.to(() => CallPage(callID: '111'));
|
||||||
|
// Get.to(() => CallPage(callID: controller.rideId));
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.call,
|
||||||
|
size: 29,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class RideBeginPassenger extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'You will arrive to your destination after '.tr,
|
'You will arrive to your destination after timer end.'.tr,
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
Stack(
|
Stack(
|
||||||
@@ -45,7 +45,7 @@ class RideBeginPassenger extends StatelessWidget {
|
|||||||
color: controller.remainingTimeTimerRideBegin < 60
|
color: controller.remainingTimeTimerRideBegin < 60
|
||||||
? AppColor.redColor
|
? AppColor.redColor
|
||||||
: AppColor.greenColor,
|
: AppColor.greenColor,
|
||||||
minHeight: 50,
|
minHeight: 45,
|
||||||
borderRadius: BorderRadius.circular(15),
|
borderRadius: BorderRadius.circular(15),
|
||||||
value: controller.progressTimerRideBegin.toDouble(),
|
value: controller.progressTimerRideBegin.toDouble(),
|
||||||
),
|
),
|
||||||
@@ -61,45 +61,52 @@ class RideBeginPassenger extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
|
||||||
if (box.read(BoxName.sosPhonePassenger).toString() ==
|
|
||||||
'') {
|
|
||||||
Get.defaultDialog(
|
|
||||||
title: 'You dont Add Emergency Phone Yet!'.tr,
|
|
||||||
content: Column(
|
|
||||||
children: [
|
|
||||||
Form(
|
|
||||||
key: controller.sosFormKey,
|
|
||||||
child: TextFormField(
|
|
||||||
keyboardType: TextInputType
|
|
||||||
.phone, // Set the keyboard type to phone
|
|
||||||
validator: (value) {
|
|
||||||
if (value!.isEmpty ||
|
|
||||||
value.length != 10) {
|
|
||||||
return 'Please enter a valid phone number'
|
|
||||||
.tr;
|
|
||||||
}
|
|
||||||
// Add additional validation if needed
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
border: OutlineInputBorder(),
|
|
||||||
hintText: 'Type here',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
confirm: MyElevatedButton(
|
|
||||||
title: 'Add Phone'.tr,
|
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await profileController
|
if (box.read(BoxName.sosPhonePassenger) == null) {
|
||||||
.updatField('sosPhone');
|
{
|
||||||
box.write(
|
await profileController.updatField(
|
||||||
BoxName.sosPhonePassenger,
|
'sosPhone', TextInputType.phone);
|
||||||
profileController
|
box.write(BoxName.sosPhonePassenger,
|
||||||
.prfoileData['sosPhone']);
|
profileController.prfoileData['sosPhone']);
|
||||||
}));
|
}
|
||||||
|
// Get.defaultDialog(
|
||||||
|
// title: 'You dont Add Emergency Phone Yet!'.tr,
|
||||||
|
// content: Column(
|
||||||
|
// children: [
|
||||||
|
// Form(
|
||||||
|
// key: controller.sosFormKey,
|
||||||
|
// child: TextFormField(
|
||||||
|
// keyboardType: TextInputType
|
||||||
|
// .phone, // Set the keyboard type to phone
|
||||||
|
// controller:
|
||||||
|
// controller.sosPhonePassengerProfile,
|
||||||
|
// validator: (value) {
|
||||||
|
// if (value!.isEmpty ||
|
||||||
|
// value.length != 10) {
|
||||||
|
// return 'Please enter a valid phone number'
|
||||||
|
// .tr;
|
||||||
|
// }
|
||||||
|
// // Add additional validation if needed
|
||||||
|
// return null;
|
||||||
|
// },
|
||||||
|
// decoration: const InputDecoration(
|
||||||
|
// border: OutlineInputBorder(),
|
||||||
|
// hintText: 'Type here',
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// confirm: MyElevatedButton(
|
||||||
|
// title: 'Add Phone'.tr,
|
||||||
|
// onPressed: () async {
|
||||||
|
// await profileController
|
||||||
|
// .updatField('sosPhone');
|
||||||
|
// box.write(
|
||||||
|
// BoxName.sosPhonePassenger,
|
||||||
|
// profileController
|
||||||
|
// .prfoileData['sosPhone']);
|
||||||
|
// }));
|
||||||
} else {
|
} else {
|
||||||
controller
|
controller
|
||||||
.sendSMS(box.read(BoxName.sosPhonePassenger));
|
.sendSMS(box.read(BoxName.sosPhonePassenger));
|
||||||
@@ -111,48 +118,24 @@ class RideBeginPassenger extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
|
||||||
if (box.read(BoxName.sosPhonePassenger).toString() ==
|
|
||||||
'') {
|
|
||||||
Get.defaultDialog(
|
|
||||||
title: 'You dont Add Emergency Phone Yet!'.tr,
|
|
||||||
content: Column(
|
|
||||||
children: [
|
|
||||||
Form(
|
|
||||||
key: controller.sosFormKey,
|
|
||||||
child: TextFormField(
|
|
||||||
keyboardType: TextInputType
|
|
||||||
.phone, // Set the keyboard type to phone
|
|
||||||
validator: (value) {
|
|
||||||
if (value!.isEmpty ||
|
|
||||||
value.length < 10) {
|
|
||||||
return 'Please enter a phone number'
|
|
||||||
.tr;
|
|
||||||
}
|
|
||||||
// Add additional validation if needed
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
border: OutlineInputBorder(),
|
|
||||||
hintText: 'Type here',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
confirm: MyElevatedButton(
|
|
||||||
title: 'Add Phone'.tr,
|
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await profileController
|
print(box.read(BoxName.sosPhonePassenger));
|
||||||
.updatField('sosPhone');
|
if (box.read(BoxName.sosPhonePassenger) == null ||
|
||||||
box.write(
|
box.read(BoxName.sosPhonePassenger) == 'sos') {
|
||||||
BoxName.sosPhonePassenger,
|
{
|
||||||
profileController
|
await profileController.updatField(
|
||||||
.prfoileData['sosPhone']);
|
'sosPhone', TextInputType.phone);
|
||||||
}));
|
box.write(BoxName.sosPhonePassenger,
|
||||||
|
profileController.prfoileData['sosPhone']);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
controller.sendWhatsapp(
|
String phoneNumber =
|
||||||
box.read(BoxName.sosPhonePassenger).toString());
|
box.read(BoxName.sosPhonePassenger).toString();
|
||||||
|
phoneNumber = phoneNumber.replaceAll('0', '');
|
||||||
|
print(phoneNumber); // Output: 798583061
|
||||||
|
var phone =
|
||||||
|
'+962${box.read(BoxName.sosPhonePassenger)}';
|
||||||
|
controller.sendWhatsapp(phone);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ class PassengerProfilePage extends StatelessWidget {
|
|||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'${controller.prfoileData['first_name']} ${controller.prfoileData['last_name']}'),
|
'${controller.prfoileData['first_name']} ${controller.prfoileData['last_name']}'),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
controller.updatField('first_name');
|
controller.updatField(
|
||||||
|
'first_name', TextInputType.name);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
@@ -144,7 +145,8 @@ class PassengerProfilePage extends StatelessWidget {
|
|||||||
.prfoileData['employmentType']
|
.prfoileData['employmentType']
|
||||||
.toString()),
|
.toString()),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
controller.updatField('employmentType');
|
controller.updatField(
|
||||||
|
'employmentType', TextInputType.name);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
@@ -161,7 +163,8 @@ class PassengerProfilePage extends StatelessWidget {
|
|||||||
.prfoileData['maritalStatus']
|
.prfoileData['maritalStatus']
|
||||||
.toString()),
|
.toString()),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
controller.updatField('maritalStatus');
|
controller.updatField(
|
||||||
|
'maritalStatus', TextInputType.name);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
@@ -178,7 +181,8 @@ class PassengerProfilePage extends StatelessWidget {
|
|||||||
subtitle: Text(controller.prfoileData['sosPhone']
|
subtitle: Text(controller.prfoileData['sosPhone']
|
||||||
.toString()),
|
.toString()),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await controller.updatField('sosPhone');
|
await controller.updatField(
|
||||||
|
'sosPhone', TextInputType.phone);
|
||||||
box.write(BoxName.sosPhonePassenger,
|
box.write(BoxName.sosPhonePassenger,
|
||||||
controller.prfoileData['sosPhone']);
|
controller.prfoileData['sosPhone']);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ dependencies:
|
|||||||
fl_chart: ^0.66.0
|
fl_chart: ^0.66.0
|
||||||
agora_rtc_engine: ^6.2.6
|
agora_rtc_engine: ^6.2.6
|
||||||
flutter_tts: ^3.8.5
|
flutter_tts: ^3.8.5
|
||||||
|
# zego_uikit_prebuilt_call: ^4.2.1
|
||||||
|
# zego_uikit_signaling_plugin: ^2.7.4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user