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';
|
||||||
@@ -38,7 +39,7 @@ class OrderRequestController extends GetxController {
|
|||||||
String driverId = box.read(BoxName.driverID).toString();
|
String driverId = box.read(BoxName.driverID).toString();
|
||||||
|
|
||||||
String customQuery = '''
|
String customQuery = '''
|
||||||
SELECT COUNT(*) AS count
|
SELECT COUNT(*) AS count
|
||||||
FROM ${TableName.driverOrdersRefuse}
|
FROM ${TableName.driverOrdersRefuse}
|
||||||
WHERE driver_id = '$driverId'
|
WHERE driver_id = '$driverId'
|
||||||
AND created_at LIKE '%$todayDay%'
|
AND created_at LIKE '%$todayDay%'
|
||||||
@@ -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,20 +216,25 @@ 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 {
|
||||||
FirebaseMessagesController()
|
if (controller
|
||||||
.sendNotificationToPassengerToken(
|
.calculateDistanseBetweenDriverAndPassengerLocation() <
|
||||||
'Hi ,I Arrive your site'
|
40) {
|
||||||
.tr,
|
FirebaseMessagesController()
|
||||||
'I Arrive your site'
|
.sendNotificationToPassengerToken(
|
||||||
.tr,
|
'Hi ,I Arrive your site'
|
||||||
controller
|
.tr,
|
||||||
.tokenPassenger,
|
'I Arrive your site'
|
||||||
[]);
|
.tr,
|
||||||
controller
|
controller
|
||||||
.startTimerToShowDriverWaitPassengerDuration();
|
.tokenPassenger,
|
||||||
controller.isArrivedSend =
|
[]);
|
||||||
false;
|
controller
|
||||||
|
.startTimerToShowDriverWaitPassengerDuration();
|
||||||
|
controller
|
||||||
|
.isArrivedSend =
|
||||||
|
false;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
: const SizedBox()
|
: const SizedBox()
|
||||||
],
|
],
|
||||||
@@ -259,21 +277,31 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
.tr,
|
.tr,
|
||||||
kolor: AppColor
|
kolor: AppColor
|
||||||
.deepPurpleAccent,
|
.deepPurpleAccent,
|
||||||
onPressed: () async {
|
onPressed: () {
|
||||||
FirebaseMessagesController()
|
Get.defaultDialog(
|
||||||
.sendNotificationToPassengerToken(
|
title:
|
||||||
'Driver Cancel Your Trip'
|
'Are you sure to cancel?'
|
||||||
.tr,
|
.tr,
|
||||||
'You will be pay the cost to driver or we will get it from you on next trip'
|
confirm:
|
||||||
.tr,
|
MyElevatedButton(
|
||||||
controller
|
title:
|
||||||
.tokenPassenger,
|
'Yes'.tr,
|
||||||
[]);
|
onPressed:
|
||||||
await controller
|
() async {
|
||||||
.addWaittingTimeCostFromPassengerToDriverWallet();
|
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||||
controller
|
'Driver Cancel Your Trip'
|
||||||
.isdriverWaitTimeEnd =
|
.tr,
|
||||||
false;
|
'You will be pay the cost to driver or we will get it from you on next trip'
|
||||||
|
.tr,
|
||||||
|
controller
|
||||||
|
.tokenPassenger,
|
||||||
|
[]);
|
||||||
|
await controller
|
||||||
|
.addWaittingTimeCostFromPassengerToDriverWallet();
|
||||||
|
controller
|
||||||
|
.isdriverWaitTimeEnd =
|
||||||
|
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,431 +15,476 @@ 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(
|
||||||
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
children: [
|
||||||
curve: Curves.easeInCirc,
|
Row(
|
||||||
onEnd: () {
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
controller.height = 250;
|
children: [
|
||||||
},
|
double.parse(box.read(BoxName.passengerWalletTotal)) <
|
||||||
height: controller.heightBottomSheetShown,
|
0 &&
|
||||||
duration: const Duration(seconds: 2),
|
controller.data.isNotEmpty
|
||||||
child: Column(
|
? Container(
|
||||||
children: [
|
decoration: AppStyle.boxDecoration.copyWith(
|
||||||
controller.data.isEmpty
|
color: AppColor.redColor.withOpacity(.5)),
|
||||||
? const SizedBox()
|
height: 50,
|
||||||
: Container(
|
width: Get.width * .94,
|
||||||
// width: Get.width * .9,
|
|
||||||
height: 100,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColor.secondaryColor,
|
|
||||||
boxShadow: [
|
|
||||||
const BoxShadow(
|
|
||||||
color: AppColor.accentColor,
|
|
||||||
offset: Offset(2, 2)),
|
|
||||||
BoxShadow(
|
|
||||||
color:
|
|
||||||
AppColor.accentColor.withOpacity(.4),
|
|
||||||
offset: const Offset(-2, -2))
|
|
||||||
],
|
|
||||||
borderRadius: const BorderRadius.all(
|
|
||||||
Radius.circular(15))),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: Get.width * .15,
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.symmetric(
|
||||||
child: Image.asset(
|
horizontal: 8),
|
||||||
'assets/images/jeep.png',
|
child: Text(
|
||||||
width: 50,
|
'Your trip cost is'.tr +
|
||||||
fit: BoxFit.fill,
|
' ${controller.totalCostPassenger.toStringAsFixed(2)} '
|
||||||
repeat: ImageRepeat.repeatX,
|
'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(),
|
||||||
SizedBox(
|
],
|
||||||
width: Get.width * .55,
|
),
|
||||||
child: Column(
|
const SizedBox(
|
||||||
crossAxisAlignment:
|
height: 5,
|
||||||
CrossAxisAlignment.start,
|
),
|
||||||
mainAxisAlignment:
|
AnimatedContainer(
|
||||||
MainAxisAlignment.spaceEvenly,
|
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||||
children: [
|
curve: Curves.easeInCirc,
|
||||||
Text(
|
onEnd: () {
|
||||||
controller.hours > 1
|
controller.height = 250;
|
||||||
? '${'Your Ride Duration is '.tr}${controller.hours} H and ${controller.minutes} m'
|
},
|
||||||
: '${'Your Ride Duration is '.tr} ${controller.minutes} m',
|
height: controller.heightBottomSheetShown,
|
||||||
style: AppStyle.subtitle,
|
duration: const Duration(seconds: 2),
|
||||||
),
|
child: Column(
|
||||||
// Text(
|
children: [
|
||||||
// '${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}',
|
controller.data.isEmpty
|
||||||
// style: AppStyle.subtitle,
|
? const SizedBox()
|
||||||
// ),
|
: Container(
|
||||||
Text(
|
// width: Get.width * .9,
|
||||||
'${'Your trip distance is'.tr} ${controller.distance.toStringAsFixed(2)} KM',
|
height: 100,
|
||||||
style: AppStyle.subtitle,
|
decoration: BoxDecoration(
|
||||||
)
|
color: AppColor.secondaryColor,
|
||||||
],
|
boxShadow: [
|
||||||
),
|
const BoxShadow(
|
||||||
),
|
color: AppColor.accentColor,
|
||||||
SizedBox(
|
offset: Offset(2, 2)),
|
||||||
width: Get.width * .2,
|
BoxShadow(
|
||||||
child: Padding(
|
color: AppColor.accentColor
|
||||||
padding: const EdgeInsets.only(
|
.withOpacity(.4),
|
||||||
right: 5, left: 5),
|
offset: const Offset(-2, -2))
|
||||||
child: Column(
|
],
|
||||||
crossAxisAlignment:
|
borderRadius: const BorderRadius.all(
|
||||||
CrossAxisAlignment.center,
|
Radius.circular(15))),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
SizedBox(
|
||||||
width: Get.width * .14,
|
width: Get.width * .15,
|
||||||
height: Get.height * .06,
|
child: Padding(
|
||||||
decoration: BoxDecoration(
|
padding: const EdgeInsets.all(8.0),
|
||||||
color: AppColor.secondaryColor,
|
child: Image.asset(
|
||||||
shape: BoxShape.rectangle,
|
'assets/images/jeep.png',
|
||||||
border: Border.all(
|
width: 50,
|
||||||
width: 2,
|
fit: BoxFit.fill,
|
||||||
color: AppColor.greenColor)),
|
repeat: ImageRepeat.repeatX,
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
|
||||||
style: AppStyle.subtitle,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
controller.promoTaken
|
SizedBox(
|
||||||
? const Icon(
|
width: Get.width * .55,
|
||||||
Icons.filter_vintage_rounded,
|
child: Column(
|
||||||
color: AppColor.redColor,
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
controller.hours > 1
|
||||||
|
? '${'Your Ride Duration is '.tr}${controller.hours} H and ${controller.minutes} m'
|
||||||
|
: '${'Your Ride Duration is '.tr} ${controller.minutes} m',
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
),
|
||||||
|
// Text(
|
||||||
|
// '${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}',
|
||||||
|
// style: AppStyle.subtitle,
|
||||||
|
// ),
|
||||||
|
Text(
|
||||||
|
'${'Your trip distance is'.tr} ${controller.distance.toStringAsFixed(2)} KM',
|
||||||
|
style: AppStyle.subtitle,
|
||||||
)
|
)
|
||||||
: const SizedBox(
|
],
|
||||||
height: 0,
|
),
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
const SizedBox(
|
|
||||||
height: 5,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
// height: 130,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColor.secondaryColor,
|
|
||||||
boxShadow: [
|
|
||||||
const BoxShadow(
|
|
||||||
color: AppColor.accentColor,
|
|
||||||
offset: Offset(2, 2)),
|
|
||||||
BoxShadow(
|
|
||||||
color: AppColor.accentColor.withOpacity(.4),
|
|
||||||
offset: const Offset(-2, -2))
|
|
||||||
],
|
|
||||||
borderRadius:
|
|
||||||
const BorderRadius.all(Radius.circular(15))),
|
|
||||||
child: controller.data.isEmpty
|
|
||||||
? const SizedBox()
|
|
||||||
: Center(
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 5),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
const Icon(
|
|
||||||
Icons.location_on,
|
|
||||||
color: AppColor.redColor,
|
|
||||||
),
|
),
|
||||||
const SizedBox(
|
SizedBox(
|
||||||
width: 10,
|
width: Get.width * .2,
|
||||||
),
|
child: Padding(
|
||||||
Text(
|
padding: const EdgeInsets.only(
|
||||||
'From : '.tr,
|
right: 5, left: 5),
|
||||||
style: AppStyle.subtitle,
|
child: Column(
|
||||||
),
|
crossAxisAlignment:
|
||||||
Text(
|
CrossAxisAlignment.center,
|
||||||
controller.data[0]['start_address']
|
|
||||||
.toString(),
|
|
||||||
style: AppStyle.subtitle,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
const Icon(
|
|
||||||
Icons.location_searching_rounded),
|
|
||||||
const SizedBox(
|
|
||||||
width: 10,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'To : '.tr,
|
|
||||||
style: AppStyle.subtitle,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
controller.data[0]['end_address'],
|
|
||||||
style: AppStyle.subtitle,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const Divider(
|
|
||||||
color: AppColor.accentColor,
|
|
||||||
thickness: 1,
|
|
||||||
height: 2,
|
|
||||||
indent: 1,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 40,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColor.secondaryColor,
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(12),
|
|
||||||
// border: Border.all(),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Container(
|
||||||
Icons.monetization_on,
|
width: Get.width * .14,
|
||||||
color: Colors.green[400],
|
height: Get.height * .06,
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
InkWell(
|
color: AppColor
|
||||||
onTap: () async {
|
.secondaryColor,
|
||||||
controller
|
shape: BoxShape.rectangle,
|
||||||
.changeCashConfirmPageShown();
|
border: Border.all(
|
||||||
Get.find<
|
width: 2,
|
||||||
PaymentController>()
|
color: AppColor
|
||||||
.getPassengerWallet();
|
.greenColor)),
|
||||||
},
|
child: Center(
|
||||||
child: GetBuilder<
|
child: Text(
|
||||||
PaymentController>(
|
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
||||||
builder:
|
style: AppStyle.subtitle,
|
||||||
(paymentController) =>
|
),
|
||||||
paymentController
|
|
||||||
.isCashChecked
|
|
||||||
? Text(
|
|
||||||
'CASH',
|
|
||||||
style: AppStyle
|
|
||||||
.title,
|
|
||||||
)
|
|
||||||
: Text(
|
|
||||||
'${AppInformation.appName} Wallet',
|
|
||||||
style: AppStyle
|
|
||||||
.title,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
controller.promoTaken
|
||||||
|
? const Icon(
|
||||||
|
Icons
|
||||||
|
.filter_vintage_rounded,
|
||||||
|
color:
|
||||||
|
AppColor.redColor,
|
||||||
|
)
|
||||||
|
: const SizedBox(
|
||||||
|
height: 0,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
),
|
||||||
width: 40,
|
],
|
||||||
),
|
)),
|
||||||
GetBuilder<PaymentController>(
|
const SizedBox(
|
||||||
builder:
|
height: 5,
|
||||||
(paymentController) =>
|
),
|
||||||
Container(
|
Container(
|
||||||
decoration:
|
// height: 130,
|
||||||
BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor
|
color: AppColor.secondaryColor,
|
||||||
.secondaryColor,
|
boxShadow: [
|
||||||
borderRadius:
|
const BoxShadow(
|
||||||
BorderRadius
|
color: AppColor.accentColor,
|
||||||
.circular(12),
|
offset: Offset(2, 2)),
|
||||||
),
|
BoxShadow(
|
||||||
child: Row(
|
color: AppColor.accentColor
|
||||||
children: [
|
.withOpacity(.4),
|
||||||
Icon(
|
offset: const Offset(-2, -2))
|
||||||
Icons
|
],
|
||||||
.qr_code_2_rounded,
|
borderRadius: const BorderRadius.all(
|
||||||
color: Colors
|
Radius.circular(15))),
|
||||||
.green[400],
|
child: controller.data.isEmpty
|
||||||
),
|
? const SizedBox()
|
||||||
InkWell(
|
: Center(
|
||||||
onTap: () {
|
child: Padding(
|
||||||
if (controller
|
padding: const EdgeInsets.symmetric(
|
||||||
.promoTaken ==
|
horizontal: 5),
|
||||||
false) {
|
child: Column(
|
||||||
Get.defaultDialog(
|
children: [
|
||||||
title: 'Add Promo'.tr,
|
Row(
|
||||||
content: Column(
|
children: [
|
||||||
children: [
|
const Icon(
|
||||||
SizedBox(
|
Icons.location_on,
|
||||||
width:
|
color: AppColor.redColor,
|
||||||
Get.width * .7,
|
),
|
||||||
child:
|
const SizedBox(
|
||||||
TextFormField(
|
width: 10,
|
||||||
controller: controller.promo,
|
),
|
||||||
decoration: InputDecoration(
|
Text(
|
||||||
labelText: 'Promo Code'.tr,
|
'From : '.tr,
|
||||||
hintText: 'Enter promo code'.tr,
|
style: AppStyle.subtitle,
|
||||||
border: OutlineInputBorder(
|
),
|
||||||
borderRadius: BorderRadius.circular(10),
|
Text(
|
||||||
),
|
controller.data[0]
|
||||||
filled: true,
|
['start_address']
|
||||||
fillColor: Colors.grey[200],
|
.toString(),
|
||||||
focusedBorder: OutlineInputBorder(
|
style: AppStyle.subtitle,
|
||||||
borderSide: const BorderSide(
|
|
||||||
color: AppColor.primaryColor,
|
|
||||||
width: 2.0,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: const BorderSide(
|
|
||||||
color: Colors.red,
|
|
||||||
width: 2.0,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderSide: const BorderSide(
|
|
||||||
color: Colors.grey,
|
|
||||||
width: 1.0,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
MyElevatedButton(
|
|
||||||
title:
|
|
||||||
'Add Promo'.tr,
|
|
||||||
onPressed:
|
|
||||||
() async {
|
|
||||||
controller.applyPromoCodeToPassenger();
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
));
|
|
||||||
} else {
|
|
||||||
Get.snackbar(
|
|
||||||
'You have promo!'
|
|
||||||
.tr,
|
|
||||||
'',
|
|
||||||
backgroundColor:
|
|
||||||
AppColor
|
|
||||||
.redColor);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
'Add Promo'.tr,
|
|
||||||
style: AppStyle
|
|
||||||
.title,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: Get.width * .95,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
controller.isCashSelectedBeforeConfirmRide ==
|
|
||||||
false
|
|
||||||
? MyElevatedButton(
|
|
||||||
title: 'Next'.tr,
|
|
||||||
onPressed: () {
|
|
||||||
controller
|
|
||||||
.changeCashConfirmPageShown();
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
: controller.isPassengerChosen ==
|
],
|
||||||
false
|
),
|
||||||
? MyElevatedButton(
|
Row(
|
||||||
title: 'Next'.tr,
|
children: [
|
||||||
onPressed: () {
|
const Icon(Icons
|
||||||
controller
|
.location_searching_rounded),
|
||||||
.onChangedPassengersChoose();
|
const SizedBox(
|
||||||
Get.defaultDialog(
|
width: 10,
|
||||||
barrierDismissible:
|
),
|
||||||
false,
|
Text(
|
||||||
title:
|
'To : '.tr,
|
||||||
'How Many Passengers?'
|
style: AppStyle.subtitle,
|
||||||
.tr,
|
),
|
||||||
titleStyle:
|
Text(
|
||||||
AppStyle.title,
|
controller.data[0]
|
||||||
content: Column(
|
['end_address'],
|
||||||
children: [
|
style: AppStyle.subtitle,
|
||||||
Text(
|
),
|
||||||
'Allowed up to 4 Passengers.'
|
],
|
||||||
.tr,
|
),
|
||||||
style: AppStyle
|
const Divider(
|
||||||
.title,
|
color: AppColor.accentColor,
|
||||||
),
|
thickness: 1,
|
||||||
SizedBox(
|
height: 2,
|
||||||
height:
|
indent: 1,
|
||||||
200, // Set the desired height here
|
),
|
||||||
child:
|
SizedBox(
|
||||||
CupertinoPicker(
|
height: 40,
|
||||||
itemExtent:
|
child: Row(
|
||||||
32,
|
mainAxisAlignment:
|
||||||
onSelectedItemChanged:
|
MainAxisAlignment.center,
|
||||||
(index) {
|
children: [
|
||||||
controller.onChangedPassengerCount(
|
Container(
|
||||||
index +
|
decoration: BoxDecoration(
|
||||||
1);
|
color: AppColor
|
||||||
},
|
.secondaryColor,
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(
|
||||||
|
12),
|
||||||
|
// border: Border.all(),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.monetization_on,
|
||||||
|
color:
|
||||||
|
Colors.green[400],
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
controller
|
||||||
|
.changeCashConfirmPageShown();
|
||||||
|
Get.find<
|
||||||
|
PaymentController>()
|
||||||
|
.getPassengerWallet();
|
||||||
|
},
|
||||||
|
child: GetBuilder<
|
||||||
|
PaymentController>(
|
||||||
|
builder: (paymentController) =>
|
||||||
|
paymentController
|
||||||
|
.isCashChecked
|
||||||
|
? Text(
|
||||||
|
'CASH',
|
||||||
|
style: AppStyle
|
||||||
|
.title,
|
||||||
|
)
|
||||||
|
: Text(
|
||||||
|
'${AppInformation.appName} Wallet',
|
||||||
|
style: AppStyle
|
||||||
|
.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 40,
|
||||||
|
),
|
||||||
|
GetBuilder<PaymentController>(
|
||||||
|
builder:
|
||||||
|
(paymentController) =>
|
||||||
|
Container(
|
||||||
|
decoration:
|
||||||
|
BoxDecoration(
|
||||||
|
color: AppColor
|
||||||
|
.secondaryColor,
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius
|
||||||
|
.circular(
|
||||||
|
12),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text('1 Passenger'
|
Icon(
|
||||||
.tr),
|
Icons
|
||||||
Text('2 Passengers'
|
.qr_code_2_rounded,
|
||||||
.tr),
|
color: Colors
|
||||||
Text('3 Passengers'
|
.green[
|
||||||
.tr),
|
400],
|
||||||
Text('4 Passengers'
|
),
|
||||||
.tr),
|
InkWell(
|
||||||
|
onTap:
|
||||||
|
() {
|
||||||
|
if (controller.promoTaken ==
|
||||||
|
false) {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Add Promo'.tr,
|
||||||
|
content: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: Get.width * .7,
|
||||||
|
child: TextFormField(
|
||||||
|
controller: controller.promo,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Promo Code'.tr,
|
||||||
|
hintText: 'Enter promo code'.tr,
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.grey[200],
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
color: AppColor.primaryColor,
|
||||||
|
width: 2.0,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
errorBorder: OutlineInputBorder(
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
color: Colors.red,
|
||||||
|
width: 2.0,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
color: Colors.grey,
|
||||||
|
width: 1.0,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Add Promo'.tr,
|
||||||
|
onPressed: () async {
|
||||||
|
controller.applyPromoCodeToPassenger();
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
Get.snackbar(
|
||||||
|
'You have promo!'.tr,
|
||||||
|
'',
|
||||||
|
backgroundColor: AppColor.redColor);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child:
|
||||||
|
Text(
|
||||||
|
'Add Promo'
|
||||||
|
.tr,
|
||||||
|
style: AppStyle
|
||||||
|
.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
)),
|
||||||
MyElevatedButton(
|
],
|
||||||
title: 'Back',
|
),
|
||||||
onPressed: () =>
|
),
|
||||||
Get.back(),
|
SizedBox(
|
||||||
)
|
width: Get.width * .95,
|
||||||
],
|
child: Row(
|
||||||
),
|
mainAxisAlignment:
|
||||||
);
|
MainAxisAlignment.center,
|
||||||
},
|
children: [
|
||||||
)
|
controller.isCashSelectedBeforeConfirmRide ==
|
||||||
: MyElevatedButton(
|
false
|
||||||
title: 'Confirm Selection'
|
? MyElevatedButton(
|
||||||
.tr,
|
title: 'Next'.tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
controller
|
controller
|
||||||
.changeConfirmRide();
|
.changeCashConfirmPageShown();
|
||||||
},
|
},
|
||||||
),
|
)
|
||||||
],
|
: controller.isPassengerChosen ==
|
||||||
|
false
|
||||||
|
? MyElevatedButton(
|
||||||
|
title: 'Next'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
controller
|
||||||
|
.onChangedPassengersChoose();
|
||||||
|
Get.defaultDialog(
|
||||||
|
barrierDismissible:
|
||||||
|
false,
|
||||||
|
title:
|
||||||
|
'How Many Passengers?'
|
||||||
|
.tr,
|
||||||
|
titleStyle:
|
||||||
|
AppStyle
|
||||||
|
.title,
|
||||||
|
content:
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Allowed up to 4 Passengers.'
|
||||||
|
.tr,
|
||||||
|
style: AppStyle
|
||||||
|
.title,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height:
|
||||||
|
200, // Set the desired height here
|
||||||
|
child:
|
||||||
|
CupertinoPicker(
|
||||||
|
itemExtent:
|
||||||
|
32,
|
||||||
|
onSelectedItemChanged:
|
||||||
|
(index) {
|
||||||
|
controller.onChangedPassengerCount(index +
|
||||||
|
1);
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
Text('1 Passenger'.tr),
|
||||||
|
Text('2 Passengers'.tr),
|
||||||
|
Text('3 Passengers'.tr),
|
||||||
|
Text('4 Passengers'.tr),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title:
|
||||||
|
'Back',
|
||||||
|
onPressed:
|
||||||
|
() =>
|
||||||
|
Get.back(),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: MyElevatedButton(
|
||||||
|
title:
|
||||||
|
'Confirm Selection'
|
||||||
|
.tr,
|
||||||
|
onPressed: () {
|
||||||
|
controller
|
||||||
|
.changeConfirmRide();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
)
|
),
|
||||||
: const SizedBox());
|
)
|
||||||
|
: const SizedBox());
|
||||||
}
|
}
|
||||||
|
|
||||||
class Details extends StatelessWidget {
|
class Details extends StatelessWidget {
|
||||||
@@ -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: () {
|
onPressed: () async {
|
||||||
if (box.read(BoxName.sosPhonePassenger).toString() ==
|
if (box.read(BoxName.sosPhonePassenger) == null) {
|
||||||
'') {
|
{
|
||||||
Get.defaultDialog(
|
await profileController.updatField(
|
||||||
title: 'You dont Add Emergency Phone Yet!'.tr,
|
'sosPhone', TextInputType.phone);
|
||||||
content: Column(
|
box.write(BoxName.sosPhonePassenger,
|
||||||
children: [
|
profileController.prfoileData['sosPhone']);
|
||||||
Form(
|
}
|
||||||
key: controller.sosFormKey,
|
// Get.defaultDialog(
|
||||||
child: TextFormField(
|
// title: 'You dont Add Emergency Phone Yet!'.tr,
|
||||||
keyboardType: TextInputType
|
// content: Column(
|
||||||
.phone, // Set the keyboard type to phone
|
// children: [
|
||||||
validator: (value) {
|
// Form(
|
||||||
if (value!.isEmpty ||
|
// key: controller.sosFormKey,
|
||||||
value.length != 10) {
|
// child: TextFormField(
|
||||||
return 'Please enter a valid phone number'
|
// keyboardType: TextInputType
|
||||||
.tr;
|
// .phone, // Set the keyboard type to phone
|
||||||
}
|
// controller:
|
||||||
// Add additional validation if needed
|
// controller.sosPhonePassengerProfile,
|
||||||
return null;
|
// validator: (value) {
|
||||||
},
|
// if (value!.isEmpty ||
|
||||||
decoration: const InputDecoration(
|
// value.length != 10) {
|
||||||
border: OutlineInputBorder(),
|
// return 'Please enter a valid phone number'
|
||||||
hintText: 'Type here',
|
// .tr;
|
||||||
),
|
// }
|
||||||
),
|
// // Add additional validation if needed
|
||||||
)
|
// return null;
|
||||||
],
|
// },
|
||||||
),
|
// decoration: const InputDecoration(
|
||||||
confirm: MyElevatedButton(
|
// border: OutlineInputBorder(),
|
||||||
title: 'Add Phone'.tr,
|
// hintText: 'Type here',
|
||||||
onPressed: () async {
|
// ),
|
||||||
await profileController
|
// ),
|
||||||
.updatField('sosPhone');
|
// )
|
||||||
box.write(
|
// ],
|
||||||
BoxName.sosPhonePassenger,
|
// ),
|
||||||
profileController
|
// confirm: MyElevatedButton(
|
||||||
.prfoileData['sosPhone']);
|
// 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: () {
|
onPressed: () async {
|
||||||
if (box.read(BoxName.sosPhonePassenger).toString() ==
|
print(box.read(BoxName.sosPhonePassenger));
|
||||||
'') {
|
if (box.read(BoxName.sosPhonePassenger) == null ||
|
||||||
Get.defaultDialog(
|
box.read(BoxName.sosPhonePassenger) == 'sos') {
|
||||||
title: 'You dont Add Emergency Phone Yet!'.tr,
|
{
|
||||||
content: Column(
|
await profileController.updatField(
|
||||||
children: [
|
'sosPhone', TextInputType.phone);
|
||||||
Form(
|
box.write(BoxName.sosPhonePassenger,
|
||||||
key: controller.sosFormKey,
|
profileController.prfoileData['sosPhone']);
|
||||||
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 {
|
|
||||||
await profileController
|
|
||||||
.updatField('sosPhone');
|
|
||||||
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