2/22/1
This commit is contained in:
5
.firebaserc
Normal file
5
.firebaserc
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"projects": {
|
||||
"default": "ride-b1bd8"
|
||||
}
|
||||
}
|
||||
25
.vscode/launch.json
vendored
Normal file
25
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Ride",
|
||||
"request": "launch",
|
||||
"type": "dart"
|
||||
},
|
||||
{
|
||||
"name": "Ride (profile mode)",
|
||||
"request": "launch",
|
||||
"type": "dart",
|
||||
"flutterMode": "profile"
|
||||
},
|
||||
{
|
||||
"name": "Ride (release mode)",
|
||||
"request": "launch",
|
||||
"type": "dart",
|
||||
"flutterMode": "release"
|
||||
}
|
||||
]
|
||||
}
|
||||
17
firebase.json
Normal file
17
firebase.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"functions": [
|
||||
{
|
||||
"source": "functions",
|
||||
"codebase": "default",
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
".git",
|
||||
"firebase-debug.log",
|
||||
"firebase-debug.*.log"
|
||||
],
|
||||
"predeploy": [
|
||||
"npm --prefix \"$RESOURCE_DIR\" run lint"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
28
functions/.eslintrc.js
Normal file
28
functions/.eslintrc.js
Normal file
@@ -0,0 +1,28 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
es6: true,
|
||||
node: true,
|
||||
},
|
||||
parserOptions: {
|
||||
"ecmaVersion": 2018,
|
||||
},
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"google",
|
||||
],
|
||||
rules: {
|
||||
"no-restricted-globals": ["error", "name", "length"],
|
||||
"prefer-arrow-callback": "error",
|
||||
"quotes": ["error", "double", {"allowTemplateLiterals": true}],
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ["**/*.spec.*"],
|
||||
env: {
|
||||
mocha: true,
|
||||
},
|
||||
rules: {},
|
||||
},
|
||||
],
|
||||
globals: {},
|
||||
};
|
||||
1
functions/.gitignore
vendored
Normal file
1
functions/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules/
|
||||
39
functions/index.js
Normal file
39
functions/index.js
Normal file
@@ -0,0 +1,39 @@
|
||||
const express = require("express");
|
||||
const {RtcTokenBuilder, RtcRole} = require("agora-access-token");
|
||||
const functions = require("firebase-functions");
|
||||
const admin = require("firebase-admin");
|
||||
|
||||
admin.initializeApp();
|
||||
|
||||
const app = express();
|
||||
|
||||
const port = 8080;
|
||||
const appId = "12994c6e707543e68d5638894d04f989";
|
||||
const appCertificate = "e21a388f83034a159f2783889a6d7bcf";
|
||||
|
||||
app.get("/token", (req, res) => {
|
||||
const channelName = req.query.channelName;
|
||||
if (!channelName) {
|
||||
return res.status(500).json({"error": "channelName is required"});
|
||||
}
|
||||
let uid = req.query.uid;
|
||||
if (!uid) {
|
||||
uid = 0;
|
||||
}
|
||||
let role = RtcRole.SUBSCRIBER;
|
||||
if (req.query.role == "publisher") {
|
||||
role = RtcRole.PUBLISHER;
|
||||
}
|
||||
let expireTime = req.query.expireTime;
|
||||
if (!expireTime || expireTime == "") {
|
||||
expireTime = parseInt(expireTime, 10);
|
||||
}
|
||||
const currentTime = Math.floor(Date.now() / 1000);
|
||||
const privilegeExpireTime = currentTime + expireTime;
|
||||
|
||||
const token = RtcTokenBuilder.buildTokenWithUid(appId, appCertificate, channelName, uid, role, privilegeExpireTime);
|
||||
|
||||
res.json({token});
|
||||
});
|
||||
|
||||
exports.rtcTokenServer = functions.https.onRequest(app);
|
||||
7677
functions/package-lock.json
generated
Normal file
7677
functions/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
29
functions/package.json
Normal file
29
functions/package.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "functions",
|
||||
"description": "Cloud Functions for Firebase",
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"serve": "firebase emulators:start --only functions",
|
||||
"shell": "firebase functions:shell",
|
||||
"start": "npm run shell",
|
||||
"deploy": "firebase deploy --only functions",
|
||||
"logs": "firebase functions:log"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18"
|
||||
},
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"agora-access-token": "^2.0.4",
|
||||
"express": "^4.18.2",
|
||||
"firebase": "^10.6.0",
|
||||
"firebase-admin": "^11.8.0",
|
||||
"firebase-functions": "^4.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.15.0",
|
||||
"eslint-config-google": "^0.14.0",
|
||||
"firebase-functions-test": "^3.1.0"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
@@ -127,6 +127,10 @@ class AppLink {
|
||||
static String addRateToPassenger = "$ride/rate/add.php";
|
||||
static String addRateToDriver = "$ride/rate/addRateToDriver.php";
|
||||
|
||||
////////////////emails ============//
|
||||
static String sendEmailToPassengerForTripDetails =
|
||||
"$ride/rate/emailToPassengerTripDetail.php";
|
||||
|
||||
// ===========================================
|
||||
static String pathImage = "$server/upload/types/";
|
||||
static String uploadImage = "$server/uploadImage.php";
|
||||
@@ -136,6 +140,8 @@ class AppLink {
|
||||
//==================certifcate==========
|
||||
static String location = '$server/ride/location';
|
||||
static String getCarsLocationByPassenger = "$location/get.php";
|
||||
static String getFemalDriverLocationByPassenger =
|
||||
"$location/getFemalDriver.php";
|
||||
static String getDriverCarsLocationToPassengerAfterApplied =
|
||||
"$location/getDriverCarsLocationToPassengerAfterApplied.php";
|
||||
static String addCarsLocationByPassenger = "$location/add.php";
|
||||
|
||||
@@ -10,9 +10,7 @@ import 'package:SEFER/controller/functions/crud.dart';
|
||||
import 'package:SEFER/controller/functions/secure_storage.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/auth/captin/verify_email_captain.dart';
|
||||
import 'package:SEFER/views/auth/verify_email_page.dart';
|
||||
import 'package:SEFER/views/home/Captin/home_captain/home_captin.dart';
|
||||
import 'package:SEFER/views/home/map_page_passenger.dart';
|
||||
|
||||
class LoginCaptinController extends GetxController {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
|
||||
@@ -13,7 +13,6 @@ import 'package:SEFER/views/auth/captin/verify_email_captain.dart';
|
||||
|
||||
import '../../../views/auth/captin/ai_page.dart';
|
||||
import '../../../views/auth/captin/car_license_page.dart';
|
||||
import '../../../views/auth/verify_email_page.dart';
|
||||
|
||||
class RegisterCaptainController extends GetxController {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
|
||||
@@ -31,7 +31,7 @@ class RegisterController extends GetxController {
|
||||
|
||||
getBirthDate() {
|
||||
Get.defaultDialog(
|
||||
title: 'Select Date',
|
||||
title: 'Select Date'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/credential.dart';
|
||||
import '../../constant/links.dart';
|
||||
import '../../main.dart';
|
||||
|
||||
@@ -35,7 +34,7 @@ class TokenController extends GetxController {
|
||||
var jsonToken = jsonDecode(res.body);
|
||||
// print(jsonToken);
|
||||
if (jsonToken['status'] == 'The token has been updated successfully.') {
|
||||
Get.snackbar('token updated', 'message');
|
||||
Get.snackbar('token updated'.tr, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:SEFER/controller/functions/crud.dart';
|
||||
@@ -18,10 +17,10 @@ import '../../main.dart';
|
||||
import '../../views/Rate/rate_captain.dart';
|
||||
import '../../views/home/Captin/home_captain/home_captin.dart';
|
||||
import '../../views/home/map_page_passenger.dart';
|
||||
import '../../views/home/map_widget.dart/call_passenger_page.dart';
|
||||
import '../../views/home/profile/promos_passenger_page.dart';
|
||||
import '../../views/home/Captin/orderCaptin/order_request_page.dart';
|
||||
import '../home/map_passenger_controller.dart';
|
||||
import '../home/payment/captain_wallet_controller.dart';
|
||||
import '../payment/payment_controller.dart';
|
||||
import 'local_notification.dart';
|
||||
|
||||
@@ -150,7 +149,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
driverID = myList[2].toString();
|
||||
|
||||
NotificationController().showNotification(
|
||||
'Apply Order', 'Driver Applied the Ride for You'.tr, 'order');
|
||||
'Apply Order'.tr, 'Driver Applied the Ride for You'.tr, 'order');
|
||||
// driverAppliedTripSnakBar();
|
||||
} else if (message.notification!.title! == 'Promo') {
|
||||
NotificationController()
|
||||
@@ -203,6 +202,19 @@ class FirebaseMessagesController extends GetxController {
|
||||
'rideId': driverList[1].toString(),
|
||||
});
|
||||
}
|
||||
} else if (message.notification!.title! == 'Call Income') {
|
||||
var myListString = message.data['passengerList'];
|
||||
var driverList = jsonDecode(myListString) as List<dynamic>;
|
||||
NotificationController().showNotification(
|
||||
'Driver Finish Trip'.tr,
|
||||
message.notification!.body!,
|
||||
'order',
|
||||
);
|
||||
Get.to(() => PassengerCallPage(
|
||||
channelName: driverList[1].toString(),
|
||||
token: driverList[0].toString(),
|
||||
remoteID: driverList[2].toString(),
|
||||
));
|
||||
} else if (message.notification!.title! == 'Driver Cancel Your Trip') {
|
||||
// Get.snackbar(
|
||||
// 'You will be pay the cost to driver or we will get it from you on next trip'
|
||||
@@ -222,7 +234,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
SnackbarController driverAppliedTripSnakBar() {
|
||||
return Get.snackbar(
|
||||
'Driver Applied the Ride for You'.tr,
|
||||
'message',
|
||||
'',
|
||||
colorText: AppColor.greenColor,
|
||||
duration: const Duration(seconds: 3),
|
||||
snackPosition: SnackPosition.TOP,
|
||||
@@ -302,7 +314,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
if (res != 'failure') {
|
||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
'You Have Tips',
|
||||
'${tip.toString()}\$ tips\nTotal is ${tip + (Get.find<MapPassengerController>().totalPassenger)}',
|
||||
'${'${tip.toString()}\$${' tips\nTotal is'.tr}'} ${tip + (Get.find<MapPassengerController>().totalPassenger)}',
|
||||
driverList[2].toString(),
|
||||
);
|
||||
}
|
||||
@@ -518,7 +530,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Your fee is ${Get.find<MapPassengerController>().totalPassenger.toStringAsFixed(2)}'),
|
||||
'${'Your fee is '.tr}${Get.find<MapPassengerController>().totalPassenger.toStringAsFixed(2)}'),
|
||||
Text('Do you want to pay Tips for this Driver'.tr),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
@@ -528,7 +540,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
box.write(BoxName.tipPercentage, '0.05');
|
||||
Toast.show(
|
||||
context,
|
||||
'Tip is ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
'${'Tip is '.tr}${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
AppColor.blueColor);
|
||||
},
|
||||
child: Container(
|
||||
@@ -546,7 +558,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
box.write(BoxName.tipPercentage, '0.10');
|
||||
Toast.show(
|
||||
context,
|
||||
'Tip is ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
'${'Tip is'.tr} ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
AppColor.blueColor);
|
||||
},
|
||||
child: Container(
|
||||
@@ -564,7 +576,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
box.write(BoxName.tipPercentage, '0.15');
|
||||
Toast.show(
|
||||
context,
|
||||
'Tip is ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
'${'Tip is'.tr} ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
AppColor.blueColor);
|
||||
},
|
||||
child: Container(
|
||||
@@ -582,7 +594,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
box.write(BoxName.tipPercentage, '0.20');
|
||||
Toast.show(
|
||||
context,
|
||||
'Tip is ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
'${'Tip is'.tr} ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
AppColor.blueColor);
|
||||
},
|
||||
child: Container(
|
||||
|
||||
@@ -5,7 +5,6 @@ import 'package:camera/camera.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_mlkit_text_recognition/google_mlkit_text_recognition.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/credential.dart';
|
||||
import 'package:SEFER/constant/links.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:path_provider/path_provider.dart' as path_provider;
|
||||
@@ -47,7 +46,7 @@ class CameraClassController extends GetxController {
|
||||
title: 'Camera Access Denied.'.tr,
|
||||
middleText: '',
|
||||
confirm:
|
||||
MyElevatedButton(title: 'Open Settings', onPressed: () {}),
|
||||
MyElevatedButton(title: 'Open Settings'.tr, onPressed: () {}),
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -72,7 +71,7 @@ class CameraClassController extends GetxController {
|
||||
await capturedImage.saveTo(imagePath);
|
||||
await uploadImage(File(capturedImage.path));
|
||||
|
||||
extractByAPI(AppLink.server + '/card_image/' + box.read(BoxName.driverID));
|
||||
extractByAPI('${AppLink.server}/card_image/' + box.read(BoxName.driverID));
|
||||
}
|
||||
|
||||
Future extractByAPI(String imgUrl) async {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:SEFER/env/env.dart';
|
||||
@@ -41,15 +43,17 @@ class CRUD {
|
||||
}
|
||||
}
|
||||
|
||||
Future<dynamic> getAgora({
|
||||
Future<dynamic> getAgoraToken({
|
||||
required String channelName,
|
||||
required String uid,
|
||||
}) async {
|
||||
var res = await http
|
||||
.get(Uri.parse('http://localhost:8080/token?channelName=$channelName'));
|
||||
var uid = box.read(BoxName.phone) ?? box.read(BoxName.phoneDriver);
|
||||
var res = await http.get(Uri.parse(
|
||||
'https://repulsive-pig-rugby-shirt.cyclic.app/token?channelName=$channelName'));
|
||||
|
||||
if (res.statusCode == 200) {
|
||||
var response = jsonDecode(res.body);
|
||||
print(await response.stream.bytesToString());
|
||||
print(await response);
|
||||
return response['token'];
|
||||
} else {
|
||||
print(res.reasonPhrase);
|
||||
|
||||
@@ -27,7 +27,7 @@ class LocationController extends GetxController {
|
||||
getLocation();
|
||||
// myLocation=getLocation();
|
||||
|
||||
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
||||
totalPoints = Get.put(CaptainWalletController()).totalPoints;
|
||||
}
|
||||
|
||||
void startLocationUpdates() async {
|
||||
@@ -36,7 +36,7 @@ class LocationController extends GetxController {
|
||||
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
||||
|
||||
// if (isActive) {
|
||||
if (double.parse(totalPoints) > -100) {
|
||||
if (double.parse(totalPoints) > -500) {
|
||||
print('total point is $totalPoints');
|
||||
await getLocation();
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class LogOutController extends GetxController {
|
||||
|
||||
Future deleteMyAccountDriver(String id) async {
|
||||
await CRUD().post(link: AppLink.removeUser, payload: {'id': id}).then(
|
||||
(value) => Get.snackbar('Deleted', 'Your Account is Deleted',
|
||||
(value) => Get.snackbar('Deleted'.tr, 'Your Account is Deleted',
|
||||
backgroundColor: AppColor.redColor));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import 'package:get/get.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:SEFER/constant/api_key.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/info.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
@@ -15,6 +14,7 @@ import 'package:SEFER/constant/table_names.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/links.dart';
|
||||
import '../auth/captin/register_captin_controller.dart';
|
||||
import 'launch.dart';
|
||||
@@ -382,16 +382,16 @@ class ScanDocumentsByApi extends GetxController {
|
||||
middleText: 'if you want help you can email us here'.tr,
|
||||
middleTextStyle: AppStyle.title,
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Thanks',
|
||||
title: 'Thanks'.tr,
|
||||
kolor: AppColor.greenColor,
|
||||
onPressed: () => Get.back(),
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Email Us',
|
||||
title: 'Email Us'.tr,
|
||||
kolor: AppColor.yellowColor, //
|
||||
onPressed: () {
|
||||
launchCommunication('email', 'support@mobile-app.store',
|
||||
'Hi ${AppInformation.appName}\nI cant register in your app in face detection ');
|
||||
'${'Hi'.tr} ${AppInformation.appName}\n${'I cant register in your app in face detection '.tr}');
|
||||
Get.back();
|
||||
},
|
||||
));
|
||||
@@ -461,8 +461,7 @@ class ScanDocumentsByApi extends GetxController {
|
||||
),
|
||||
res['data']['result'].toString() == 'Different'
|
||||
? Text(
|
||||
'Be sure for take accurate images please\nYou have $times from 3 times Take Attention'
|
||||
.tr,
|
||||
'${'Be sure for take accurate images please\nYou have'.tr} $times ${'from 3 times Take Attention'.tr}',
|
||||
style: AppStyle.title,
|
||||
)
|
||||
: Text(
|
||||
@@ -519,8 +518,7 @@ class ScanDocumentsByApi extends GetxController {
|
||||
'Authorization':
|
||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
||||
});
|
||||
request.fields['driverID'] =
|
||||
'bnbn'; // box.read(BoxName.driverID).toString();
|
||||
request.fields['driverID'] = box.read(BoxName.driverID).toString();
|
||||
|
||||
var response = await request.send();
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_tts/flutter_tts.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -20,7 +21,9 @@ class TextToSpeechController extends GetxController {
|
||||
|
||||
// Function to initialize TTS engine
|
||||
Future<void> initTts() async {
|
||||
await flutterTts.setLanguage('en-US'); // Set language
|
||||
String? lang =
|
||||
WidgetsBinding.instance.platformDispatcher.locale.countryCode;
|
||||
await flutterTts.setLanguage(lang!); //'en-US' Set language
|
||||
await flutterTts.setSpeechRate(0.5); // Adjust speech rate
|
||||
await flutterTts.setVolume(1.0); // Set volume
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class HelpController extends GetxController {
|
||||
titleStyle: AppStyle.title,
|
||||
middleText: '',
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Back',
|
||||
title: 'Back'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
Get.back();
|
||||
|
||||
@@ -56,7 +56,7 @@ class HomeCaptainController extends GetxController {
|
||||
|
||||
isActive = !isActive;
|
||||
if (isActive) {
|
||||
if (double.parse(totalPoints) > -100) {
|
||||
if (double.parse(totalPoints) > -500) {
|
||||
locationController.startLocationUpdates();
|
||||
activeStartTime = DateTime.now();
|
||||
activeTimer = Timer.periodic(const Duration(seconds: 1), (timer) {
|
||||
|
||||
@@ -44,6 +44,7 @@ class MapDriverController extends GetxController {
|
||||
late String step3;
|
||||
late String step4;
|
||||
late String passengerWalletBurc;
|
||||
late String timeOfOrder;
|
||||
late String duration;
|
||||
late String totalCost;
|
||||
late String distance;
|
||||
@@ -365,7 +366,7 @@ class MapDriverController extends GetxController {
|
||||
if (res != 'failure') {
|
||||
Get.snackbar(
|
||||
'You will get cost of your work for this trip'.tr,
|
||||
'you gain $cost \$ in your wallet',
|
||||
'${'you gain'.tr} $cost \$${' in your wallet'.tr}',
|
||||
backgroundColor: AppColor.deepPurpleAccent,
|
||||
);
|
||||
}
|
||||
@@ -733,6 +734,7 @@ class MapDriverController extends GetxController {
|
||||
step3 = Get.arguments['step3'];
|
||||
step4 = Get.arguments['step4'];
|
||||
passengerWalletBurc = Get.arguments['passengerWalletBurc'];
|
||||
timeOfOrder = Get.arguments['timeOfOrder'];
|
||||
|
||||
var coords = passengerLocation.split(',');
|
||||
var coordDestination = passengerDestination.split(',');
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/firebase/firbase_messge.dart';
|
||||
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:SEFER/views/home/Captin/home_captain/call_controller.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||
|
||||
import '../../../../constant/box_name.dart';
|
||||
import '../../../../main.dart';
|
||||
|
||||
class CallPage extends StatelessWidget {
|
||||
@@ -15,83 +16,83 @@ class CallPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text(''),
|
||||
),
|
||||
body: callPage());
|
||||
return MyScafolld(title: 'Call Page', isleading: true, body: [callPage()]);
|
||||
}
|
||||
}
|
||||
|
||||
GetBuilder<HomeCaptainController> callPage() {
|
||||
CallController callController = Get.put(CallController());
|
||||
Get.put(MapDriverController());
|
||||
callController.initAgoraFull();
|
||||
return GetBuilder<HomeCaptainController>(
|
||||
builder: (controller) => controller.isCallOn == false
|
||||
? Center(
|
||||
child: Container(
|
||||
height: 100,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
// FirebaseMessagesController()
|
||||
// .sendNotificationToPassengerToken(
|
||||
// 'Call Income'.tr,
|
||||
// 'You have call from driver ${box.read(BoxName.nameDriver)}',
|
||||
// // Get.find<MapDriverController>().tokenPassenger,
|
||||
// '',
|
||||
// [],
|
||||
// );
|
||||
await callController.initAgoraFull();
|
||||
callController.join();
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle, color: AppColor.greenColor),
|
||||
child: const Icon(
|
||||
Icons.phone,
|
||||
size: 35,
|
||||
color: AppColor.secondaryColor,
|
||||
)),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(callController.status),
|
||||
Text(
|
||||
'passenger name'), //Get.find<MapDriverController>().passengerId.toString()),
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Call End'.tr,
|
||||
'Call End',
|
||||
Get.find<MapDriverController>().tokenPassenger,
|
||||
[],
|
||||
);
|
||||
callController.leave();
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle, color: AppColor.redColor),
|
||||
child: const Icon(
|
||||
Icons.phone_disabled_sharp,
|
||||
size: 35,
|
||||
color: AppColor.secondaryColor,
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
// ignore: prefer_const_constructors
|
||||
builder: (controller) => Positioned(
|
||||
top: Get.height * .2,
|
||||
child: Container(
|
||||
height: 100, width: Get.width,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
// await callController.initAgoraFull();
|
||||
// callController.join();
|
||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
'Call Income',
|
||||
'You have call from driver ${box.read(BoxName.nameDriver)}',
|
||||
Get.find<MapDriverController>().tokenPassenger,
|
||||
[
|
||||
callController.token,
|
||||
callController.channelName,
|
||||
callController.uid.toString(),
|
||||
callController.remoteUid.toString(),
|
||||
],
|
||||
);
|
||||
callController.join();
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle, color: AppColor.greenColor),
|
||||
child: const Icon(
|
||||
Icons.phone,
|
||||
size: 35,
|
||||
color: AppColor.secondaryColor,
|
||||
)),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
Column(
|
||||
children: [
|
||||
Text(callController.status),
|
||||
Text(Get.find<MapDriverController>().name.toString()),
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
'Call End'.tr,
|
||||
'Call End',
|
||||
Get.find<MapDriverController>().tokenPassenger,
|
||||
[],
|
||||
);
|
||||
callController.leave();
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle, color: AppColor.redColor),
|
||||
child: const Icon(
|
||||
Icons.phone_disabled_sharp,
|
||||
size: 35,
|
||||
color: AppColor.secondaryColor,
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
// ignore: prefer_const_constructors
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -25,29 +25,29 @@ class ConnectWidget extends StatelessWidget {
|
||||
builder: (homeCaptainController) => int.parse(
|
||||
orderRequestController.countRefuse) >
|
||||
3 ||
|
||||
double.parse(captainWalletController.totalPoints) < -100
|
||||
double.parse(captainWalletController.totalPoints) < -500
|
||||
? CupertinoButton(
|
||||
onPressed: () {
|
||||
Get.defaultDialog(
|
||||
// backgroundColor: CupertinoColors.destructiveRed,
|
||||
barrierDismissible: false,
|
||||
title: double.parse(captainWalletController.totalPoints) <
|
||||
-100
|
||||
-500
|
||||
? 'You dont have Points'.tr
|
||||
: 'You Are Stopped For this Day !'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Text(
|
||||
double.parse(captainWalletController.totalPoints) < -100
|
||||
? 'You will be charge your Account'.tr
|
||||
double.parse(captainWalletController.totalPoints) < -500
|
||||
? 'You must be recharge your Account'.tr
|
||||
: 'You Refused 3 Rides this Day that is the reason \nSee you Tomorrow!'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
confirm:
|
||||
double.parse(captainWalletController.totalPoints) <
|
||||
-100
|
||||
-500
|
||||
? MyElevatedButton(
|
||||
title: 'Charge your Account'.tr,
|
||||
title: 'Recharge my Account'.tr,
|
||||
onPressed: () {
|
||||
homeCaptainController
|
||||
.goToWalletFromConnect();
|
||||
|
||||
@@ -432,7 +432,7 @@ class MapPassengerController extends GetxController {
|
||||
|
||||
// Format the message.
|
||||
String message =
|
||||
'Hi! This is ${box.read(BoxName.name)}.\n I am using ${box.read(AppInformation.appName)} to ride with $firstName as the driver. $firstName \nis driving a $model\n with license plate $licensePlate.\n I am currently located at $passengerLocation.\n If you need to reach me, please contact the driver directly at\n\n $driverPhone.';
|
||||
'${'${'Hi! This is'.tr} ${box.read(BoxName.name)}.\n${' I am using'.tr}'} ${box.read(AppInformation.appName)}${' to ride with'.tr} $firstName${' as the driver.'.tr} $firstName \n${'is driving a '.tr}$model\n${' with license plate '.tr}$licensePlate.\n${' I am currently located at '.tr}$passengerLocation.\n${' If you need to reach me, please contact the driver directly at'.tr}\n\n $driverPhone.';
|
||||
|
||||
// Launch the URL to send the SMS.
|
||||
launchCommunication('whatsapp', to, message);
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/links.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/functions/crud.dart';
|
||||
import 'package:SEFER/views/home/map_page_passenger.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
|
||||
class PromosController extends GetxController {
|
||||
|
||||
@@ -172,7 +172,7 @@ class MyTranslation extends Translations {
|
||||
" KM": " كيلومتر",
|
||||
"Duration of Trip is ": "مدة الرحلة هي ",
|
||||
" Minutes": " دقائق",
|
||||
"Apply Order": "تطبيق الطلب",
|
||||
"Apply Order": "قبول الطلب",
|
||||
"Refuse Order": "رفض الطلب",
|
||||
"Rate Captain": "تقييم الكابتن",
|
||||
"Enter your Note": "أدخل ملاحظتك",
|
||||
@@ -187,10 +187,387 @@ class MyTranslation extends Translations {
|
||||
"get_a_ride": "مع سفر، يمكنك الحصول على رحلة إلى وجهتك في دقائق.",
|
||||
"safe_and_comfortable": "استمتع برحلة آمنة ومريحة.",
|
||||
"committed_to_safety":
|
||||
"تلتزم سفر بالسلامة، ويتم فحص جميع قباطننا بعناية وفحص خلفيتهم."
|
||||
|
||||
///
|
||||
// 'Saved Sucssefully':
|
||||
"تلتزم سفر بالسلامة، ويتم فحص جميع قباطننا بعناية وفحص خلفيتهم.",
|
||||
"Driver Applied the Ride for You": "طلب السائق الرحلة لك",
|
||||
"Show latest promo": "اظهر آخر عرض ترويجي",
|
||||
"Cancel Trip": "إلغاء الرحلة",
|
||||
"Passenger Cancel Trip": "الراكب ألغى الرحلة",
|
||||
"Please stay on the picked point.":
|
||||
"الرجاء البقاء في النقطة المحددة.",
|
||||
"Trip is Begin": "بدء الرحلة",
|
||||
"Hi ,I will go now": "مرحبا، سأذهب الآن",
|
||||
"Passenger come to you": "الراكب في طريقه اليك",
|
||||
"Hi ,I Arrive your site": "مرحبا، وصلت مكانك",
|
||||
"Driver Finish Trip": "السائق انهى الرحلة",
|
||||
"you will pay to Driver": "ستدفع للسائق",
|
||||
"Driver Cancel Your Trip": "السائق ألغى رحلتك",
|
||||
"you will pay to Driver you will be pay the cost of driver time look to your SEFER Wallet":
|
||||
"ستدفع للسائق تكلفة وقته تفقد محفظتك في سيفر",
|
||||
"I will go now": "سأذهب الآن",
|
||||
"You Have Tips": "لديك زيادة مال",
|
||||
" tips\nTotal is": "زيادة مال\nالمجموع هو",
|
||||
"No,I want": "لا، أريد",
|
||||
"Your fee is ": "أجرك هو",
|
||||
"Do you want to pay Tips for this Driver":
|
||||
"هل تريد دفع زيادة مال لهذا السائق؟",
|
||||
"Tip is ": "زيادة المال هي",
|
||||
"Tip is": "زيادة المال هي",
|
||||
"Camera Access Denied.": "تم رفض الوصول إلى الكاميرا.",
|
||||
"Open Settings": "افتح الإعدادات",
|
||||
"GPS Required Allow !.": "تمكن الـ GPS مطلوب!",
|
||||
"Your Account is Deleted": "تم حذف حسابك",
|
||||
"Are you sure to delete your account?": "هل أنت متأكد من حذف حسابك؟",
|
||||
"Your data will be erased after 2 weeks\nAnd you will can't return to use app after 1 month ":
|
||||
"سيتم مسح بياناتك بعد أسبوعين\nولن تستطيع استخدام التطبيق مرة أخرى بعد شهر",
|
||||
"Enter Your First Name": "أدخل اسمك الأول",
|
||||
"Are you Sure to LogOut?": "هل أنت متأكد من تسجيل الخروج؟",
|
||||
"Email Wrong": "البريد الإلكتروني خاطئ",
|
||||
"Email you inserted is Wrong.": "البريد الإلكتروني الذي أدخلته خطأ.",
|
||||
"You have finished all times ": "لقد استنفذت كل المحاولات ",
|
||||
"if you want help you can email us here":
|
||||
"إذا كنت تريد المساعدة يمكنك إرسال بريد إلكتروني إلينا هنا",
|
||||
"Thanks": "شكرا",
|
||||
"Email Us": "ارسل لنا بريد الكتروني",
|
||||
"I cant register in your app in face detection ":
|
||||
"لا أستطيع التسجيل في تطبيقكم بسبب الكشف عن الوجه",
|
||||
"Hi": "مرحبا",
|
||||
"No face detected": "لم يتم الكشف عن أي وجه",
|
||||
"Image detecting result is ": "نتيجة الكشف عن الصورة هي",
|
||||
"from 3 times Take Attention": "من 3 محاولات انتبه",
|
||||
"Be sure for take accurate images please\nYou have":
|
||||
"الرجاء التأكد من التقاط صور دقيقة\nلديك",
|
||||
"image verified": "الصورة موثقة",
|
||||
"Next": "التالي",
|
||||
"There is no help Question here": "لا توجد أسئلة هنا",
|
||||
"Call End": "انتهاء المكالمة",
|
||||
"You dont have Points": "ليس لديك نقاط",
|
||||
"You Are Stopped For this Day !": "تم توقيفك لهذا اليوم!",
|
||||
"You must be charge your Account": "يجب اعاده شحن رصيد النقاط",
|
||||
"You Refused 3 Rides this Day that is the reason \nSee you Tomorrow!":
|
||||
"رفضت 3 رحلات هذا اليوم وهذا السبب\nلقائنا غدا!",
|
||||
'Recharge my Account': "ادفع رسوم من حسابي",
|
||||
"Ok , See you Tomorrow": "حسناً، لقائنا غداً",
|
||||
"You are Stopped": "تم توقيفك",
|
||||
"Connected": "متصل",
|
||||
"Not Connected": "غير متصل",
|
||||
"Your are far from passenger location": "أنت بعيد عن مكان الراكب",
|
||||
"go to your passenger location before\nPassenger cancel trip":
|
||||
"اذهب إلى مكان الراكب قبل أن\nيلغي الراكب الرحلة",
|
||||
"You will get cost of your work for this trip":
|
||||
"ستحصل على تكاليف عملك لهذه الرحلة",
|
||||
" in your wallet": "في محفظتك",
|
||||
"you gain": "ربحت",
|
||||
"Order Cancelled": "تم إلغاء الطلب",
|
||||
"Order Cancelled by Passenger": "تم إلغاء الطلب من قبل الراكب",
|
||||
"Success": "نجاح",
|
||||
"Feedback data saved successfully": "تم حفظ بيانات التعليقات بنجاح",
|
||||
"No Promo for today .": "لا يوجد عرض ترويجي اليوم.",
|
||||
"Select your destination": "اختر وجهتك",
|
||||
"Search for your Start point": "بحث عن نقطة بدايتك",
|
||||
"Search for waypoint": "بحث عن نقطة الوجهة",
|
||||
"Current Location": "الموقع الحالي",
|
||||
"Add Location 1": "إضافة الموقع 1",
|
||||
'You must Verify email !.': "يجب التحقق من البريد الإلكتروني!",
|
||||
'Cropper': "القاصة",
|
||||
'Saved Sucssefully': "تم الحفظ بنجاح",
|
||||
'Select Date': "اختر التاريخ",
|
||||
'Birth Date': "تاريخ الميلاد",
|
||||
'Ok': "موافق",
|
||||
'token updated': "تم تحديث الرمز",
|
||||
'Add Location 2': "إضافة الموقع 2",
|
||||
'Add Location 3': "إضافة الموقع 3",
|
||||
'Add Location 4': "إضافة الموقع 4",
|
||||
'Waiting for your location': "في انتظار موقعك",
|
||||
'Search for your destination': "بحث عن وجهتك",
|
||||
'Hi! This is': "مرحبا! هذا",
|
||||
' I am using': "أنا أستخدم",
|
||||
' to ride with': "للركوب مع",
|
||||
' as the driver.': "كسائق.",
|
||||
'is driving a ': "يقود",
|
||||
' with license plate ': "بلوحة ترخيص",
|
||||
' I am currently located at ': "أنا حاليا في",
|
||||
' If you need to reach me, please contact the driver directly at':
|
||||
"إذا كنت تحتاج إلى التواصل معي، يرجى التواصل مع السائق مباشرة على",
|
||||
'No Car or Driver Found in your area.':
|
||||
"لم يتم العثور على سيارة أو سائق في منطقتك.",
|
||||
'Please Try anther time ': "الرجاء إعادة المحاولة",
|
||||
'There no Driver Aplly your order sorry for that ':
|
||||
"لا يوجد سائق قدم طلبك، نعتذر عن ذلك",
|
||||
'Trip Cancelled': "تم إلغاء الرحلة",
|
||||
'The Driver Will be in your location soon .':
|
||||
"سيكون السائق قريبا في موقعك.",
|
||||
'The distance less than 500 meter.': "المسافة أقل من 500 متر.",
|
||||
'Promo End !': "انتهاء العرض!",
|
||||
'There is no notification yet': "لا توجد إشعارات بعد",
|
||||
'Use Touch ID or Face ID to confirm payment':
|
||||
"استخدم Touch ID أو Face ID لتأكيد الدفع",
|
||||
"Contact us for any questions on your order.":
|
||||
"تواصل معنا لأي استفسارات حول طلبك.",
|
||||
'Pyament Cancelled .': "تم إلغاء الدفع.",
|
||||
'type here': "اكتب هنا",
|
||||
'Scan Driver License': "استخراج رخصة القيادة",
|
||||
'Please put your licence in these border':
|
||||
"الرجاء وضع رخصتك ضمن هذا الحدود",
|
||||
'Camera not initialized yet': "الكاميرا لم تُثبت بعد",
|
||||
'Take Image': "إلتقاط الصورة",
|
||||
'AI Page': "صفحة الذكاء الاصطناعي",
|
||||
'Take Picture Of ID Card': "إلتقاط صورة لبطاقة الهوية",
|
||||
'Take Picture Of Driver License Card':
|
||||
"إلتقاط صورة لبطاقة رخصة القيادة",
|
||||
'We are process picture please wait ':
|
||||
"نقوم بمعالجة الصورة الرجاء الإنتظار",
|
||||
'There is no data yet.': "لا توجد بيانات بعد.",
|
||||
'Name :': "الإسم:",
|
||||
'Drivers License Class: ': "فئة رخصة القيادة:",
|
||||
'Document Number: ': "رقم المستند:",
|
||||
'Address: ': "العنوان:",
|
||||
'Height: ': "الطول:",
|
||||
'Expiry Date: ': "تاريخ الإنتهاء:",
|
||||
'Date of Birth: ': "تاريخ الميلاد:",
|
||||
'You can\'t continue with us .\nYou should renew Driver license':
|
||||
"لايمكنك الإستمرار معنا. يجب تجديد رخصة القيادة",
|
||||
'Detect Your Face ': "الكشف عن وجهك",
|
||||
'Go to next step\nscan Car License.':
|
||||
"إذهب إلى الخطوة التالية\nاستخراج رخصة السيارة.",
|
||||
'Name in arabic': "الإسم باللغة العربية",
|
||||
'Drivers License Class': "فئة رخصة القيادة",
|
||||
'National Number': "الرقم القومي",
|
||||
'Address': "العنوان",
|
||||
'Date of Birth': "تاريخ الميلاد",
|
||||
'Age': "العمر",
|
||||
'Expiry Date': "تاريخ الإنتهاء",
|
||||
'Lets check Car license ': "دعونا نتحقق من رخصة السيارة ",
|
||||
'Color': "اللون",
|
||||
'Car Kind': "نوع السيارة",
|
||||
'Year': "السنة",
|
||||
'Car Plate': "لوحة السيارة",
|
||||
'Lets check License Back Face': "دعونا نتحقق من الوجه الخلفي للرخصة",
|
||||
'Car License Card': "بطاقة رخصة السيارة",
|
||||
'No image selected yet': "لم يتم إختيار أي صورة بعد",
|
||||
'Made :': "الصناعة:",
|
||||
'model :': "النموذج:",
|
||||
'VIN :': "رقم الشاصي:",
|
||||
'year :': "السنة:",
|
||||
'Login Driver': "تسجيل دخول السائق",
|
||||
'Password must br at least 6 character.':
|
||||
"كلمة المرور يجب أن تكون على الأقل 6 أحرف.",
|
||||
'if you don\'t have account': "إذا لم يكن لديك حساب",
|
||||
'Register as Driver': "التسجيل كسائق",
|
||||
'Privacy Notice': "إخطار الخصوصية",
|
||||
'By selecting "I Agree" below, I have reviewed and agree to the Terms of Use and acknowledge the ':
|
||||
"بإختياري' أوافق' أدناه، قمت بمراجعة والموافقة على شروط الإستخدام والإعتراف بـ",
|
||||
'. I am at least 18 years of age.':
|
||||
". أنا بالغ عمري على الأقل 18 سنة.",
|
||||
'Log Out Page': "صفحة تسجيل الخروج",
|
||||
'Log Off': "تسجيل الخروج",
|
||||
'Register Driver': "تسجيل سائق جديد",
|
||||
'Verify Email For Driver': "التحقق من البريد الإلكتروني للسائق",
|
||||
'Admin DashBoard': "لوحة تحكم المدير",
|
||||
'Your name': "إسمك",
|
||||
'Your password': "كلمة المرور الخاصة بك",
|
||||
'title': "العنوان",
|
||||
'If You Want be Driver Click Here.':
|
||||
"إذا كنت تريد أن تكون سائقًا انقر هنا.",
|
||||
'Enter your City': "أدخل مدينتك",
|
||||
'History Page': "صفحة التاريخ",
|
||||
'This Trip Cancelled': "تم إلغاء هذه الرحلة",
|
||||
'Trip Detail': "تفاصيل الرحلة",
|
||||
'Trip on Map Click here': "ضغط هنا لعرض الرحلة على الخريطة",
|
||||
'Order ID': "رقم الطلب",
|
||||
'Price is': "السعر هو",
|
||||
'Distance is': "المسافة هي",
|
||||
'Times of Trip': "أوقات الرحلة",
|
||||
'Time to Passenger is': "وقت التحرك هو ",
|
||||
'TimeStart is': "وقت البداية هو",
|
||||
'Time Finish is': "وقت الإنتهاء هو",
|
||||
'Passenger Name is': "إسم الراكب هو",
|
||||
'Status is': "الحالة هي",
|
||||
'Call Income': "مكالمة واردة",
|
||||
'You have call from driver': "لديك مكالمة من السائق",
|
||||
'joined': "انضم",
|
||||
'Call left': "مكالمة خارجة",
|
||||
'Wallet': "المحفظة",
|
||||
'History of Trip': "تاريخ الرحلات",
|
||||
'Helping Center': "مركز المساعدة",
|
||||
'Voice Calling': "الإتصال الصوتي",
|
||||
'Helping Page': "صفحة المساعدة",
|
||||
'If you need any help or have question this is right site to do that and your welcome':
|
||||
"إذا كنت تحتاج أي مساعدة أو لديك أسئلة هذه الصفحة المكان المناسب لذلك وأهلاً بك",
|
||||
'Enter your Question here': "أدخل سؤالك هنا",
|
||||
'Question': "السؤال",
|
||||
'Submit Question': "طرح السؤال",
|
||||
'Please enter your Question.': "الرجاء إدخال سؤالك.",
|
||||
'Help Details': "تفاصيل المساعدة",
|
||||
'No Response yet.': "لا يوجد رد بعد.",
|
||||
' You Earn today is ': " ما حصلت عليه اليوم هو",
|
||||
' You Have in': "لديك في",
|
||||
'Total points is ': "إجمالي النقاط هو",
|
||||
'Total Connection Duration:': "إجمالي مدة الإتصال:",
|
||||
' H and': "ساعة و",
|
||||
'm': "دقيقة",
|
||||
'Hello this is Driver': "مرحبا هذا السائق",
|
||||
'Is the Passenger in your Car ?': "هل الراكب في سيارتك؟",
|
||||
'don\'t start trip if not ': "لا تبدأ الرحلة إذا لم يكن",
|
||||
'No ,still Waiting.': "لا، مازالت في الإنتظار.",
|
||||
'I arrive you': "وصلت إليك",
|
||||
'I Arrive your site': "وصلت إلى موقعك",
|
||||
'You are not in near to passenger location':
|
||||
"أنت غير قريب من موقع الراكب",
|
||||
'please go to picker location exactly':
|
||||
"الرجاء الذهاب إلى موقع الراكب بالضبط",
|
||||
'You Can Cancel Trip And get Cost of Trip From':
|
||||
"يمكنك إلغاء الرحلة والحصول على تكلفتها من",
|
||||
'Are you sure to cancel?': "هل أنت متأكد من الإلغاء؟",
|
||||
'Yes': 'نعم',
|
||||
'Insert Emergincy Number': "أدخل رقم الطوارئ",
|
||||
'Insert': "إدراج",
|
||||
" My current location is:": "موقعي الحالي هو:",
|
||||
" \nand I have a trip on": "\nولدي رحلة على",
|
||||
"App \nwith Passenger ": "التطبيق\nمع الراكب ",
|
||||
'You will be pay the cost to driver or we will get it from you on next trip':
|
||||
"ستدفع التكلفة للسائق أو سنحصل عليها منك في الرحلة القادمة",
|
||||
'Trip has Steps': "الرحلة تتكون من خطوات",
|
||||
'Distance from Passenger to destination is ':
|
||||
"المسافة من الراكب إلى الوجهة هي ",
|
||||
'Cost Of Trip IS ': "تكلفة الرحلة هي ",
|
||||
'Accept Order': "قبول الطلب",
|
||||
'rejct your order.': "رفض طلبك.",
|
||||
'Bottom Bar Example': "مثال لشريط الأسفل",
|
||||
'Statistics': "الإحصائيات",
|
||||
'Scan Id': "مسح الهوية",
|
||||
'Camera not initilaized yet': "الكاميرا لم تُثبت بعد",
|
||||
'Scan ID MklGoogle': "مسح هوية MklGoogle",
|
||||
'Language': "اللغة",
|
||||
'Your trip cost is': "تكلفة رحلتك هي",
|
||||
'But you have a negative salary of': "لكن لديك راتب سلبي بقيمة",
|
||||
' in your': "في",
|
||||
' wallet due to a previous trip.': "المحفظة بسبب رحلة سابقة.",
|
||||
'Promo Code': "كود ترويجي",
|
||||
'Your trip distance is': "مسافة رحلتك هي",
|
||||
'Enter promo code': "أدخل كود ترويجي",
|
||||
'You have promo!': "لديك عرض ترويجي!",
|
||||
'Cost Duration': "تكلفة المدة",
|
||||
'Duration is': "المدة هي",
|
||||
'Leave': "مغادرة",
|
||||
'Join': "الانضمام",
|
||||
'You Should be select reason.': "يجب أن تختار السبب.",
|
||||
' \$': " دينار ",
|
||||
'Waiting for Driver ...': "في انتظار السائق...",
|
||||
'Latest Recent Trip': "آخر رحلة حديثة",
|
||||
'from your list': "من قائمتك",
|
||||
'Do you want to change Work location': "هل تريد تغيير موقع العمل؟",
|
||||
'Do you want to change Home location': "هل تريد تغيير موقع المنزل؟",
|
||||
'We Are Sorry That we dont have cars in your Location!':
|
||||
"نعتذر لعدم وجود سيارات في موقعك!",
|
||||
'Choose from Map': "اختر من الخريطة",
|
||||
'To Work': "إلى العمل",
|
||||
'Work Saved': "تم حفظ العمل",
|
||||
'To Home': "إلى المنزل",
|
||||
'Home Saved': "تم حفظ المنزل",
|
||||
"Click here point": "انقر هنا نقطة",
|
||||
'No Car in your site. Sorry!': "لا توجد سيارة في موقعك. آسف!",
|
||||
'Nearest Car for you about ': "أقرب سيارة لك حوالي ",
|
||||
'N/A': "غير متوفر",
|
||||
'From :': "من:",
|
||||
'Get Details of Trip': "الحصول على تفاصيل الرحلة",
|
||||
"If you want add stop click here": "إذا أردت إضافة وقفة انقر هنا",
|
||||
'Driver': "السائق",
|
||||
"Where you want go ": "إلى أين تريد الذهاب ",
|
||||
'My Card': "بطاقتي",
|
||||
'Card Number': "رقم البطاقة",
|
||||
'Hi, Where to ': "مرحبا، إلى أين ",
|
||||
"Pick your destination from Map": "حدد وجهتك من الخريطة",
|
||||
'Add Stops': "إضافة المحطات",
|
||||
'Get Direction': "الحصول على الإرشادات",
|
||||
'Add Location': "إضافة الموقع",
|
||||
"Switch Rider": "تبديل الراكب",
|
||||
'You will arrive to your destination after timer end.':
|
||||
"سوف تصل إلى وجهتك بعد انتهاء العداد.",
|
||||
'You can cancel trip': "يمكنك إلغاء الرحلة",
|
||||
'The driver waitting you in picked location .':
|
||||
"السائق ينتظرك في الموقع المحدد.",
|
||||
'10\$ and get 3% discount': "10 دينار والحصول على خصم 3%",
|
||||
'20\$ and get 4% discount': "20 دينار والحصول على خصم 4%",
|
||||
'40\$ and get 6% discount': "40 دينار والحصول على خصم 6%",
|
||||
'100\$ and get 9% discount': "100 دولار والحصول على خصم 9%",
|
||||
'Pay with Your': "الدفع باستخدام",
|
||||
'Pay with Credit Card': "الدفع ببطاقة ائتمان",
|
||||
'Payment History': "تاريخ المدفوعات",
|
||||
'Show Promos to Charge': "إظهار العروض للشحن",
|
||||
'Point': "نقطة",
|
||||
'Driver Wallet': "محفظة السائق",
|
||||
'Total Points is': "إجمالي النقاط هو",
|
||||
'Total Budget from trips is ': "إجمالي الميزانية من الرحلات هو ",
|
||||
'Total Amount:': "المبلغ الإجمالي:",
|
||||
'Total Budget from trips by\nCredit card is ':
|
||||
"الميزانية الإجمالية من الرحلات باستخدام\nبطاقة الائتمان هي ",
|
||||
'This amount for all trip I get from Passengers':
|
||||
"هذا المبلغ الذي حصلت عليه من جميع الرحلات من الركاب",
|
||||
'Pay from my budget': "الدفع من ميزانيتي",
|
||||
'This amount for all trip I get from Passengers and Collected For me in':
|
||||
"هذا المبلغ الذي حصلت عليه من جميع الرحلات من الركاب وتم جمعه لي في",
|
||||
'You can buy points from your budget': "يمكنك شراء نقاط من ميزانيتك",
|
||||
'insert amount': "إدراج المبلغ",
|
||||
'You can buy Points to let you online\nby this list below':
|
||||
"يمكنك شراء النقاط للبقاء على وضع الاتصال\nمن خلال القائمة أدناه",
|
||||
'Create Wallet to recive your money': "إنشاء محفظة لاستلام أموالك",
|
||||
'Enter your feedback here': "أدخل تعليقاتك هنا",
|
||||
'Please enter your feedback.': "الرجاء إدخال تعليقاتك.",
|
||||
'Feedback': "تعليق",
|
||||
'Submit ': "تقديم",
|
||||
'Click here to Show it in Map': "انقر هنا لعرضه على الخريطة",
|
||||
'Canceled': "تم الإلغاء",
|
||||
'Type your Email': "اكتب بريدك الإلكتروني",
|
||||
'No I want': "لا أريد",
|
||||
'Email is': "البريد الإلكتروني هو",
|
||||
'Phone Number is': "رقم الهاتف هو",
|
||||
'Date of Birth is': "تاريخ الميلاد هو",
|
||||
'Sex is ': "الجنس هو ",
|
||||
'Car Details': "تفاصيل السيارة",
|
||||
'VIN is': "رقم الشاصي هو",
|
||||
'Color is ': "اللون هو ",
|
||||
'Make is ': "الصانع هو",
|
||||
'Model is': "النموذج هو",
|
||||
'Year is': "السنة هي",
|
||||
'Expiration Date ': "تاريخ انتهاء الصلاحية ",
|
||||
'Edit Your data': "تعديل بياناتك",
|
||||
'write vin for your car': "اكتب رقم الشاصي لسيارتك",
|
||||
'VIN': "رقم الشاصي",
|
||||
'write Color for your car': "اكتب لون سيارتك",
|
||||
'write Make for your car': "اكتب صانع سيارتك",
|
||||
'Make': "الصانع",
|
||||
'write Model for your car': "اكتب نموذج سيارتك",
|
||||
'Model': "النموذج",
|
||||
'write Year for your car': "اكتب سنة سيارتك",
|
||||
'Expiration Date': "تاريخ انتهاء الصلاحية",
|
||||
'write Expiration Date for your car':
|
||||
"اكتب تاريخ انتهاء صلاحية سيارتك",
|
||||
'Tariffs': "التعرفه",
|
||||
'Minimum fare': "الحد الأدنى للأجرة",
|
||||
'Maximum fare': "الحد الأقصى للأجرة",
|
||||
'JOD': "د.أ",
|
||||
'Flag-down fee': "رسوم التشغيل",
|
||||
'Including Tax': "بما في ذلك الضرائب",
|
||||
'BookingFee': "رسوم الحجز",
|
||||
'Morning': "الصباح",
|
||||
'from 07:30 till 10:30 (Thursday, Friday, Saturday, Monday)':
|
||||
"من 07:30 إلى 10:30 (يوم الخميس، الجمعة، السبت، الإثنين)",
|
||||
'Evening': "المساء",
|
||||
'from 12:00 till 15:00 (Thursday, Friday, Saturday, Monday)':
|
||||
"من 12:00 إلى 15:00 (يوم الخميس، الجمعة، السبت، الإثنين)",
|
||||
'Night': "الليل",
|
||||
'from 23:59 till 05:30': "من 23:59 إلى 05:30",
|
||||
'Rate Driver': "تقييم السائق",
|
||||
'Ride Summaries': "ملخصات الرحلات",
|
||||
'Average of Hours of': "متوسط ساعات",
|
||||
' is ON for this month': "في هذا الشهر",
|
||||
'Days': "أيام",
|
||||
'Total Hours on month': "إجمالي الساعات في الشهر",
|
||||
'Counts of Hours on days': "عدد ساعات الأيام",
|
||||
'OrderId': 'رقم الرحله',
|
||||
'created time': "وقت الرحله",
|
||||
'Map Passenger': 'خارطه الراكب',
|
||||
'Your Budget less than needed': 'القيمه المدخله اقل من رصيدك',
|
||||
},
|
||||
"tr": {
|
||||
"Choose Language": "Dil Seçin",
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/constant/table_names.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
|
||||
31
lib/controller/payment/driver_payment_controller.dart
Normal file
31
lib/controller/payment/driver_payment_controller.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/links.dart';
|
||||
import 'package:SEFER/controller/functions/crud.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
|
||||
class DriverWalletHistoryController extends GetxController {
|
||||
bool isLoading = false;
|
||||
List archive = [];
|
||||
|
||||
getArchivePayment() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getWalletByDriver,
|
||||
payload: {'driver_id': box.read(BoxName.driverID)});
|
||||
|
||||
archive = jsonDecode(res)['message'];
|
||||
print(archive);
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
getArchivePayment();
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ class PaymentController extends GetxController {
|
||||
// applePay: const PaymentSheetApplePay(merchantCountryCode: 'US'),
|
||||
// googlePay: const PaymentSheetGooglePay(merchantCountryCode: 'US'),
|
||||
paymentIntentClientSecret: clientSecret,
|
||||
merchantDisplayName: 'Sefer',
|
||||
merchantDisplayName: AppInformation.appName,
|
||||
billingDetails: BillingDetails(
|
||||
name: box.read(BoxName.nameDriver) == null
|
||||
? box.read(BoxName.name).toString()
|
||||
@@ -178,7 +178,7 @@ class PaymentController extends GetxController {
|
||||
: box.read(BoxName.phoneDriver).toString(),
|
||||
address: const Address(
|
||||
city: 'city',
|
||||
country: 'United States',
|
||||
country: 'Jordan', //'United States'
|
||||
line1: '',
|
||||
line2: '',
|
||||
postalCode: '12345',
|
||||
@@ -251,8 +251,8 @@ class PaymentController extends GetxController {
|
||||
"AWj9MdPaA5Djpx8gOkvBn2qhP-3KvfB6W-l8USTsm19Xi2NhkNkE9QzosOvTPTsKjCMNffgpqStUA1-x",
|
||||
secretKey:
|
||||
"EKkasSl9O61lrfrbaJfXp1B-CIs2Rv71J0WPouxxugi38DsWaMhWpovJxN2ftYPQ0l6v9eoBvnyWkemp",
|
||||
returnURL: "https://mobile-app.store",
|
||||
cancelURL: "https://mobile-app.store/cancel",
|
||||
returnURL: AppInformation.website,
|
||||
cancelURL: "${AppInformation.website}/cancel",
|
||||
transactions: [
|
||||
{
|
||||
"amount": {
|
||||
@@ -294,7 +294,7 @@ class PaymentController extends GetxController {
|
||||
}
|
||||
}
|
||||
],
|
||||
note: "Contact us for any questions on your order.",
|
||||
note: "Contact us for any questions on your order.".tr,
|
||||
onSuccess: (Map params) async {
|
||||
print("onSuccess: $params");
|
||||
addPassengerWallet();
|
||||
@@ -423,7 +423,7 @@ class PaymentController extends GetxController {
|
||||
|
||||
Future<String> createTransactionToCaptain(
|
||||
String amount, String account) async {
|
||||
String url = 'https://api.stripe.com//v1/transfers';
|
||||
String url = 'https://api.stripe.com/v1/transfers';
|
||||
|
||||
final body = {
|
||||
'amount': amount, //amount
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/links.dart';
|
||||
import 'package:SEFER/controller/functions/crud.dart';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
@@ -49,6 +50,19 @@ class RateController extends GetxController {
|
||||
'rating': selectedRateItemId.toString(),
|
||||
'comment': comment.text,
|
||||
});
|
||||
await CRUD()
|
||||
.post(link: AppLink.sendEmailToPassengerForTripDetails, payload: {
|
||||
'startLocation':
|
||||
Get.find<MapDriverController>().latLngpassengerLocation.toString(),
|
||||
'endLocation': Get.find<MapDriverController>()
|
||||
.latLngPassengerDestination
|
||||
.toString(),
|
||||
'name': Get.find<MapDriverController>().name.toString(),
|
||||
'timeOfTrip': Get.find<MapDriverController>().duration.toString(),
|
||||
'fee': Get.find<MapDriverController>().timeOfOrder.toString(),
|
||||
'duration': Get.find<MapDriverController>().duration.toString(),
|
||||
'phone': Get.find<MapDriverController>().phone.toString(),
|
||||
});
|
||||
// homeCaptainController.isActive = true;
|
||||
// update();
|
||||
// homeCaptainController.getPaymentToday();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:SEFER/views/home/Captin/home_captain/call_controller.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -14,7 +14,7 @@ class RateDriverFromPassenger extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Rate Captain'.tr,
|
||||
title: 'Rate Driver'.tr,
|
||||
body: [
|
||||
Positioned(
|
||||
top: 40,
|
||||
|
||||
@@ -28,8 +28,7 @@ class RideCalculateDriver extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Average of Hours of ${AppInformation.appName} is ON for this month ${durationController.jsonData1['message'][0]['day'].toString().split('-')[1]}'
|
||||
.tr,
|
||||
'${'Average of Hours of'.tr} ${AppInformation.appName}${' is ON for this month'.tr}${' ${durationController.jsonData1['message'][0]['day'].toString().split('-')[1]}'.tr}',
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
@@ -65,7 +64,7 @@ class RideCalculateDriver extends StatelessWidget {
|
||||
show: true,
|
||||
topTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Days',
|
||||
'Days'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
axisNameSize: 30,
|
||||
|
||||
@@ -97,7 +97,7 @@ class AiPage extends StatelessWidget {
|
||||
.start,
|
||||
children: [
|
||||
Text(
|
||||
'Name :${scanDocumentsByApi.name}',
|
||||
'${'Name :'.tr}${scanDocumentsByApi.name}',
|
||||
style: AppStyle
|
||||
.subtitle,
|
||||
),
|
||||
@@ -107,7 +107,7 @@ class AiPage extends StatelessWidget {
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Drivers License Class: ${scanDocumentsByApi.licenseClass}',
|
||||
'${'Drivers License Class: '.tr}${scanDocumentsByApi.licenseClass}',
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
@@ -129,7 +129,7 @@ class AiPage extends StatelessWidget {
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Document Number: ${scanDocumentsByApi.documentNo}',
|
||||
'${'Document Number: '.tr}${scanDocumentsByApi.documentNo}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Image.memory(
|
||||
@@ -139,7 +139,7 @@ class AiPage extends StatelessWidget {
|
||||
),
|
||||
]),
|
||||
Text(
|
||||
'Address: ${scanDocumentsByApi.address}',
|
||||
'${'Address: '.tr}${scanDocumentsByApi.address}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Row(
|
||||
@@ -148,7 +148,7 @@ class AiPage extends StatelessWidget {
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Height: ${scanDocumentsByApi.height}',
|
||||
'${'Height: '.tr}${scanDocumentsByApi.height}',
|
||||
style:
|
||||
AppStyle.subtitle,
|
||||
),
|
||||
@@ -174,7 +174,7 @@ class AiPage extends StatelessWidget {
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Expiry Date: ${scanDocumentsByApi.expireDate}',
|
||||
'${'Expiry Date: '.tr}${scanDocumentsByApi.expireDate}',
|
||||
style: DateTime.parse(scanDocumentsByApi
|
||||
.responseMap['data']
|
||||
['ocr'][
|
||||
@@ -192,7 +192,7 @@ class AiPage extends StatelessWidget {
|
||||
.greenColor),
|
||||
),
|
||||
Text(
|
||||
'Date of Birth: ${scanDocumentsByApi.dob}',
|
||||
'${'Date of Birth: '.tr}${scanDocumentsByApi.dob}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -110,17 +110,11 @@ Widget buildImageWithBoundingBoxes() {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
'Made :' +
|
||||
carRegistrationRecognizerController
|
||||
.extracted['make']
|
||||
.toString(),
|
||||
'${'Made :'.tr}${carRegistrationRecognizerController.extracted['make']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'model :' +
|
||||
carRegistrationRecognizerController
|
||||
.extracted['model']
|
||||
.toString(),
|
||||
'${'model :'.tr}${carRegistrationRecognizerController.extracted['model']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
@@ -129,17 +123,11 @@ Widget buildImageWithBoundingBoxes() {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
'VIN :' +
|
||||
carRegistrationRecognizerController
|
||||
.extracted['vin']
|
||||
.toString(),
|
||||
'${'VIN :'.tr}${carRegistrationRecognizerController.extracted['vin']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'year :' +
|
||||
carRegistrationRecognizerController
|
||||
.extracted['year']
|
||||
.toString(),
|
||||
'${'year :'.tr}${carRegistrationRecognizerController.extracted['year']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
@@ -150,26 +138,17 @@ Widget buildImageWithBoundingBoxes() {
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'expiration date :' +
|
||||
carRegistrationRecognizerController
|
||||
.extracted['expiration_date']
|
||||
.toString(),
|
||||
'expiration date :${carRegistrationRecognizerController.extracted['expiration_date']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'registration date :' +
|
||||
carRegistrationRecognizerController
|
||||
.extracted['registration_date']
|
||||
.toString(),
|
||||
'registration date :${carRegistrationRecognizerController.extracted['registration_date']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'color :' +
|
||||
carRegistrationRecognizerController
|
||||
.extracted['color']
|
||||
.toString(),
|
||||
'color :${carRegistrationRecognizerController.extracted['color']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
@@ -178,10 +157,7 @@ Widget buildImageWithBoundingBoxes() {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
'owner :' +
|
||||
carRegistrationRecognizerController
|
||||
.extracted['owner']
|
||||
.toString(),
|
||||
'owner :${carRegistrationRecognizerController.extracted['owner']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -27,7 +27,7 @@ class LoginCaptin extends StatelessWidget {
|
||||
|
||||
return GetBuilder<LoginCaptinController>(
|
||||
builder: (controller) => MyScafolld(
|
||||
title: 'Login Captin'.tr,
|
||||
title: 'Login Driver'.tr,
|
||||
isleading: true,
|
||||
body: [
|
||||
if (box.read(BoxName.agreeTerms) != 'agreed')
|
||||
@@ -181,7 +181,7 @@ class LoginCaptin extends StatelessWidget {
|
||||
onTap: () => Get.to(() => const RegisterCaptin()),
|
||||
animatedTexts: [
|
||||
TypewriterAnimatedText(
|
||||
'Register Captin'.tr,
|
||||
'Register as Driver'.tr,
|
||||
textStyle: AppStyle.headTitle2,
|
||||
speed: const Duration(milliseconds: 200),
|
||||
),
|
||||
@@ -283,11 +283,12 @@ class LoginCaptin extends StatelessWidget {
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
text:
|
||||
'By selecting "I Agree" below, I have reviewed and agree to the Terms of Use and acknowledge the ',
|
||||
'By selecting "I Agree" below, I have reviewed and agree to the Terms of Use and acknowledge the '
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: 'Privacy Notice',
|
||||
text: 'Privacy Notice'.tr,
|
||||
style: const TextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
color: AppColor.blueColor),
|
||||
|
||||
@@ -13,7 +13,7 @@ class RegisterCaptin extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(RegisterCaptainController());
|
||||
return MyScafolld(
|
||||
title: 'Register Captain'.tr,
|
||||
title: 'Register Driver'.tr,
|
||||
body: [
|
||||
GetBuilder<RegisterCaptainController>(
|
||||
builder: (controller) => Form(
|
||||
|
||||
@@ -13,7 +13,7 @@ class VerifyEmailCaptainPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Verify Email For Captain'.tr,
|
||||
title: 'Verify Email For Driver'.tr,
|
||||
body: [
|
||||
Positioned(
|
||||
top: 10,
|
||||
|
||||
@@ -14,7 +14,6 @@ import 'package:SEFER/views/widgets/my_textField.dart';
|
||||
|
||||
import '../../constant/info.dart';
|
||||
import '../../controller/auth/login_controller.dart';
|
||||
import '../admin/admin_home_page.dart';
|
||||
import '../widgets/mycircular.dart';
|
||||
import 'register_page.dart';
|
||||
|
||||
@@ -59,7 +58,7 @@ class LoginPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'title',
|
||||
title: 'title'.tr,
|
||||
onPressed: () {
|
||||
controller.adminDashboardOpen();
|
||||
},
|
||||
@@ -232,11 +231,18 @@ class LoginPage extends StatelessWidget {
|
||||
displayFullTextOnTap: true,
|
||||
stopPauseOnTap: true,
|
||||
),
|
||||
const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () => Get.to(LoginCaptin()),
|
||||
child: Text(
|
||||
'If You Want be Captin Click Here.'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
const Icon(Icons.drive_eta_rounded),
|
||||
Text(
|
||||
'If You Want be Driver Click Here.'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
@@ -279,7 +285,7 @@ class LoginPage extends StatelessWidget {
|
||||
style: AppStyle.title,
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: 'Privacy Notice',
|
||||
text: 'Privacy Notice'.tr,
|
||||
style: const TextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
color: AppColor.blueColor),
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/credential.dart';
|
||||
|
||||
class BottomBarController extends GetxController {
|
||||
var currentIndex = 0.obs;
|
||||
@@ -20,49 +19,49 @@ class HomeScreen extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Bottom Bar Example'),
|
||||
title: Text('Bottom Bar Example'.tr),
|
||||
),
|
||||
body: Obx(() => IndexedStack(
|
||||
index: controller.currentIndex.value,
|
||||
children: [
|
||||
children: const [
|
||||
HomeView(),
|
||||
const ProfileView(),
|
||||
const StatisticsView(),
|
||||
const WalletView(),
|
||||
ProfileView(),
|
||||
StatisticsView(),
|
||||
WalletView(),
|
||||
],
|
||||
)),
|
||||
bottomNavigationBar: Obx(() => BottomNavigationBar(
|
||||
backgroundColor: Colors.greenAccent,
|
||||
currentIndex: controller.currentIndex.value,
|
||||
onTap: controller.changePage,
|
||||
items: const [
|
||||
items: [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(
|
||||
icon: const Icon(
|
||||
Icons.home,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
label: 'Home',
|
||||
label: 'Home'.tr,
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(
|
||||
icon: const Icon(
|
||||
Icons.person,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
label: 'Profile',
|
||||
label: 'Profile'.tr,
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(
|
||||
icon: const Icon(
|
||||
Icons.bar_chart,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
label: 'Statistics',
|
||||
label: 'Statistics'.tr,
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(
|
||||
icon: const Icon(
|
||||
Icons.account_balance_wallet,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
label: 'Wallet',
|
||||
label: 'Wallet'.tr,
|
||||
),
|
||||
],
|
||||
)),
|
||||
@@ -76,7 +75,7 @@ class HomeView extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Map<String, dynamic> data;
|
||||
return Center(
|
||||
return const Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Text('Home View'),
|
||||
|
||||
@@ -154,7 +154,7 @@ class CameraWidgetCardId extends StatelessWidget {
|
||||
width: Get.width,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Camera not initilaized yet',
|
||||
'Camera not initilaized yet'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import '../../../controller/functions/location_controller.dart';
|
||||
import 'mapDriverWidgets/driver_end_ride_bar.dart';
|
||||
import 'mapDriverWidgets/google_driver_map_page.dart';
|
||||
import 'mapDriverWidgets/google_map_app.dart';
|
||||
import 'mapDriverWidgets/passenger_info_window.dart';
|
||||
import 'mapDriverWidgets/sos_connect.dart';
|
||||
|
||||
@@ -17,12 +18,13 @@ class PassengerLocationMapPage extends StatelessWidget {
|
||||
Get.put(MapDriverController());
|
||||
|
||||
return MyScafolld(
|
||||
title: 'Map'.tr,
|
||||
title: 'Map Passenger'.tr,
|
||||
body: [
|
||||
GoogleDriverMap(locationController: locationController),
|
||||
const PassengerInfoWindow(),
|
||||
driverEndRideBar(),
|
||||
const SosConnect(),
|
||||
const GoogleMapApp(),
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ class HistoryCaptain extends StatelessWidget {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'OrderID',
|
||||
'OrderId'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
@@ -66,7 +66,7 @@ class HistoryCaptain extends StatelessWidget {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'created_at',
|
||||
'created time'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
|
||||
@@ -51,7 +51,7 @@ class HistoryDetailsPage extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
'Order ID ${res['id']}',
|
||||
'${'Order ID'.tr} ${res['id']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
@@ -72,11 +72,11 @@ class HistoryDetailsPage extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
'Price is ${res['price_for_driver']}',
|
||||
'${'Price is'.tr} ${res['price_for_driver']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Distance is ${res['distance']} KM',
|
||||
'${'Distance is'.tr} ${res['distance']} KM',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
@@ -100,15 +100,15 @@ class HistoryDetailsPage extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'To Passenger is ${res['DriverIsGoingToPassenger']}',
|
||||
'${'Time to Passenger is'.tr} ${res['DriverIsGoingToPassenger']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'TimeStart is ${res['rideTimeStart']}',
|
||||
'${'TimeStart is'.tr} ${res['rideTimeStart']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Time Finish is ${res['rideTimeFinish']}',
|
||||
'${'Time Finish is'.tr} ${res['rideTimeFinish']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
@@ -124,7 +124,7 @@ class HistoryDetailsPage extends StatelessWidget {
|
||||
color: AppColor.greenColor, width: 2)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Passenger Name is ${res['first_name']} ${res['last_name']} ',
|
||||
'${'Passenger Name is'.tr} ${res['first_name']} ${res['last_name']} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
@@ -139,7 +139,7 @@ class HistoryDetailsPage extends StatelessWidget {
|
||||
color: AppColor.yellowColor, width: 2)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Status is ${res['status']}',
|
||||
'${'Status is'.tr} ${res['status']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -5,17 +5,16 @@ import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
import '../../../../constant/box_name.dart';
|
||||
import '../../../../controller/firebase/firbase_messge.dart';
|
||||
import '../../../../controller/home/captin/map_driver_controller.dart';
|
||||
import '../../../../main.dart';
|
||||
|
||||
class CallController extends GetxController {
|
||||
String channelName =
|
||||
'sefer300'; //Get.find<MapDriverController>().passengerId;
|
||||
String token =
|
||||
"00612994c6e707543e68d5638894d04f989IAA9fx7yHezOOXPq1l4MwrNgPVOxWj7VnirB9Ks6X37jS6MLiA8AAAAAEABXi+nQ7GjSZQEAAQAAAAAA";
|
||||
|
||||
String channelName = ''; // Get.find<MapDriverController>().rideId;
|
||||
String token = '';
|
||||
// int uid = int.parse(box.read(BoxName.phoneDriver)); // uid of the local user
|
||||
int uid = 0;
|
||||
int? _remoteUid; // uid of the remote user
|
||||
int? remoteUid; // uid of the remote user
|
||||
bool _isJoined = false; // Indicates if the local user has joined the channel
|
||||
String status = '';
|
||||
late RtcEngine agoraEngine; // Agora engine instance
|
||||
@@ -23,21 +22,31 @@ class CallController extends GetxController {
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
channelName = Get.find<MapDriverController>().rideId; // 'sefer300'; //
|
||||
remoteUid = int.parse(Get.find<MapDriverController>().phone);
|
||||
uid = int.parse(box.read(BoxName.phoneDriver));
|
||||
// initAgoraFull();
|
||||
}
|
||||
|
||||
initAgoraFull() async {
|
||||
_remoteUid = box.read(BoxName.phone) != null
|
||||
? int.parse(box.read(BoxName.phone))
|
||||
: int.parse(box.read(BoxName.phoneDriver));
|
||||
uid = box.read(BoxName.phoneDriver) != null
|
||||
? int.parse(box.read(BoxName.phoneDriver))
|
||||
: int.parse(box.read(BoxName.phone));
|
||||
print('remoteid is $_remoteUid');
|
||||
print('remoteid is $remoteUid');
|
||||
print('uid is $uid');
|
||||
// await fetchToken();
|
||||
await fetchToken();
|
||||
// Set up an instance of Agora engine
|
||||
setupVoiceSDKEngine();
|
||||
join();
|
||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
'Call Income'.tr,
|
||||
'${'You have call from driver'.tr} ${box.read(BoxName.nameDriver)}',
|
||||
Get.find<MapDriverController>().tokenPassenger,
|
||||
[
|
||||
token,
|
||||
channelName,
|
||||
uid.toString(),
|
||||
remoteUid.toString(),
|
||||
],
|
||||
);
|
||||
join();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -59,25 +68,26 @@ class CallController extends GetxController {
|
||||
agoraEngine.registerEventHandler(
|
||||
RtcEngineEventHandler(
|
||||
onJoinChannelSuccess: (RtcConnection connection, int elapsed) {
|
||||
Get.snackbar(
|
||||
"Local user uid:${connection.localUid} joined the channel", '');
|
||||
// Get.snackbar(
|
||||
// "Local user uid:${connection.localUid} joined the channel", '');
|
||||
status = 'joined'.tr;
|
||||
_isJoined = true;
|
||||
update();
|
||||
},
|
||||
onUserJoined: (RtcConnection connection, int remoteUid, int elapsed) {
|
||||
Get.snackbar("Remote user uid:$remoteUid joined the channel", '');
|
||||
status = '${box.read(BoxName.nameDriver) ?? box.read(BoxName.name)}'
|
||||
// Get.snackbar("Remote user uid:$remoteUid joined the channel", '');
|
||||
status = '${Get.find<MapDriverController>().name}'
|
||||
' joined'
|
||||
.tr
|
||||
.tr;
|
||||
_remoteUid = remoteUid;
|
||||
remoteUid = remoteUid;
|
||||
update();
|
||||
},
|
||||
onUserOffline: (RtcConnection connection, int remoteUid,
|
||||
onUserOffline: (RtcConnection connection, int? remoteUid,
|
||||
UserOfflineReasonType reason) {
|
||||
Get.snackbar("Remote user uid:$remoteUid left the channel", '');
|
||||
// Get.snackbar("Remote user uid:$remoteUid left the channel", '');
|
||||
status = 'Call left'.tr;
|
||||
_remoteUid = null;
|
||||
remoteUid = null;
|
||||
update();
|
||||
},
|
||||
),
|
||||
@@ -101,7 +111,7 @@ class CallController extends GetxController {
|
||||
|
||||
void leave() {
|
||||
_isJoined = false;
|
||||
_remoteUid = null;
|
||||
remoteUid = null;
|
||||
update();
|
||||
agoraEngine.leaveChannel();
|
||||
}
|
||||
@@ -114,13 +124,9 @@ class CallController extends GetxController {
|
||||
}
|
||||
|
||||
fetchToken() async {
|
||||
var res = await CRUD().getAgora(
|
||||
channelName: 'sefer22'); //Get.find<MapDriverController>().rideId);
|
||||
|
||||
print('hhhhhhhhhhhhhhhhhhhhhhh');
|
||||
print(res);
|
||||
channelName = 'sefer22';
|
||||
token = res['token'];
|
||||
var res = await CRUD()
|
||||
.getAgoraToken(channelName: channelName, uid: uid.toString());
|
||||
token = res;
|
||||
print('token is $token');
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class DrawerCaptain extends StatelessWidget {
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.account_balance_wallet),
|
||||
title: const Text('Wallet'),
|
||||
title: Text('Wallet'.tr),
|
||||
onTap: () {
|
||||
// Handle wallet item tap
|
||||
Get.to(() => WaletCaptain(), transition: Transition.native);
|
||||
@@ -46,7 +46,7 @@ class DrawerCaptain extends StatelessWidget {
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.person),
|
||||
title: const Text('Profile'),
|
||||
title: Text('Profile'.tr),
|
||||
onTap: () {
|
||||
// Handle profile item tap
|
||||
Get.to(() => const ProfileCaptain(),
|
||||
@@ -55,7 +55,7 @@ class DrawerCaptain extends StatelessWidget {
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.history),
|
||||
title: const Text('History of Trip'),
|
||||
title: Text('History of Trip'.tr),
|
||||
onTap: () {
|
||||
Get.to(() => const HistoryCaptain(),
|
||||
transition: Transition.downToUp);
|
||||
@@ -64,7 +64,7 @@ class DrawerCaptain extends StatelessWidget {
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.notifications),
|
||||
title: const Text('Notifications'),
|
||||
title: Text('Notifications'.tr),
|
||||
onTap: () {
|
||||
// Handle notifications item tap
|
||||
Get.to(() => const NotificationCaptain(),
|
||||
@@ -73,7 +73,7 @@ class DrawerCaptain extends StatelessWidget {
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.help),
|
||||
title: const Text('Helping Center'),
|
||||
title: Text('Helping Center'.tr),
|
||||
onTap: () {
|
||||
// Handle helping center item tap
|
||||
Get.to(() => HelpCaptain(), transition: Transition.size);
|
||||
@@ -81,7 +81,7 @@ class DrawerCaptain extends StatelessWidget {
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.settings),
|
||||
title: const Text('Settings'),
|
||||
title: Text('Settings'.tr),
|
||||
onTap: () {
|
||||
// Handle settings item tap
|
||||
Get.to(() => const SettingsCaptain(),
|
||||
@@ -90,7 +90,7 @@ class DrawerCaptain extends StatelessWidget {
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.exit_to_app),
|
||||
title: const Text('Sign Out'),
|
||||
title: Text('Sign Out'.tr),
|
||||
onTap: () {
|
||||
// Handle sign out item tap
|
||||
Get.to(() => const LogoutCaptain(),
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import 'dart:async';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
|
||||
|
||||
import '../../../../constant/api_key.dart';
|
||||
import '../../../../controller/functions/crud.dart';
|
||||
|
||||
const String appId = AK.agoraAppId;
|
||||
|
||||
@@ -18,9 +21,9 @@ class DriverCallPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DriverCallPageState extends State<DriverCallPage> {
|
||||
String channelName = 'sefer300';
|
||||
String token =
|
||||
"00612994c6e707543e68d5638894d04f989IAACchY2SBwRcuw2mt+BocxbF+fmFKvjOS/hekkirRWfuqMLiA8AAAAAEADs3TvfbjrSZQEAAQAAAAAA";
|
||||
String channelName = '';
|
||||
String token = '';
|
||||
// "00612994c6e707543e68d5638894d04f989IAAlydoFEC3ZeZkeUwl0dSswZTX8n+xyZR8PBWdwXFV6t6MLiA8AAAAAEACCHD/gn3TUZQEAAQAAAAAA";
|
||||
|
||||
// int uid = int.parse(box.read(BoxName.phoneDriver)); // uid of the local user
|
||||
int uid = 0;
|
||||
@@ -37,6 +40,20 @@ class _DriverCallPageState extends State<DriverCallPage> {
|
||||
));
|
||||
}
|
||||
|
||||
initAgora() async {
|
||||
await fetchToken();
|
||||
await setupVoiceSDKEngine();
|
||||
}
|
||||
|
||||
fetchToken() async {
|
||||
var res = await CRUD()
|
||||
.getAgoraToken(channelName: channelName, uid: uid.toString());
|
||||
setState(() {
|
||||
token = res;
|
||||
print('token is $token');
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -49,7 +66,7 @@ class _DriverCallPageState extends State<DriverCallPage> {
|
||||
print('remoteid is $_remoteUid');
|
||||
print('uid is $uid');
|
||||
// Set up an instance of Agora engine
|
||||
setupVoiceSDKEngine();
|
||||
initAgora();
|
||||
}
|
||||
|
||||
Future<void> setupVoiceSDKEngine() async {
|
||||
@@ -124,35 +141,39 @@ class _DriverCallPageState extends State<DriverCallPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
scaffoldMessengerKey: scaffoldMessengerKey,
|
||||
home: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Get started with Voice Calling'),
|
||||
),
|
||||
body: ListView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||
children: [
|
||||
// Status text
|
||||
Container(height: 40, child: Center(child: _status())),
|
||||
// Button Row
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
child: const Text("Join"),
|
||||
onPressed: () => {join()},
|
||||
home: MyScafolld(
|
||||
// appBar: AppBar(
|
||||
// title: const Text('Get started with Voice Calling'),
|
||||
// ),
|
||||
title: 'Voice Calling'.tr,
|
||||
isleading: true,
|
||||
body: [
|
||||
ListView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||
children: [
|
||||
// Status text
|
||||
Container(height: 40, child: Center(child: _status())),
|
||||
// Button Row
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
child: const Text("Join"),
|
||||
onPressed: () => {join()},
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
child: const Text("Leave"),
|
||||
onPressed: () => {leave()},
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
child: const Text("Leave"),
|
||||
onPressed: () => {leave()},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,14 +46,14 @@ class HelpCaptain extends StatelessWidget {
|
||||
child: TextFormField(
|
||||
controller:
|
||||
helpController.helpQuestionController,
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
hintText: 'Enter your Question here',
|
||||
labelText: 'Question',
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
hintText: 'Enter your Question here'.tr,
|
||||
labelText: 'Question'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Please enter your Question.';
|
||||
return 'Please enter your Question.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||
|
||||
|
||||
@@ -184,41 +184,41 @@ class HomeCaptain extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: Get.height * .17,
|
||||
right: Get.width * .01,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: Get.width * .12,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
Get.to(
|
||||
() => const DriverCallPage(),
|
||||
);
|
||||
},
|
||||
icon: const Icon(Fontisto.phone),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Positioned(
|
||||
// bottom: Get.height * .17,
|
||||
// right: Get.width * .01,
|
||||
// child: AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: Get.width * .12,
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// border: Border.all(),
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: IconButton(
|
||||
// onPressed: () {
|
||||
// Get.to(
|
||||
// () => const DriverCallPage(),
|
||||
// );
|
||||
// },
|
||||
// icon: const Icon(Fontisto.phone),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
leftMainMenuCaptainIcons(),
|
||||
// callPage(),
|
||||
|
||||
Positioned(
|
||||
top: Get.height * .2,
|
||||
// left: 20,
|
||||
// right: 20,
|
||||
bottom: Get.height * .4,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
Get.to(() => const CallPage());
|
||||
},
|
||||
icon: const Icon(Icons.call),
|
||||
),
|
||||
),
|
||||
// Positioned(
|
||||
// top: Get.height * .2,
|
||||
// // left: 20,
|
||||
// // right: 20,
|
||||
// bottom: Get.height * .4,
|
||||
// child: IconButton(
|
||||
// onPressed: () {
|
||||
// Get.to(() => const CallPage());
|
||||
// },
|
||||
// icon: const Icon(Icons.call),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -38,8 +38,8 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
const Icon(Icons.timelapse),
|
||||
Text(
|
||||
mapDriverController.hours > 1
|
||||
? '${'Your Ride Duration is '.tr}${mapDriverController.hours} H and ${mapDriverController.minutes} m'
|
||||
: '${'Your Ride Duration is '.tr} ${mapDriverController.minutes} m',
|
||||
? '${'${'Your Ride Duration is '.tr}${mapDriverController.hours}${' H and'.tr}'} ${mapDriverController.minutes} m'
|
||||
: '${'Your Ride Duration is '.tr} ${mapDriverController.minutes} ${'m'.tr}',
|
||||
style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
|
||||
51
lib/views/home/Captin/mapDriverWidgets/google_map_app.dart
Normal file
51
lib/views/home/Captin/mapDriverWidgets/google_map_app.dart
Normal file
@@ -0,0 +1,51 @@
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class GoogleMapApp extends StatelessWidget {
|
||||
const GoogleMapApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapDriverController>(
|
||||
builder: (mapDriverController) => mapDriverController.isRideStarted
|
||||
? Positioned(
|
||||
left: 125,
|
||||
bottom: 20,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: IconButton(
|
||||
onPressed: () async {
|
||||
var startLat = Get.find<MapDriverController>()
|
||||
.latLngpassengerLocation
|
||||
.latitude;
|
||||
var startLng = Get.find<MapDriverController>()
|
||||
.latLngpassengerLocation
|
||||
.longitude;
|
||||
|
||||
var endLat = Get.find<MapDriverController>()
|
||||
.latLngPassengerDestination
|
||||
.latitude;
|
||||
var endLng = Get.find<MapDriverController>()
|
||||
.latLngPassengerDestination
|
||||
.longitude;
|
||||
|
||||
String url =
|
||||
'https://www.google.com/maps/dir/$startLat,$startLng/$endLat,$endLng/&directionsmode=driving';
|
||||
if (await canLaunchUrl(Uri.parse(url))) {
|
||||
await launchUrl(Uri.parse(url));
|
||||
} else {
|
||||
throw 'Could not launch google maps';
|
||||
}
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.map,
|
||||
size: 45,
|
||||
),
|
||||
)),
|
||||
)
|
||||
: const SizedBox());
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
import 'package:animated_text_kit/animated_text_kit.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
@@ -12,6 +10,7 @@ import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../../../controller/functions/launch.dart';
|
||||
import '../../../../controller/home/captin/widget/call_page.dart';
|
||||
|
||||
class PassengerInfoWindow extends StatelessWidget {
|
||||
const PassengerInfoWindow({
|
||||
@@ -102,51 +101,51 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
controller.isSocialPressed = true;
|
||||
await controller
|
||||
.driverCallPassenger();
|
||||
|
||||
launchCommunication('phone',
|
||||
controller.phone.toString(), '');
|
||||
Get.to(() => const CallPage());
|
||||
// launchCommunication('phone',
|
||||
// controller.phone.toString(), '');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.phone,
|
||||
color: AppColor.blueColor,
|
||||
)),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
controller.isSocialPressed = true;
|
||||
await controller
|
||||
.driverCallPassenger();
|
||||
// IconButton(
|
||||
// onPressed: () async {
|
||||
// controller.isSocialPressed = true;
|
||||
// await controller
|
||||
// .driverCallPassenger();
|
||||
|
||||
launchCommunication(
|
||||
'whatsapp',
|
||||
controller.phone.toString(),
|
||||
'${'Hello this is Driver'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome.whatsapp,
|
||||
color: AppColor.greenColor,
|
||||
)),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
controller.isSocialPressed = true;
|
||||
await controller
|
||||
.driverCallPassenger();
|
||||
// launchCommunication(
|
||||
// 'whatsapp',
|
||||
// controller.phone.toString(),
|
||||
// '${'Hello this is Driver'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// FontAwesome.whatsapp,
|
||||
// color: AppColor.greenColor,
|
||||
// )),
|
||||
// IconButton(
|
||||
// onPressed: () async {
|
||||
// controller.isSocialPressed = true;
|
||||
// await controller
|
||||
// .driverCallPassenger();
|
||||
|
||||
launchCommunication(
|
||||
'sms',
|
||||
controller.phone.toString(),
|
||||
'${'Hello this is Driver'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.sms_rounded,
|
||||
color: AppColor.blueColor,
|
||||
)),
|
||||
// launchCommunication(
|
||||
// 'sms',
|
||||
// controller.phone.toString(),
|
||||
// '${'Hello this is Driver'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// Icons.sms_rounded,
|
||||
// color: AppColor.blueColor,
|
||||
// )),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller.isSocialPressed = true;
|
||||
launchCommunication(
|
||||
'email',
|
||||
controller.phone.toString(),
|
||||
'${'Hello this is Captain'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
'${'Hello this is Driver'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.email,
|
||||
@@ -222,8 +221,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
40) {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Hi ,I Arrive your site'
|
||||
.tr,
|
||||
'Hi ,I Arrive your site',
|
||||
'I Arrive your site'
|
||||
.tr,
|
||||
controller
|
||||
@@ -300,6 +298,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
title:
|
||||
'Are you sure to cancel?'
|
||||
.tr,
|
||||
middleText: '',
|
||||
confirm:
|
||||
MyElevatedButton(
|
||||
title:
|
||||
@@ -307,8 +306,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
onPressed:
|
||||
() async {
|
||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
'Driver Cancel Your Trip'
|
||||
.tr,
|
||||
'Driver Cancel Your Trip',
|
||||
'You will be pay the cost to driver or we will get it from you on next trip'
|
||||
.tr,
|
||||
controller
|
||||
|
||||
@@ -28,7 +28,7 @@ class SosConnect extends StatelessWidget {
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: 60,
|
||||
width: 100,
|
||||
width: 110,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
@@ -65,6 +65,7 @@ class SosConnect extends StatelessWidget {
|
||||
},
|
||||
child: const Icon(
|
||||
Icons.sos_sharp,
|
||||
size: 45,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
),
|
||||
@@ -95,15 +96,17 @@ class SosConnect extends StatelessWidget {
|
||||
.text);
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
launchCommunication(
|
||||
'whatsapp',
|
||||
'+962${box.read(BoxName.sosPhoneDriver)}', //todo add number from driver
|
||||
"${"Hello this is Driver".tr} ${box.read(BoxName.nameDriver)}.${" My current location is:".tr} https://www.google.com/maps/place/${Get.find<LocationController>().myLocation.latitude},${Get.find<LocationController>().myLocation.longitude}${" \nand I have a trip on".tr} ${AppInformation.appName} ${"App \nwith Passenger ".tr}${mapDriverController.name}");
|
||||
}
|
||||
launchCommunication(
|
||||
'whatsapp',
|
||||
'+962${box.read(BoxName.sosPhoneDriver)}', //todo add number from driver
|
||||
"Hello this is Driver ${box.read(BoxName.nameDriver)}. My current location is: https://www.google.com/maps/place/${Get.find<LocationController>().myLocation.latitude},${Get.find<LocationController>().myLocation.longitude} \nand I have a trip on ${AppInformation.appName} App \nwith Passenger ${mapDriverController.name}");
|
||||
},
|
||||
child: const Icon(
|
||||
FontAwesome.whatsapp,
|
||||
color: AppColor.greenColor,
|
||||
size: 45,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -171,7 +171,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
children: [
|
||||
TextSpan(
|
||||
text: hours > 1
|
||||
? '${'Your Ride Duration is '.tr}$hours H and $minutes m'
|
||||
? '${'Your Ride Duration is '.tr}$hours${' H and'.tr} $minutes m'
|
||||
: '${'Your Ride Duration is '.tr} $minutes m',
|
||||
style: AppStyle.title),
|
||||
TextSpan(text: ' Minutes'.tr, style: AppStyle.title),
|
||||
@@ -185,7 +185,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
kolor: AppColor.greenColor,
|
||||
title: 'Apply Order'.tr,
|
||||
title: 'Accept Order'.tr,
|
||||
onPressed: () async {
|
||||
box.write(BoxName.statusDriverLocation, 'on');
|
||||
|
||||
@@ -246,6 +246,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
'step3': myList[24].toString(),
|
||||
'step4': myList[25].toString(),
|
||||
'passengerWalletBurc': myList[26].toString(),
|
||||
'timeOfOrder': DateTime.now().toString(),
|
||||
});
|
||||
},
|
||||
),
|
||||
@@ -282,7 +283,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Refused Ride',
|
||||
'${box.read(BoxName.nameDriver)} rejct your order.',
|
||||
'${box.read(BoxName.nameDriver)} ${'rejct your order.'.tr}',
|
||||
arguments['DriverList'][9].toString(),
|
||||
// box.read(BoxName.tokenDriver).toString(),
|
||||
bodyToPassenger,
|
||||
|
||||
@@ -17,7 +17,7 @@ class SettingsCaptain extends StatelessWidget {
|
||||
ListTile(
|
||||
leading: const Icon(Icons.language),
|
||||
title: Text(
|
||||
'Language',
|
||||
'Language'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
onTap: () => Get.to(const Language()),
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/colors.dart';
|
||||
import '../../controller/home/map_passenger_controller.dart';
|
||||
import '../../main.dart';
|
||||
import '../../views/home/map_widget.dart/cancel_raide_page.dart';
|
||||
import '../../views/home/map_widget.dart/ride_begin_passenger.dart';
|
||||
|
||||
@@ -35,6 +37,7 @@ class MapPagePassenger extends StatelessWidget {
|
||||
const PickerIconOnMap(),
|
||||
// PickerAnimtionContainerFormPlaces(),
|
||||
const MainBottomMenuMap(),
|
||||
// NewMainBottomSheet(),
|
||||
const MapMenuWidget(),
|
||||
const MenuIconMapPageWidget(),
|
||||
buttomSheetMapPage(),
|
||||
@@ -67,10 +70,10 @@ class CancelRidePageShow extends StatelessWidget {
|
||||
(controller.data.isNotEmpty && controller.remainingTime > 0)
|
||||
// ||
|
||||
// controller.timeToPassengerFromDriverAfterApplied == 0
|
||||
? Positioned.directional(
|
||||
end: 10,
|
||||
top: 55,
|
||||
textDirection: TextDirection.ltr,
|
||||
? Positioned(
|
||||
right: box.read(BoxName.lang) != 'ar' ? 10 : null,
|
||||
left: box.read(BoxName.lang) == 'ar' ? 10 : null,
|
||||
top: 30,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
controller.changeCancelRidePageShow();
|
||||
@@ -83,7 +86,7 @@ class CancelRidePageShow extends StatelessWidget {
|
||||
padding: EdgeInsets.all(3),
|
||||
child: Icon(
|
||||
Icons.clear,
|
||||
size: 30,
|
||||
size: 40,
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -500,11 +500,11 @@ class Details extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'${'distance is'.tr} ${controller.data[0]['distance']['text']}',
|
||||
'${'Distance is'.tr} ${controller.data[0]['distance']['text']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'${'duration is'.tr} ${controller.data[0]['duration']['text']}',
|
||||
'${'Duration is'.tr} ${controller.data[0]['duration']['text']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
@@ -517,7 +517,7 @@ class Details extends StatelessWidget {
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'costDuration ${controller.averageDuration.toStringAsFixed(2)} is ${controller.costDuration.toStringAsFixed(2)} ',
|
||||
'${'Cost Duration'.tr} ${controller.averageDuration.toStringAsFixed(2)} is ${controller.costDuration.toStringAsFixed(2)} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
@@ -526,7 +526,7 @@ class Details extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'totalDriver ${controller.totalDriver.toStringAsFixed(2)}',
|
||||
'Total Driver ${controller.totalDriver.toStringAsFixed(2)}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
|
||||
180
lib/views/home/map_widget.dart/call_passenger_page.dart
Normal file
180
lib/views/home/map_widget.dart/call_passenger_page.dart
Normal file
@@ -0,0 +1,180 @@
|
||||
import 'dart:async';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
|
||||
|
||||
import '../../../../constant/api_key.dart';
|
||||
|
||||
const String appId = AK.agoraAppId;
|
||||
|
||||
class PassengerCallPage extends StatefulWidget {
|
||||
const PassengerCallPage({
|
||||
super.key,
|
||||
required this.channelName,
|
||||
required this.token,
|
||||
required this.remoteID,
|
||||
});
|
||||
final String channelName, token, remoteID;
|
||||
@override
|
||||
State<PassengerCallPage> createState() => _PassengerCallPageState();
|
||||
}
|
||||
|
||||
class _PassengerCallPageState extends State<PassengerCallPage> {
|
||||
int uid = 0;
|
||||
int? _remoteUid = 0; // uid of the remote user
|
||||
bool _isJoined = false; // Indicates if the local user has joined the channel
|
||||
late RtcEngine agoraEngine; // Agora engine instance
|
||||
|
||||
final GlobalKey<ScaffoldMessengerState> scaffoldMessengerKey =
|
||||
GlobalKey<ScaffoldMessengerState>(); // Global key to access the scaffold
|
||||
|
||||
showMessage(String message) {
|
||||
scaffoldMessengerKey.currentState?.showSnackBar(SnackBar(
|
||||
content: Text(message),
|
||||
));
|
||||
}
|
||||
|
||||
initAgora() async {
|
||||
await setupVoiceSDKEngine();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_remoteUid = int.parse(widget.remoteID);
|
||||
uid = int.parse(box.read(BoxName.phone));
|
||||
print('remoteid is ${widget.remoteID}');
|
||||
print('token is ${widget.token}');
|
||||
print('channelName is ${widget.channelName}');
|
||||
// Set up an instance of Agora engine
|
||||
initAgora();
|
||||
}
|
||||
|
||||
Future<void> setupVoiceSDKEngine() async {
|
||||
// retrieve or request microphone permission
|
||||
await [Permission.microphone].request();
|
||||
|
||||
//create an instance of the Agora engine
|
||||
agoraEngine = createAgoraRtcEngine();
|
||||
await agoraEngine.initialize(const RtcEngineContext(appId: AK.agoraAppId));
|
||||
print('eeeeeeeeeeeeeeeeeeee');
|
||||
print(agoraEngine);
|
||||
// Register the event handler
|
||||
agoraEngine.registerEventHandler(
|
||||
RtcEngineEventHandler(
|
||||
onJoinChannelSuccess: (RtcConnection connection, int elapsed) {
|
||||
showMessage(
|
||||
"Local user uid:${connection.localUid} joined the channel");
|
||||
setState(() {
|
||||
_isJoined = true;
|
||||
});
|
||||
},
|
||||
onUserJoined: (RtcConnection connection, int remoteUid, int elapsed) {
|
||||
showMessage("Remote user uid:$remoteUid joined the channel");
|
||||
setState(() {
|
||||
_remoteUid = remoteUid;
|
||||
});
|
||||
},
|
||||
onUserOffline: (RtcConnection connection, int? remoteUid,
|
||||
UserOfflineReasonType reason) {
|
||||
showMessage("Remote user uid:$remoteUid left the channel");
|
||||
setState(() {
|
||||
_remoteUid = null;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void join() async {
|
||||
// Set channel options including the client role and channel profile
|
||||
ChannelMediaOptions options = const ChannelMediaOptions(
|
||||
clientRoleType: ClientRoleType.clientRoleBroadcaster,
|
||||
channelProfile: ChannelProfileType.channelProfileCommunication,
|
||||
);
|
||||
|
||||
await agoraEngine.joinChannel(
|
||||
token: widget.token,
|
||||
channelId: widget.channelName,
|
||||
options: options,
|
||||
uid: uid,
|
||||
);
|
||||
}
|
||||
//https://console.agora.io/invite?sign=5e9e22d06f22caeeada9954c9e908572%253A5ba8aed978a35eab5a5113742502ded2a41478b2a81cb19c71a30776e125b58a
|
||||
|
||||
void leave() {
|
||||
setState(() {
|
||||
_isJoined = false;
|
||||
_remoteUid = null;
|
||||
});
|
||||
agoraEngine.leaveChannel();
|
||||
}
|
||||
|
||||
// Clean up the resources when you leave
|
||||
@override
|
||||
void dispose() async {
|
||||
await agoraEngine.leaveChannel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
// Build UI
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
scaffoldMessengerKey: scaffoldMessengerKey,
|
||||
home: MyScafolld(
|
||||
// appBar: AppBar(
|
||||
// title: const Text('Get started with Voice Calling'),
|
||||
// ),
|
||||
title: 'Voice Calling'.tr,
|
||||
isleading: true,
|
||||
body: [
|
||||
ListView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||
children: [
|
||||
// Status text
|
||||
Container(height: 40, child: Center(child: _status())),
|
||||
// Button Row
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
child: Text("Join".tr),
|
||||
onPressed: () => {join()},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
child: Text("Leave".tr),
|
||||
onPressed: () => {leave()},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _status() {
|
||||
String statusText;
|
||||
|
||||
if (!_isJoined)
|
||||
statusText = 'Join a channel';
|
||||
else if (_remoteUid == null)
|
||||
statusText = 'Waiting for a remote user to join...';
|
||||
else
|
||||
statusText = 'Connected to remote user, uid:$_remoteUid';
|
||||
|
||||
return Text(
|
||||
statusText,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:SEFER/constant/info.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
@@ -64,12 +65,12 @@ class CashConfirmPageShown extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Ride Wallet'.tr,
|
||||
'${AppInformation.appName} Wallet'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
// '${'Your Wallet balance is '.tr}JD ',
|
||||
'${'Your Wallet balance is '.tr} ${box.read(BoxName.passengerWalletTotal).toString()} \$',
|
||||
'${'Your Wallet balance is '.tr} ${box.read(BoxName.passengerWalletTotal).toString()}${' \$'.tr}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -52,14 +52,7 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
controller.dataCarsLocationByPassenger['message']
|
||||
[controller.carsOrder]['first_name']
|
||||
.toString() +
|
||||
' ' +
|
||||
controller
|
||||
.dataCarsLocationByPassenger['message']
|
||||
[controller.carsOrder]['last_name']
|
||||
.toString(),
|
||||
'${controller.dataCarsLocationByPassenger['message'][controller.carsOrder]['first_name']} ${controller.dataCarsLocationByPassenger['message'][controller.carsOrder]['last_name']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
|
||||
@@ -82,8 +82,7 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
List recentLocations = await sql.getCustomQuery(
|
||||
'''
|
||||
List recentLocations = await sql.getCustomQuery('''
|
||||
SELECT * FROM ${TableName.recentLocations}
|
||||
ORDER BY id DESC
|
||||
LIMIT 4
|
||||
@@ -143,7 +142,7 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
|
||||
// ignore: use_build_context_synchronously
|
||||
Toast.show(
|
||||
context,
|
||||
'${'You are Delete'.tr} ${recentLocations[index]['name']} from your list',
|
||||
'${'You are Delete'.tr} ${recentLocations[index]['name']} ${'from your list'.tr}',
|
||||
AppColor.redColor);
|
||||
// Get.snackbar('Deleted'.tr,
|
||||
// '${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/table_names.dart';
|
||||
import 'package:SEFER/views/widgets/my_textField.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
|
||||
@@ -66,7 +66,7 @@ GetBuilder<MapPassengerController> formSearchPlaces(int index) {
|
||||
controller.changePickerShown();
|
||||
},
|
||||
child: Text(
|
||||
'Choose from Map $index'.tr,
|
||||
'Choose from Map'.tr + ' $index'.tr,
|
||||
style:
|
||||
AppStyle.title.copyWith(color: AppColor.blueColor),
|
||||
),
|
||||
|
||||
@@ -48,7 +48,7 @@ class GoogleMapPassengerWidget extends StatelessWidget {
|
||||
Get.snackbar(
|
||||
'We Are Sorry That we dont have cars in your Location!'
|
||||
.tr,
|
||||
'message',
|
||||
'',
|
||||
colorText: AppColor.redColor,
|
||||
duration: const Duration(seconds: 11),
|
||||
instantInit: true,
|
||||
|
||||
@@ -7,7 +7,6 @@ import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/firebase/local_notification.dart';
|
||||
import '../../../controller/functions/tts.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../Captin/home_captain/driver_call_page.dart';
|
||||
@@ -113,7 +112,12 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
// NotificationController()
|
||||
// .showNotification('Order', 'hi this is', 'tone1');
|
||||
Get.to(() => DriverCallPage());
|
||||
// Get.to(() => CallPage(callID: controller.rideId));
|
||||
// PassengerCallPage(
|
||||
// channelName: '',
|
||||
// token: '',
|
||||
// remoteID: '',
|
||||
// )
|
||||
// Get.to(() => const CallPage());
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.call,
|
||||
|
||||
@@ -168,8 +168,7 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
icon:
|
||||
controller.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons
|
||||
.arrow_circle_up_rounded,
|
||||
Icons.ads_click,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
@@ -262,7 +261,8 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
controller.getCurrentLocationFormString();
|
||||
},
|
||||
child: Text(
|
||||
'From : ${controller.currentLocationString}'.tr,
|
||||
'From :'.tr +
|
||||
' ${controller.currentLocationString}'.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -113,21 +113,21 @@ class MapMenuWidget extends StatelessWidget {
|
||||
onTap: () {
|
||||
Get.to(() => const PassengerWallet());
|
||||
},
|
||||
title: 'My Wallet',
|
||||
title: 'My Wallet'.tr,
|
||||
icon: Icons.wallet,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () async {
|
||||
Get.to(() => const OrderHistory());
|
||||
},
|
||||
title: 'Order History',
|
||||
title: 'Order History'.tr,
|
||||
icon: Icons.history,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => const TaarifPage());
|
||||
},
|
||||
title: 'Tariff',
|
||||
title: 'Tariff'.tr,
|
||||
icon: Icons.money,
|
||||
),
|
||||
],
|
||||
@@ -164,21 +164,21 @@ class MapMenuWidget extends StatelessWidget {
|
||||
onTap: () {
|
||||
Get.to(const RegisterCaptin());
|
||||
},
|
||||
title: 'Captain',
|
||||
title: 'Driver'.tr,
|
||||
icon: WeatherIcons.wi_moon_14,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => FeedBackPage());
|
||||
},
|
||||
title: 'Feed Back',
|
||||
title: 'Feed Back'.tr,
|
||||
icon: Icons.feedback,
|
||||
),
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
Get.to(() => const PromosPassengerPage());
|
||||
},
|
||||
title: 'Promos',
|
||||
title: 'Promos'.tr,
|
||||
icon: Icons.monetization_on,
|
||||
),
|
||||
],
|
||||
|
||||
86
lib/views/home/map_widget.dart/new_main_bottom_sheet.dart
Normal file
86
lib/views/home/map_widget.dart/new_main_bottom_sheet.dart
Normal file
@@ -0,0 +1,86 @@
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class NewMainBottomSheet extends StatelessWidget {
|
||||
const NewMainBottomSheet({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Positioned(
|
||||
bottom: 0,
|
||||
left: 5,
|
||||
right: 5,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
width: Get.width,
|
||||
height: Get.height * .15,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('Home'.tr),
|
||||
const Icon(Icons.home),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('Work'.tr),
|
||||
const Icon(Icons.work_outline),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
color: AppColor.blueColor.withOpacity(.5),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Icon(Icons.search),
|
||||
Text(
|
||||
"${"Where you want go ".tr}${box.read(BoxName.name)} ?",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ class PaymentMethodPage extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'My Cared'.tr,
|
||||
'My Card'.tr,
|
||||
style: AppStyle.title.copyWith(fontSize: 22),
|
||||
),
|
||||
IconButton(
|
||||
@@ -170,7 +170,7 @@ class MyCreditCardWidget extends StatelessWidget {
|
||||
SizedBox(
|
||||
width: Get.width * .25,
|
||||
child: Text(
|
||||
'Card Number',
|
||||
'Card Number'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -43,7 +43,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
||||
controller.isPickerShown
|
||||
? const SizedBox()
|
||||
: Text(
|
||||
'Hi, Where to ',
|
||||
'Hi, Where to '.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Column(
|
||||
|
||||
@@ -11,7 +11,6 @@ import '../../../controller/payment/payment_controller.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import '../../widgets/my_scafold.dart';
|
||||
import '../map_widget.dart/payment_method.page.dart';
|
||||
import 'passenger_wallet_dialoge.dart';
|
||||
|
||||
class PassengerWallet extends StatelessWidget {
|
||||
@@ -22,7 +21,7 @@ class PassengerWallet extends StatelessWidget {
|
||||
Get.put(PaymentController());
|
||||
Get.put(CreditCardController());
|
||||
return MyScafolld(
|
||||
title: 'My Wallet',
|
||||
title: 'My Wallet'.tr,
|
||||
isleading: true,
|
||||
body: [
|
||||
GetBuilder<PaymentController>(
|
||||
|
||||
@@ -126,7 +126,7 @@ class PassengerWalletDialoge extends StatelessWidget {
|
||||
const Spacer(),
|
||||
MyElevatedButton(
|
||||
kolor: AppColor.blueColor,
|
||||
title: 'Pay with Your PayPal'.tr,
|
||||
title: '${'Pay with Your'.tr} PayPal',
|
||||
onPressed: () {
|
||||
if (controller.selectedAmount != 0) {
|
||||
controller.makePaymentPayPal(context);
|
||||
@@ -145,7 +145,9 @@ class PassengerWalletDialoge extends StatelessWidget {
|
||||
controller.makePaymentStripe(
|
||||
controller.selectedAmount!
|
||||
.toDouble(), // Convert int to double
|
||||
'USD', () {
|
||||
// 'EGP', () {
|
||||
// 'USD', () {
|
||||
'JOD', () {
|
||||
controller.addPassengerWallet();
|
||||
controller.changePromoSheetDialogue();
|
||||
controller.getPassengerWallet();
|
||||
|
||||
54
lib/views/home/my_wallet/payment_history_driver_page.dart
Normal file
54
lib/views/home/my_wallet/payment_history_driver_page.dart
Normal file
@@ -0,0 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../../controller/payment/driver_payment_controller.dart';
|
||||
|
||||
class PaymentHistoryDriverPage extends StatelessWidget {
|
||||
const PaymentHistoryDriverPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(DriverWalletHistoryController());
|
||||
return MyScafolld(
|
||||
title: 'Payment History'.tr,
|
||||
body: [
|
||||
GetBuilder<DriverWalletHistoryController>(
|
||||
builder: (controller) => controller.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: ListView.builder(
|
||||
itemCount: controller.archive.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var list = controller.archive[index];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: double.parse(list['balance']) < 0
|
||||
? AppColor.redColor.withOpacity(.4)
|
||||
: AppColor.greenColor.withOpacity(.4)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
list['balance'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
list['created_at'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ class PointsCaptain extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'$countPoint Point',
|
||||
'$countPoint ${'Point'.tr}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:SEFER/views/home/my_wallet/payment_history_driver_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
@@ -23,7 +24,7 @@ class WaletCaptain extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapPassengerController());
|
||||
return MyScafolld(
|
||||
title: 'Captain Wallet'.tr,
|
||||
title: 'Driver Wallet'.tr,
|
||||
body: [
|
||||
GetBuilder<CaptainWalletController>(
|
||||
builder: (captainWalletController) => captainWalletController
|
||||
@@ -37,16 +38,23 @@ class WaletCaptain extends StatelessWidget {
|
||||
const SizedBox(),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration.copyWith(
|
||||
color: double.parse(
|
||||
captainWalletController.totalPoints) <
|
||||
100
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
color: double.parse(captainWalletController
|
||||
.totalPoints) <
|
||||
0 &&
|
||||
double.parse(captainWalletController
|
||||
.totalPoints) >
|
||||
-500
|
||||
? AppColor.yellowColor
|
||||
: double.parse(captainWalletController
|
||||
.totalPoints) <
|
||||
-500
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text(
|
||||
'Total Points is ${captainWalletController.totalPoints.toString()} 💎',
|
||||
'${'Total Points is'.tr} ${captainWalletController.totalPoints.toString()} 💎',
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
),
|
||||
@@ -56,9 +64,10 @@ class WaletCaptain extends StatelessWidget {
|
||||
),
|
||||
double.parse(captainWalletController.totalPoints
|
||||
.toString()) <
|
||||
100
|
||||
-500
|
||||
? MyElevatedButton(
|
||||
title: 'Charge your Account', onPressed: () {})
|
||||
title: 'Charge your Account'.tr,
|
||||
onPressed: () {})
|
||||
: const SizedBox(),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
@@ -75,7 +84,7 @@ class WaletCaptain extends StatelessWidget {
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Total Budget from trips is ',
|
||||
'Total Budget from trips is '.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Container(
|
||||
@@ -86,8 +95,9 @@ class WaletCaptain extends StatelessWidget {
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.snackbar(
|
||||
'Total Amount: ${captainWalletController.totalAmount}\$',
|
||||
'This amount for all trip I get from Passengers',
|
||||
'${'Total Amount:'.tr} ${captainWalletController.totalAmount}\$',
|
||||
'This amount for all trip I get from Passengers'
|
||||
.tr,
|
||||
duration:
|
||||
const Duration(seconds: 6),
|
||||
backgroundColor:
|
||||
@@ -112,7 +122,8 @@ class WaletCaptain extends StatelessWidget {
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Total Budget from trips by\nCredit card is ',
|
||||
'Total Budget from trips by\nCredit card is '
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Container(
|
||||
@@ -125,9 +136,11 @@ class WaletCaptain extends StatelessWidget {
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.snackbar(
|
||||
'Total Amount: ${captainWalletController.totalAmountVisa}\$',
|
||||
'This amount for all trip I get from Passengers and Collected For me in ${AppInformation.appName} Wallet'
|
||||
.tr,
|
||||
'${'Total Amount:'.tr} ${captainWalletController.totalAmountVisa}\$',
|
||||
'This amount for all trip I get from Passengers and Collected For me in'
|
||||
.tr +
|
||||
' ${AppInformation.appName} Wallet'
|
||||
.tr,
|
||||
duration:
|
||||
const Duration(seconds: 6),
|
||||
backgroundColor:
|
||||
@@ -164,8 +177,29 @@ class WaletCaptain extends StatelessWidget {
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Pay',
|
||||
onPressed: () async {
|
||||
await captainWalletController
|
||||
.payFromBudget();
|
||||
if (double.parse(
|
||||
captainWalletController
|
||||
.amountFromBudgetController
|
||||
.text) <
|
||||
double.parse(
|
||||
captainWalletController
|
||||
.totalAmount)) {
|
||||
await captainWalletController
|
||||
.payFromBudget();
|
||||
} else {
|
||||
Get.back();
|
||||
Get.snackbar(
|
||||
'Your Budget less than needed'
|
||||
.tr,
|
||||
'',
|
||||
duration: const Duration(
|
||||
seconds: 3),
|
||||
backgroundColor:
|
||||
AppColor.redColor,
|
||||
snackPosition:
|
||||
SnackPosition.BOTTOM,
|
||||
);
|
||||
}
|
||||
}),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Cancel'.tr,
|
||||
@@ -263,9 +297,8 @@ class WaletCaptain extends StatelessWidget {
|
||||
kolor: AppColor.blueColor,
|
||||
title: 'Payment History'.tr,
|
||||
onPressed: () {
|
||||
// Get.to(
|
||||
// () => const PaymentHistoryPassengerPage(),
|
||||
// transition: Transition.size);
|
||||
Get.to(() => const PaymentHistoryDriverPage(),
|
||||
transition: Transition.size);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -22,9 +22,9 @@ class FeedBackPage extends StatelessWidget {
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: feedBackController.feedbackController,
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
hintText: 'Enter your feedback here',
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
hintText: 'Enter your feedback here'.tr,
|
||||
labelText: 'Feedback',
|
||||
),
|
||||
validator: (value) {
|
||||
@@ -47,7 +47,7 @@ class FeedBackPage extends StatelessWidget {
|
||||
feedBackController.formKey.currentState!.reset();
|
||||
}
|
||||
},
|
||||
title: 'Submit Feedback'.tr,
|
||||
title: 'Submit '.tr,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -62,7 +62,7 @@ class OrderHistory extends StatelessWidget {
|
||||
showInBrowser(mapUrl);
|
||||
},
|
||||
child: Text(
|
||||
'Click here to Show it in Map',
|
||||
'Click here to Show it in Map'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
@@ -78,14 +78,14 @@ class OrderHistory extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
rides['status'],
|
||||
style: rides['status'] != 'Canceled'
|
||||
style: rides['status'] != 'Canceled'.tr
|
||||
? AppStyle.subtitle.copyWith(
|
||||
color: AppColor.greenColor)
|
||||
: AppStyle.subtitle
|
||||
.copyWith(color: AppColor.redColor),
|
||||
),
|
||||
Text(
|
||||
'Price is ${rides['price']}',
|
||||
'${'Price is'.tr} ${rides['price']}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -11,8 +11,6 @@ import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:SEFER/views/widgets/my_textField.dart';
|
||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../../constant/links.dart';
|
||||
import '../../../controller/functions/crud.dart';
|
||||
import '../../../controller/functions/log_out.dart';
|
||||
|
||||
class PassengerProfilePage extends StatelessWidget {
|
||||
|
||||
@@ -42,16 +42,18 @@ class ProfileCaptain extends StatelessWidget {
|
||||
box.read(BoxName.lastNameDriver).toString(),
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Email is :${box.read(BoxName.emailDriver)}',
|
||||
Text('${'Email is'.tr} :${box.read(BoxName.emailDriver)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Phone Number is :${box.read(BoxName.phoneDriver)}',
|
||||
Text(
|
||||
'${'Phone Number is'.tr} :${box.read(BoxName.phoneDriver)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Date of Birth is :${box.read(BoxName.dobDriver)}',
|
||||
Text(
|
||||
'${'Date of Birth is'.tr} :${box.read(BoxName.dobDriver)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Sex is :${box.read(BoxName.sexDriver)}',
|
||||
Text('${'Sex is '.tr}:${box.read(BoxName.sexDriver)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
const Divider(
|
||||
@@ -63,23 +65,23 @@ class ProfileCaptain extends StatelessWidget {
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Car Details'.tr, style: AppStyle.headTitle2),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('VIN is :${box.read(BoxName.vin)}',
|
||||
Text('${'VIN is'.tr} :${box.read(BoxName.vin)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Color is :${box.read(BoxName.color)}',
|
||||
Text('${'Color is '.tr} :${box.read(BoxName.color)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Make is :${box.read(BoxName.make)}',
|
||||
Text('${'Make is '.tr}:${box.read(BoxName.make)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Model is :${box.read(BoxName.model)}',
|
||||
Text('${'Model is'.tr} :${box.read(BoxName.model)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Year is :${box.read(BoxName.year)}',
|
||||
Text('${'Year is'.tr} :${box.read(BoxName.year)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'Expiration Date :${box.read(BoxName.expirationDate)}',
|
||||
'${'Expiration Date '.tr} :${box.read(BoxName.expirationDate)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
],
|
||||
@@ -94,7 +96,7 @@ class ProfileCaptain extends StatelessWidget {
|
||||
builder: (controller) => IconButton(
|
||||
onPressed: () {
|
||||
Get.defaultDialog(
|
||||
title: 'Edit Your data',
|
||||
title: 'Edit Your data'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: SizedBox(
|
||||
height: Get.height * .4,
|
||||
@@ -103,38 +105,38 @@ class ProfileCaptain extends StatelessWidget {
|
||||
children: [
|
||||
MyTextForm(
|
||||
controller: controller.vin,
|
||||
hint: 'write vin for your car',
|
||||
label: 'VIN',
|
||||
hint: 'write vin for your car'.tr,
|
||||
label: 'VIN'.tr,
|
||||
type: TextInputType.emailAddress,
|
||||
),
|
||||
MyTextForm(
|
||||
controller: controller.color,
|
||||
hint: 'write Color for your car',
|
||||
label: 'Color',
|
||||
hint: 'write Color for your car'.tr,
|
||||
label: 'Color'.tr,
|
||||
type: TextInputType.emailAddress,
|
||||
),
|
||||
MyTextForm(
|
||||
controller: controller.make,
|
||||
hint: 'write Make for your car',
|
||||
label: 'Make',
|
||||
hint: 'write Make for your car'.tr,
|
||||
label: 'Make'.tr,
|
||||
type: TextInputType.emailAddress,
|
||||
),
|
||||
MyTextForm(
|
||||
controller: controller.model,
|
||||
hint: 'write Model for your car',
|
||||
label: 'Model',
|
||||
hint: 'write Model for your car'.tr,
|
||||
label: 'Model'.tr,
|
||||
type: TextInputType.emailAddress,
|
||||
),
|
||||
MyTextForm(
|
||||
controller: controller.year,
|
||||
hint: 'write Year for your car',
|
||||
label: 'Year',
|
||||
hint: 'write Year for your car'.tr,
|
||||
label: 'Year'.tr,
|
||||
type: TextInputType.number,
|
||||
),
|
||||
MyTextForm(
|
||||
controller: controller.expirationDate,
|
||||
hint: 'write Expiration Date for your car',
|
||||
label: 'Expiration Date',
|
||||
hint: 'write Expiration Date for your car'.tr,
|
||||
label: 'Expiration Date'.tr,
|
||||
type: TextInputType.datetime),
|
||||
MyElevatedButton(
|
||||
title: 'Update'.tr,
|
||||
|
||||
@@ -25,25 +25,26 @@ class TaarifPage extends StatelessWidget {
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
children: [
|
||||
Text('Minimum fare'.tr, style: AppStyle.title),
|
||||
Text('1 \$', style: AppStyle.title),
|
||||
Text('1 ${'JOD'.tr}', style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
TableRow(
|
||||
children: [
|
||||
Text('Maximum fare'.tr, style: AppStyle.title),
|
||||
Text('200 \$', style: AppStyle.title),
|
||||
Text('200 ${'JOD'.tr}', style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
TableRow(
|
||||
children: [
|
||||
Text('Flag-down fee'.tr, style: AppStyle.title),
|
||||
Text('0.47 \$', style: AppStyle.title),
|
||||
Text('0.47 ${'JOD'.tr}', style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
TableRow(
|
||||
children: [
|
||||
Text('0.05 \$/min and 0.21 \$/km', style: AppStyle.title),
|
||||
Text('Including Tax', style: AppStyle.title),
|
||||
Text('0.05 ${'JOD'.tr}/min and 0.21 ${'JOD'.tr}/km',
|
||||
style: AppStyle.title),
|
||||
Text('Including Tax'.tr, style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -53,19 +54,21 @@ class TaarifPage extends StatelessWidget {
|
||||
const SizedBox(height: 10),
|
||||
Text('4.17%', style: AppStyle.title),
|
||||
const SizedBox(height: 20),
|
||||
Text('Morning', style: AppStyle.headTitle2),
|
||||
Text('Morning'.tr, style: AppStyle.headTitle2),
|
||||
const SizedBox(height: 10),
|
||||
Text('from 07:30 till 10:30 (Thursday, Friday, Saturday, Monday)',
|
||||
Text(
|
||||
'from 07:30 till 10:30 (Thursday, Friday, Saturday, Monday)'.tr,
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 20),
|
||||
Text('Evening', style: AppStyle.headTitle2),
|
||||
Text('Evening'.tr, style: AppStyle.headTitle2),
|
||||
const SizedBox(height: 10),
|
||||
Text('from 12:00 till 15:00 (Thursday, Friday, Saturday, Monday)',
|
||||
Text(
|
||||
'from 12:00 till 15:00 (Thursday, Friday, Saturday, Monday)'.tr,
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 20),
|
||||
Text('Night', style: AppStyle.headTitle2),
|
||||
Text('Night'.tr, style: AppStyle.headTitle2),
|
||||
const SizedBox(height: 10),
|
||||
Text('from 23:59 till 05:30', style: AppStyle.title),
|
||||
Text('from 23:59 till 05:30'.tr, style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
56
pubspec.lock
56
pubspec.lock
@@ -1168,6 +1168,30 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.9"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.0"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1260,26 +1284,26 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
|
||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.16"
|
||||
version: "0.12.16+1"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
|
||||
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.0"
|
||||
version: "0.8.0"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
|
||||
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.11.0"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1332,10 +1356,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path
|
||||
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.3"
|
||||
version: "1.9.0"
|
||||
path_parsing:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1837,6 +1861,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "13.0.0"
|
||||
wakelock_plus:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1861,14 +1893,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.0"
|
||||
web_socket_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user