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