2/22/1
This commit is contained in:
@@ -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),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user