4/22/1
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:SEFER/constant/api_key.dart';
|
||||
import 'package:SEFER/controller/functions/crud.dart';
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
@@ -22,9 +23,16 @@ class CallController extends GetxController {
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
channelName = Get.find<MapDriverController>().rideId; // 'sefer300'; //
|
||||
remoteUid = int.parse(Get.find<MapDriverController>().passengerPhone);
|
||||
uid = int.parse(box.read(BoxName.phoneDriver));
|
||||
channelName = box.read(BoxName.driverID) != null
|
||||
? Get.find<MapDriverController>().rideId
|
||||
: Get.find<MapPassengerController>().rideId; // 'sefer300'; //
|
||||
remoteUid = box.read(BoxName.driverID) != null
|
||||
? int.parse(box.read(BoxName.phoneDriver))
|
||||
: int.parse(box.read(BoxName.phone));
|
||||
uid = box.read(BoxName.driverID) == null
|
||||
? int.parse(box.read(BoxName.phoneDriver))
|
||||
: int.parse(box.read(BoxName.phone));
|
||||
|
||||
initAgoraFull();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,6 @@ 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 {
|
||||
const CallPage({super.key});
|
||||
|
||||
@@ -33,10 +30,13 @@ GetBuilder<HomeCaptainController> callPage() {
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Text(
|
||||
'No SIM card, no problem! Call your driver directly through our app. We use advanced technology to ensure your privacy.'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'No SIM card, no problem! Call your driver directly through our app. We use advanced technology to ensure your privacy.'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import 'package:SEFER/controller/functions/tts.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/controller/home/payment/captain_wallet_controller.dart';
|
||||
|
||||
@@ -36,12 +38,33 @@ class ConnectWidget extends StatelessWidget {
|
||||
? 'You dont have Points'.tr
|
||||
: 'You Are Stopped For this Day !'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Text(
|
||||
double.parse(captainWalletController.totalPoints) < -300
|
||||
? 'You must be recharge your Account'.tr
|
||||
: 'You Refused 3 Rides this Day that is the reason \nSee you Tomorrow!'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
content: Column(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
double.parse(
|
||||
captainWalletController.totalPoints) <
|
||||
-300
|
||||
? await Get.find<TextToSpeechController>()
|
||||
.speakText(
|
||||
'You must be recharge your Account'
|
||||
.tr)
|
||||
: await Get.find<TextToSpeechController>()
|
||||
.speakText(
|
||||
'You Refused 3 Rides this Day that is the reason \nSee you Tomorrow!'
|
||||
.tr);
|
||||
},
|
||||
icon: const Icon(Icons.headphones),
|
||||
),
|
||||
Text(
|
||||
double.parse(captainWalletController.totalPoints) <
|
||||
-300
|
||||
? '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) <
|
||||
@@ -60,7 +83,10 @@ class ConnectWidget extends StatelessWidget {
|
||||
}));
|
||||
},
|
||||
color: CupertinoColors.destructiveRed,
|
||||
child: Text('You are Stopped'.tr),
|
||||
child: Text(
|
||||
'You are Stopped'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
: CupertinoButton(
|
||||
onPressed: homeCaptainController.onButtonSelected,
|
||||
|
||||
@@ -166,12 +166,13 @@ class _PassengerCallPageState extends State<PassengerCallPage> {
|
||||
Widget _status() {
|
||||
String statusText;
|
||||
|
||||
if (!_isJoined)
|
||||
statusText = 'Join a channel';
|
||||
else if (_remoteUid == null)
|
||||
statusText = 'Waiting for a remote user to join...';
|
||||
else
|
||||
if (!_isJoined) {
|
||||
statusText = 'Join a channel'.tr;
|
||||
} else if (_remoteUid == null) {
|
||||
statusText = 'Waiting for a remote user to join...'.tr;
|
||||
} else {
|
||||
statusText = 'Connected to remote user, uid:$_remoteUid';
|
||||
}
|
||||
|
||||
return Text(
|
||||
statusText,
|
||||
|
||||
Reference in New Issue
Block a user