3/1/1
This commit is contained in:
1
.env
1
.env
@@ -18,4 +18,5 @@ claudeAiAPI=sk-ant-api03-bHIbOKhHWIsTCNmODYGGucds_GPQplU-7_8SJER79K_ANU67ijWIZZi
|
|||||||
payPalClientId=AWj9MdPaA5Djpx8gOkvBn2qhP-3KvfB6W-l8USTsm19Xi2NhkNkE9QzosOvTPTsKjCMNffgpqStUA1-x
|
payPalClientId=AWj9MdPaA5Djpx8gOkvBn2qhP-3KvfB6W-l8USTsm19Xi2NhkNkE9QzosOvTPTsKjCMNffgpqStUA1-x
|
||||||
payPalSecret=EKkasSl9O61lrfrbaJfXp1B-CIs2Rv71J0WPouxxugi38DsWaMhWpovJxN2ftYPQ0l6v9eoBvnyWkemp
|
payPalSecret=EKkasSl9O61lrfrbaJfXp1B-CIs2Rv71J0WPouxxugi38DsWaMhWpovJxN2ftYPQ0l6v9eoBvnyWkemp
|
||||||
geminiApi=AIzaSyADz49pIaeO1grPEcpV8HNCJijzekd037o
|
geminiApi=AIzaSyADz49pIaeO1grPEcpV8HNCJijzekd037o
|
||||||
|
geminiApiMasa=AIzaSyAOxZ8NLyGzqXEIV1xSv5-t7MHctu1VQrA
|
||||||
|
|
||||||
|
|||||||
@@ -9,17 +9,17 @@ if (localPropertiesFile.exists()) {
|
|||||||
|
|
||||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||||
if (flutterRoot == null) {
|
if (flutterRoot == null) {
|
||||||
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||||
}
|
}
|
||||||
|
|
||||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||||
if (flutterVersionCode == null) {
|
if (flutterVersionCode == null) {
|
||||||
flutterVersionCode = '11'
|
flutterVersionCode = '12'
|
||||||
}
|
}
|
||||||
|
|
||||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||||
if (flutterVersionName == null) {
|
if (flutterVersionName == null) {
|
||||||
flutterVersionName = '1.1.1'
|
flutterVersionName = '1.1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
@@ -55,8 +55,8 @@ android {
|
|||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdkVersion 26
|
minSdkVersion 26
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode 18
|
versionCode 20
|
||||||
versionName '1.4.2'
|
versionName '1.4.4'
|
||||||
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,6 @@ android {
|
|||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class BoxName {
|
class BoxName {
|
||||||
static const String driverID = "driverID";
|
static const String driverID = "driverID";
|
||||||
static const String countryCode = "countryCode";
|
static const String countryCode = "countryCode";
|
||||||
|
static const String googlaMapApp = "googlaMapApp";
|
||||||
|
|
||||||
static const String lang = "lang";
|
static const String lang = "lang";
|
||||||
static const String statusDriverLocation = "statusDriverLocation";
|
static const String statusDriverLocation = "statusDriverLocation";
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ class AppLink {
|
|||||||
// ===========================================
|
// ===========================================
|
||||||
static String pathImage = "$server/upload/types/";
|
static String pathImage = "$server/upload/types/";
|
||||||
static String uploadImage = "$server/uploadImage.php";
|
static String uploadImage = "$server/uploadImage.php";
|
||||||
|
static String uploadImage1 = "$server/uploadImage1.php";
|
||||||
static String uploadImagePortrate = "$server/uploadImagePortrate.php";
|
static String uploadImagePortrate = "$server/uploadImagePortrate.php";
|
||||||
static String uploadImageType = "$server/uploadImageType.php";
|
static String uploadImageType = "$server/uploadImageType.php";
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
|
import 'package:SEFER/main.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'colors.dart';
|
import 'colors.dart';
|
||||||
@@ -7,22 +9,38 @@ class AppStyle {
|
|||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 40,
|
fontSize: 40,
|
||||||
color: AppColor.accentColor,
|
color: AppColor.accentColor,
|
||||||
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
fontFamily: box.read(BoxName.lang) == 'en'
|
||||||
|
? GoogleFonts.josefinSans().fontFamily
|
||||||
|
: box.read(BoxName.lang) == 'ar'
|
||||||
|
? GoogleFonts.amiri().fontFamily
|
||||||
|
: GoogleFonts.josefinSans().fontFamily);
|
||||||
static TextStyle headTitle2 = TextStyle(
|
static TextStyle headTitle2 = TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 26,
|
fontSize: 26,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
fontFamily: box.read(BoxName.lang) == 'en'
|
||||||
|
? GoogleFonts.josefinSans().fontFamily
|
||||||
|
: box.read(BoxName.lang) == 'ar'
|
||||||
|
? GoogleFonts.amiri().fontFamily
|
||||||
|
: GoogleFonts.josefinSans().fontFamily);
|
||||||
static TextStyle title = TextStyle(
|
static TextStyle title = TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
fontFamily: box.read(BoxName.lang) == 'en'
|
||||||
|
? GoogleFonts.josefinSans().fontFamily
|
||||||
|
: box.read(BoxName.lang) == 'ar'
|
||||||
|
? GoogleFonts.amiri().fontFamily
|
||||||
|
: GoogleFonts.josefinSans().fontFamily);
|
||||||
static TextStyle subtitle = TextStyle(
|
static TextStyle subtitle = TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
fontFamily: box.read(BoxName.lang) == 'en'
|
||||||
|
? GoogleFonts.josefinSans().fontFamily
|
||||||
|
: box.read(BoxName.lang) == 'ar'
|
||||||
|
? GoogleFonts.amiri().fontFamily
|
||||||
|
: GoogleFonts.josefinSans().fontFamily);
|
||||||
static TextStyle number = TextStyle(
|
static TextStyle number = TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
|
import 'package:SEFER/controller/auth/captin/login_captin_controller.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
@@ -13,6 +14,7 @@ import 'package:SEFER/views/auth/captin/verify_email_captain.dart';
|
|||||||
|
|
||||||
import '../../../views/auth/captin/ai_page.dart';
|
import '../../../views/auth/captin/ai_page.dart';
|
||||||
import '../../../views/auth/captin/car_license_page.dart';
|
import '../../../views/auth/captin/car_license_page.dart';
|
||||||
|
import '../../../views/home/Captin/home_captain/home_captin.dart';
|
||||||
|
|
||||||
class RegisterCaptainController extends GetxController {
|
class RegisterCaptainController extends GetxController {
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
@@ -67,14 +69,21 @@ class RegisterCaptainController extends GetxController {
|
|||||||
|
|
||||||
sendVerifications() async {
|
sendVerifications() async {
|
||||||
var res = await CRUD().post(link: AppLink.verifyEmail, payload: {
|
var res = await CRUD().post(link: AppLink.verifyEmail, payload: {
|
||||||
'email': emailController.text,
|
'email': emailController.text.isEmpty
|
||||||
|
? Get.find<LoginCaptinController>().emailController.text.toString()
|
||||||
|
: emailController.text,
|
||||||
'token': verifyCode.text,
|
'token': verifyCode.text,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
|
if (Get.find<LoginCaptinController>().emailController.text.toString() !=
|
||||||
|
'') {
|
||||||
|
Get.offAll(() => HomeCaptain());
|
||||||
|
} else {
|
||||||
Get.to(() => CarLicensePage());
|
Get.to(() => CarLicensePage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void nextToAIDetection() async {
|
void nextToAIDetection() async {
|
||||||
//Todo dont forget this
|
//Todo dont forget this
|
||||||
|
|||||||
@@ -39,6 +39,11 @@ class LoginController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void saveCountryCode(String countryCode) {
|
||||||
|
box.write(BoxName.countryCode, countryCode);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
void adminDashboardOpen() async {
|
void adminDashboardOpen() async {
|
||||||
if (formKeyAdmin.currentState!.validate()) {
|
if (formKeyAdmin.currentState!.validate()) {
|
||||||
await DeviceInfoPlus.getDeviceInfo();
|
await DeviceInfoPlus.getDeviceInfo();
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/constant/links.dart';
|
|
||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:SEFER/env/env.dart';
|
import 'package:SEFER/env/env.dart';
|
||||||
|
|
||||||
import '../../constant/api_key.dart';
|
import '../../constant/api_key.dart';
|
||||||
import '../home/captin/map_driver_controller.dart';
|
|
||||||
|
|
||||||
class CRUD {
|
class CRUD {
|
||||||
Future<dynamic> get({
|
Future<dynamic> get({
|
||||||
@@ -32,8 +30,9 @@ class CRUD {
|
|||||||
);
|
);
|
||||||
print("-----request----" + response.request.toString());
|
print("-----request----" + response.request.toString());
|
||||||
// print("-----headers-----" + response.headers.toString());
|
// print("-----headers-----" + response.headers.toString());
|
||||||
// print("-----payload-----" + payload.toString());
|
print("-----payload-----" + payload.toString());
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
// print(response.body);
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
// print(jsonData);
|
// print(jsonData);
|
||||||
@@ -178,6 +177,7 @@ class CRUD {
|
|||||||
print(payload);
|
print(payload);
|
||||||
|
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
|
// print(jsonData);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
// Get.snackbar(
|
// Get.snackbar(
|
||||||
@@ -205,7 +205,8 @@ class CRUD {
|
|||||||
request.headers.addAll(headers);
|
request.headers.addAll(headers);
|
||||||
|
|
||||||
http.StreamedResponse response = await request.send();
|
http.StreamedResponse response = await request.send();
|
||||||
|
// print(request.body);
|
||||||
|
// print(response);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
print(await response.stream.bytesToString());
|
print(await response.stream.bytesToString());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:image_cropper/image_cropper.dart';
|
import 'package:image_cropper/image_cropper.dart';
|
||||||
@@ -10,7 +11,7 @@ import 'package:path_provider/path_provider.dart';
|
|||||||
import '../../constant/api_key.dart';
|
import '../../constant/api_key.dart';
|
||||||
import '../../constant/colors.dart';
|
import '../../constant/colors.dart';
|
||||||
|
|
||||||
class ContentController extends GetxController {
|
class AI extends GetxController {
|
||||||
final picker = ImagePicker();
|
final picker = ImagePicker();
|
||||||
Map<String, dynamic> responseMap = {};
|
Map<String, dynamic> responseMap = {};
|
||||||
Map<String, dynamic> responseCarLicenseMap = {};
|
Map<String, dynamic> responseCarLicenseMap = {};
|
||||||
@@ -157,7 +158,7 @@ class ContentController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> generateDriverLicenseJordanContent() async {
|
Future<void> getDriverLicenseJordanContent() async {
|
||||||
await pickImage();
|
await pickImage();
|
||||||
isloading = true;
|
isloading = true;
|
||||||
update();
|
update();
|
||||||
@@ -253,7 +254,7 @@ class ContentController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> generateCarLicenseJordanContent() async {
|
Future<void> getCarLicenseJordanContent() async {
|
||||||
await pickImage();
|
await pickImage();
|
||||||
isloading = true;
|
isloading = true;
|
||||||
update();
|
update();
|
||||||
@@ -273,7 +274,114 @@ class ContentController extends GetxController {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'text':
|
'text':
|
||||||
'write json output of this car license in jordan json contain name , address , car kind ,car color , car year , car plate ,registration adjective , using ,expire date of license and make date format like YYYY-MM-DD .dont add data else this image',
|
'''Extract the following information from the front face of the Jordanian ID card:
|
||||||
|
Name
|
||||||
|
National ID number
|
||||||
|
Gender
|
||||||
|
Date of birth
|
||||||
|
Output the extracted information in the following JSON format''',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'generationConfig': {
|
||||||
|
'temperature': 0.4,
|
||||||
|
'topK': 32,
|
||||||
|
'topP': 1,
|
||||||
|
'maxOutputTokens': 4096,
|
||||||
|
'stopSequences': [],
|
||||||
|
},
|
||||||
|
'safetySettings': [
|
||||||
|
{
|
||||||
|
'category': 'HARM_CATEGORY_HARASSMENT',
|
||||||
|
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'category': 'HARM_CATEGORY_HATE_SPEECH',
|
||||||
|
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'category': 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
|
||||||
|
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'category': 'HARM_CATEGORY_DANGEROUS_CONTENT',
|
||||||
|
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
print(requestBody);
|
||||||
|
|
||||||
|
final response = await http.post(
|
||||||
|
Uri.parse(
|
||||||
|
// 'https://${API_ENDPOINT}/v1/projects/${PROJECT_ID}/locations/${LOCATION_ID}/publishers/google/models/${MODEL_ID}:streamGenerateContent'),
|
||||||
|
'https://generativelanguage.googleapis.com/v1beta/models/gemini-pro-vision:generateContent?key=${AK.geminiApi}'),
|
||||||
|
headers: {'Content-Type': 'application/json'},
|
||||||
|
body: requestBody,
|
||||||
|
);
|
||||||
|
isloading = false;
|
||||||
|
update();
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
var responseData = jsonDecode(response.body);
|
||||||
|
// Process the responseData as needed
|
||||||
|
// print(responseData);
|
||||||
|
|
||||||
|
var result =
|
||||||
|
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
|
// print(jsonEncode(result));
|
||||||
|
// print((result));
|
||||||
|
// print(result['dob']);
|
||||||
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
|
String? jsonString =
|
||||||
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
|
|
||||||
|
if (jsonString != null) {
|
||||||
|
// Convert the JSON object to a String
|
||||||
|
jsonString = jsonEncode(json.decode(jsonString));
|
||||||
|
responseCarLicenseMap = jsonDecode(jsonString);
|
||||||
|
print(jsonString);
|
||||||
|
print(responseCarLicenseMap);
|
||||||
|
print(responseCarLicenseMap['plate_number']);
|
||||||
|
} else {
|
||||||
|
print("JSON string not found");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rest of your code...
|
||||||
|
} else {
|
||||||
|
print('Request failed with status: ${response.statusCode}');
|
||||||
|
print('Request failed with status: ${response.body}');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print('No image selected');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> jordanID() async {
|
||||||
|
await pickImage();
|
||||||
|
isloading = true;
|
||||||
|
update();
|
||||||
|
if (image != null) {
|
||||||
|
final imageBytes = await image.readAsBytes();
|
||||||
|
final imageData = base64Encode(imageBytes);
|
||||||
|
|
||||||
|
var requestBody = jsonEncode({
|
||||||
|
'contents': [
|
||||||
|
{
|
||||||
|
'parts': [
|
||||||
|
{
|
||||||
|
'inlineData': {
|
||||||
|
'mimeType': 'image/jpeg',
|
||||||
|
'data': imageData,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'text':
|
||||||
|
'''Extract the following information from the front face of the Jordanian ID card:
|
||||||
|
Name
|
||||||
|
National ID number
|
||||||
|
Gender
|
||||||
|
Date of birth
|
||||||
|
Output the extracted information in the following JSON format''',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -349,6 +457,211 @@ class ContentController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> carLicenseJordan() async {
|
||||||
|
await pickImage();
|
||||||
|
isloading = true;
|
||||||
|
update();
|
||||||
|
if (image != null) {
|
||||||
|
final imageBytes = await image.readAsBytes();
|
||||||
|
final imageData = base64Encode(imageBytes);
|
||||||
|
|
||||||
|
var requestBody = jsonEncode({
|
||||||
|
'contents': [
|
||||||
|
{
|
||||||
|
'parts': [
|
||||||
|
{
|
||||||
|
'inlineData': {
|
||||||
|
'mimeType': 'image/jpeg',
|
||||||
|
'data': imageData,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'text':
|
||||||
|
'''Extract the following information from the front face of the car license card in Jordan:
|
||||||
|
|
||||||
|
* name
|
||||||
|
* Address
|
||||||
|
* Vehicle type
|
||||||
|
* car_kind
|
||||||
|
* car_color
|
||||||
|
* Vehicle category
|
||||||
|
* car_year
|
||||||
|
* car_plate
|
||||||
|
* Registration type
|
||||||
|
* Usage type
|
||||||
|
* expire_date_of_license
|
||||||
|
|
||||||
|
Output the extracted information in the following JSON formate and make date format like YYYY-MM-DD''',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'generationConfig': {
|
||||||
|
'temperature': 0.4,
|
||||||
|
'topK': 32,
|
||||||
|
'topP': 1,
|
||||||
|
'maxOutputTokens': 4096,
|
||||||
|
'stopSequences': [],
|
||||||
|
},
|
||||||
|
'safetySettings': [
|
||||||
|
{
|
||||||
|
'category': 'HARM_CATEGORY_HARASSMENT',
|
||||||
|
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'category': 'HARM_CATEGORY_HATE_SPEECH',
|
||||||
|
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'category': 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
|
||||||
|
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'category': 'HARM_CATEGORY_DANGEROUS_CONTENT',
|
||||||
|
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
print(requestBody);
|
||||||
|
|
||||||
|
final response = await http.post(
|
||||||
|
Uri.parse(
|
||||||
|
'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.0-pro-vision-latest:generateContent?key=${AK.geminiApi}'),
|
||||||
|
headers: {'Content-Type': 'application/json'},
|
||||||
|
body: requestBody,
|
||||||
|
);
|
||||||
|
isloading = false;
|
||||||
|
update();
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
var responseData = jsonDecode(response.body);
|
||||||
|
// Process the responseData as needed
|
||||||
|
// print(responseData);
|
||||||
|
|
||||||
|
var result =
|
||||||
|
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
|
// print(jsonEncode(result));
|
||||||
|
// print((result));
|
||||||
|
// print(result['dob']);
|
||||||
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
|
String? jsonString =
|
||||||
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
|
|
||||||
|
if (jsonString != null) {
|
||||||
|
// Convert the JSON object to a String
|
||||||
|
jsonString = jsonEncode(json.decode(jsonString));
|
||||||
|
responseCarLicenseMap = jsonDecode(jsonString);
|
||||||
|
print(jsonString);
|
||||||
|
print(responseCarLicenseMap);
|
||||||
|
print(responseCarLicenseMap['plate_number']);
|
||||||
|
} else {
|
||||||
|
print("JSON string not found");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rest of your code...
|
||||||
|
} else {
|
||||||
|
print('Request failed with status: ${response.statusCode}');
|
||||||
|
print('Request failed with status: ${response.body}');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print('No image selected');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getTextFromCard(String prompt) async {
|
||||||
|
await pickImage();
|
||||||
|
isloading = true;
|
||||||
|
update();
|
||||||
|
if (image != null) {
|
||||||
|
final imageBytes = await image.readAsBytes();
|
||||||
|
final imageData = base64Encode(imageBytes);
|
||||||
|
|
||||||
|
var requestBody = jsonEncode({
|
||||||
|
'contents': [
|
||||||
|
{
|
||||||
|
'parts': [
|
||||||
|
{
|
||||||
|
'inlineData': {
|
||||||
|
'mimeType': 'image/jpeg',
|
||||||
|
'data': imageData,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'text': prompt,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'generationConfig': {
|
||||||
|
"temperature": 1,
|
||||||
|
"topK": 32,
|
||||||
|
"topP": 0.1,
|
||||||
|
"maxOutputTokens": 4096,
|
||||||
|
"stopSequences": []
|
||||||
|
},
|
||||||
|
'safetySettings': [
|
||||||
|
{
|
||||||
|
'category': 'HARM_CATEGORY_HARASSMENT',
|
||||||
|
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'category': 'HARM_CATEGORY_HATE_SPEECH',
|
||||||
|
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'category': 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
|
||||||
|
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'category': 'HARM_CATEGORY_DANGEROUS_CONTENT',
|
||||||
|
'threshold': 'BLOCK_MEDIUM_AND_ABOVE',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
print(requestBody);
|
||||||
|
|
||||||
|
final response = await http.post(
|
||||||
|
Uri.parse(
|
||||||
|
'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.0-pro-vision-latest:generateContent?key=${AK.geminiApi}'),
|
||||||
|
headers: {'Content-Type': 'application/json'},
|
||||||
|
body: requestBody,
|
||||||
|
);
|
||||||
|
isloading = false;
|
||||||
|
update();
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
var responseData = jsonDecode(response.body);
|
||||||
|
// Process the responseData as needed
|
||||||
|
// print(responseData);
|
||||||
|
|
||||||
|
var result =
|
||||||
|
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
|
// print(jsonEncode(result));
|
||||||
|
// print((result));
|
||||||
|
// print(result['dob']);
|
||||||
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
|
String? jsonString =
|
||||||
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
|
|
||||||
|
if (jsonString != null) {
|
||||||
|
// Convert the JSON object to a String
|
||||||
|
jsonString = jsonEncode(json.decode(jsonString));
|
||||||
|
responseBackCarLicenseMap = jsonDecode(jsonString);
|
||||||
|
// print(jsonString);
|
||||||
|
print(responseBackCarLicenseMap);
|
||||||
|
// print(responseCarLicenseMap['plate_number']);
|
||||||
|
} else {
|
||||||
|
print("JSON string not found");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rest of your code...
|
||||||
|
} else {
|
||||||
|
print('Request failed with status: ${response.statusCode}');
|
||||||
|
print('Request failed with status: ${response.body}');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print('No image selected');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> generateBackCarLicenseJordanContent() async {
|
Future<void> generateBackCarLicenseJordanContent() async {
|
||||||
await pickImage();
|
await pickImage();
|
||||||
isloading = true;
|
isloading = true;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class LocationController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void startLocationUpdates() async {
|
void startLocationUpdates() async {
|
||||||
_locationTimer = Timer.periodic(const Duration(seconds: 10), (timer) async {
|
_locationTimer = Timer.periodic(const Duration(seconds: 5), (timer) async {
|
||||||
try {
|
try {
|
||||||
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
||||||
|
|
||||||
|
|||||||
73
lib/controller/functions/upload_image.dart
Normal file
73
lib/controller/functions/upload_image.dart
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:SEFER/constant/api_key.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
import 'package:path/path.dart';
|
||||||
|
|
||||||
|
import '../../constant/box_name.dart';
|
||||||
|
import '../../constant/colors.dart';
|
||||||
|
import '../../main.dart';
|
||||||
|
|
||||||
|
class ImageController extends GetxController {
|
||||||
|
File? myImage;
|
||||||
|
bool isloading = false;
|
||||||
|
void choosImage(String link) async {
|
||||||
|
XFile? xFile = await ImagePicker().pickImage(source: ImageSource.gallery);
|
||||||
|
myImage = File(xFile!.path);
|
||||||
|
isloading = true;
|
||||||
|
update();
|
||||||
|
var response = await uploadImage(
|
||||||
|
myImage!,
|
||||||
|
{
|
||||||
|
'driverID': box.read(BoxName.driverID).toString(),
|
||||||
|
},
|
||||||
|
link,
|
||||||
|
);
|
||||||
|
isloading = false;
|
||||||
|
update();
|
||||||
|
if (response['status'] == 'success') {
|
||||||
|
Get.snackbar('Image Uploaded'.tr, 'Sucsses',
|
||||||
|
backgroundColor: AppColor.greenColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uploadImage(File file, Map data, String link) async {
|
||||||
|
var request = http.MultipartRequest(
|
||||||
|
'POST',
|
||||||
|
Uri.parse(link), //'https://ride.mobile-app.store/uploadImage1.php'
|
||||||
|
);
|
||||||
|
|
||||||
|
var length = await file.length();
|
||||||
|
var stream = http.ByteStream(file.openRead());
|
||||||
|
var multipartFile = http.MultipartFile(
|
||||||
|
'image',
|
||||||
|
stream,
|
||||||
|
length,
|
||||||
|
filename: basename(file.path),
|
||||||
|
);
|
||||||
|
request.headers.addAll({
|
||||||
|
'Authorization':
|
||||||
|
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}',
|
||||||
|
});
|
||||||
|
// Set the file name to the driverID
|
||||||
|
request.files.add(
|
||||||
|
http.MultipartFile(
|
||||||
|
'image',
|
||||||
|
stream,
|
||||||
|
length,
|
||||||
|
filename: '${box.read(BoxName.driverID)}.jpg',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
data.forEach((key, value) {
|
||||||
|
request.fields[key] = value;
|
||||||
|
});
|
||||||
|
var myrequest = await request.send();
|
||||||
|
var res = await http.Response.fromStream(myrequest);
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
return jsonDecode(res.body);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,6 +26,7 @@ class HomeCaptainController extends GetxController {
|
|||||||
bool isLoading = true;
|
bool isLoading = true;
|
||||||
bool isCallOn = false;
|
bool isCallOn = false;
|
||||||
String totalMoneyToday = '0';
|
String totalMoneyToday = '0';
|
||||||
|
String rating = '0';
|
||||||
String countRideToday = '0';
|
String countRideToday = '0';
|
||||||
String totalMoneyInSEFER = '0';
|
String totalMoneyInSEFER = '0';
|
||||||
String totalDurationToday = '0';
|
String totalDurationToday = '0';
|
||||||
@@ -104,7 +105,7 @@ class HomeCaptainController extends GetxController {
|
|||||||
await sql.getCustomQuery(customQuery);
|
await sql.getCustomQuery(customQuery);
|
||||||
countRefuse = results[0]['count'].toString();
|
countRefuse = results[0]['count'].toString();
|
||||||
update();
|
update();
|
||||||
if (int.parse(countRefuse) > 3 || double.parse(totalPoints) < -100) {
|
if (int.parse(countRefuse) > 3 || double.parse(totalPoints) <= -500) {
|
||||||
print('total point is $totalPoints');
|
print('total point is $totalPoints');
|
||||||
locationController.stopLocationUpdates();
|
locationController.stopLocationUpdates();
|
||||||
activeStartTime = null;
|
activeStartTime = null;
|
||||||
@@ -196,11 +197,11 @@ class HomeCaptainController extends GetxController {
|
|||||||
await addToken();
|
await addToken();
|
||||||
await getlocation();
|
await getlocation();
|
||||||
onButtonSelected();
|
onButtonSelected();
|
||||||
getPaymentToday();
|
await getPaymentToday();
|
||||||
getCountRideToday();
|
getCountRideToday();
|
||||||
getAllPayment();
|
getAllPayment();
|
||||||
startPeriodicExecution();
|
startPeriodicExecution();
|
||||||
onMapCreated(mapHomeCaptaiController!);
|
onMapCreated(mapHomeCaptaiController);
|
||||||
getRefusedOrderByCaptain();
|
getRefusedOrderByCaptain();
|
||||||
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
||||||
// LocationController().getLocation();
|
// LocationController().getLocation();
|
||||||
@@ -222,7 +223,7 @@ class HomeCaptainController extends GetxController {
|
|||||||
payload: {'driverID': box.read(BoxName.driverID).toString()});
|
payload: {'driverID': box.read(BoxName.driverID).toString()});
|
||||||
data = jsonDecode(res);
|
data = jsonDecode(res);
|
||||||
totalMoneyToday = data['message'][0]['todayAmount'];
|
totalMoneyToday = data['message'][0]['todayAmount'];
|
||||||
|
rating = data['message'][0]['rating'].toString();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
|
|||||||
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
||||||
import 'package:SEFER/constant/style.dart';
|
import 'package:SEFER/constant/style.dart';
|
||||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../../../constant/api_key.dart';
|
import '../../../constant/api_key.dart';
|
||||||
import '../../../constant/box_name.dart';
|
import '../../../constant/box_name.dart';
|
||||||
@@ -130,6 +131,22 @@ class MapDriverController extends GetxController {
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void openGoogleMapFromDriverToPassenger() async {
|
||||||
|
var endLat = latLngpassengerLocation.latitude;
|
||||||
|
var endLng = latLngpassengerLocation.longitude;
|
||||||
|
|
||||||
|
var startLat = Get.find<LocationController>().myLocation.latitude;
|
||||||
|
var startLng = Get.find<LocationController>().myLocation.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';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void checkIsDriverNearPassenger() async {
|
void checkIsDriverNearPassenger() async {
|
||||||
if (isDriverNearPassengerStart) {
|
if (isDriverNearPassengerStart) {
|
||||||
Timer.periodic(const Duration(seconds: 3), (timer) {
|
Timer.periodic(const Duration(seconds: 3), (timer) {
|
||||||
@@ -248,6 +265,9 @@ class MapDriverController extends GetxController {
|
|||||||
'DriverIsGoingToPassenger',
|
'DriverIsGoingToPassenger',
|
||||||
box.read(BoxName.name).toString(),
|
box.read(BoxName.name).toString(),
|
||||||
tokenPassenger);
|
tokenPassenger);
|
||||||
|
if (box.read(BoxName.googlaMapApp) == true) {
|
||||||
|
openGoogleMapFromDriverToPassenger();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSocialPressed = false;
|
bool isSocialPressed = false;
|
||||||
@@ -291,7 +311,12 @@ class MapDriverController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Position? currentPosition;
|
Position? currentPosition;
|
||||||
|
|
||||||
void startRideFromDriver() async {
|
void startRideFromDriver() async {
|
||||||
|
double _distance =
|
||||||
|
await calculateDistanseBetweenDriverAndPassengerLocation();
|
||||||
|
|
||||||
|
if (_distance < 50) {
|
||||||
changeRideToBeginToPassenger();
|
changeRideToBeginToPassenger();
|
||||||
isPassengerInfoWindow = false;
|
isPassengerInfoWindow = false;
|
||||||
isRideStarted = true;
|
isRideStarted = true;
|
||||||
@@ -312,30 +337,46 @@ class MapDriverController extends GetxController {
|
|||||||
await CRUD().post(link: AppLink.updateRides, payload: {
|
await CRUD().post(link: AppLink.updateRides, payload: {
|
||||||
'id': rideId,
|
'id': rideId,
|
||||||
'rideTimeStart': DateTime.now().toString(),
|
'rideTimeStart': DateTime.now().toString(),
|
||||||
'status': 'Begin'
|
'status': 'Begin',
|
||||||
});
|
});
|
||||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||||
'RideIsBegin', box.read(BoxName.name).toString(), tokenPassenger);
|
'RideIsBegin', box.read(BoxName.name).toString(), tokenPassenger);
|
||||||
rideIsBeginPassengerTimer();
|
rideIsBeginPassengerTimer();
|
||||||
double pointsSubstraction = 0;
|
double pointsSubstraction = 0;
|
||||||
pointsSubstraction = double.parse(paymentAmount) * -100;
|
pointsSubstraction = double.parse(paymentAmount) * -17;
|
||||||
var res = await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
|
var res =
|
||||||
|
await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
|
||||||
'paymentID': 'rideId$rideId',
|
'paymentID': 'rideId$rideId',
|
||||||
'amount': (pointsSubstraction).toString(),
|
'amount': (pointsSubstraction).toString(),
|
||||||
'paymentMethod': paymentMethod,
|
'paymentMethod': paymentMethod,
|
||||||
'driverID': box.read(BoxName.driverID).toString(),
|
'driverID': box.read(BoxName.driverID).toString(),
|
||||||
});
|
});
|
||||||
var d = jsonDecode(res);
|
var d = jsonDecode(res);
|
||||||
// mapController!.animateCamera(
|
|
||||||
// CameraUpdate.newLatLngZoom(
|
|
||||||
// myLocation,
|
|
||||||
// 12,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
|
|
||||||
|
update();
|
||||||
|
// Start updating location and moving camera
|
||||||
|
// updateLocation();
|
||||||
|
} else {
|
||||||
|
Get.defaultDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
|
title: 'Your are far from passenger location'.tr,
|
||||||
|
middleText:
|
||||||
|
'go to your passenger location before\nPassenger cancel trip'.tr,
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Ok',
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateLocation() async {
|
||||||
StreamSubscription<Position>? locationSubscription;
|
StreamSubscription<Position>? locationSubscription;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
for (var i = 0; i < remainingTimeTimerRideBegin; i++) {
|
||||||
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
locationSubscription =
|
locationSubscription =
|
||||||
Geolocator.getPositionStream().listen((Position position) {
|
Geolocator.getPositionStream().listen((Position position) {
|
||||||
currentPosition = position;
|
currentPosition = position;
|
||||||
@@ -343,24 +384,27 @@ class MapDriverController extends GetxController {
|
|||||||
mapController!.animateCamera(
|
mapController!.animateCamera(
|
||||||
CameraUpdate.newCameraPosition(
|
CameraUpdate.newCameraPosition(
|
||||||
CameraPosition(
|
CameraPosition(
|
||||||
target: LatLng(position.latitude, position.longitude),
|
target: myLocation,
|
||||||
zoom: 7,
|
zoom: 17, // Adjust zoom level as needed
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}); // Stop listening to GPS updates when the ride is finished
|
});
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stop listening after ride finishes
|
||||||
if (!isRideBegin) {
|
if (!isRideBegin) {
|
||||||
locationSubscription?.cancel();
|
locationSubscription?.cancel();
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
debugPrint('Error listening to GPS: $error');
|
debugPrint('Error listening to GPS: $error');
|
||||||
// Handle GPS errors gracefully, e.g., show a user-friendly message
|
// Handle GPS errors gracefully
|
||||||
}
|
}
|
||||||
|
|
||||||
update();
|
// Periodically call updateLocation again
|
||||||
print('...................');
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
print(d);
|
updateLocation();
|
||||||
print('...................');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
calculateDistanseBetweenDriverAndPassengerLocation() {
|
calculateDistanseBetweenDriverAndPassengerLocation() {
|
||||||
@@ -527,6 +571,7 @@ class MapDriverController extends GetxController {
|
|||||||
int seconds = remainingTimeTimerRideBegin % 60;
|
int seconds = remainingTimeTimerRideBegin % 60;
|
||||||
stringRemainingTimeRideBegin =
|
stringRemainingTimeRideBegin =
|
||||||
'$minutes:${seconds.toString().padLeft(2, '0')}';
|
'$minutes:${seconds.toString().padLeft(2, '0')}';
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ class MapPassengerController extends GetxController {
|
|||||||
double heightBottomSheetShown = 0;
|
double heightBottomSheetShown = 0;
|
||||||
double cashConfirmPageShown = 250;
|
double cashConfirmPageShown = 250;
|
||||||
late String driverId;
|
late String driverId;
|
||||||
|
late String gender;
|
||||||
double widthMapTypeAndTraffic = 50;
|
double widthMapTypeAndTraffic = 50;
|
||||||
double paymentPageShown = Get.height * .6;
|
double paymentPageShown = Get.height * .6;
|
||||||
late LatLng southwest;
|
late LatLng southwest;
|
||||||
@@ -910,6 +911,8 @@ class MapPassengerController extends GetxController {
|
|||||||
// if (dataCarsLocationByPassenger.length > carsOrder) {
|
// if (dataCarsLocationByPassenger.length > carsOrder) {
|
||||||
driverId = dataCarsLocationByPassenger['message'][carsOrder]['driver_id']
|
driverId = dataCarsLocationByPassenger['message'][carsOrder]['driver_id']
|
||||||
.toString();
|
.toString();
|
||||||
|
gender = dataCarsLocationByPassenger['message'][carsOrder]['gender']
|
||||||
|
.toString();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// //print('driverId==============$driverId');
|
// //print('driverId==============$driverId');
|
||||||
@@ -1368,7 +1371,7 @@ class MapPassengerController extends GetxController {
|
|||||||
(_locationData.latitude != null && _locationData.longitude != null
|
(_locationData.latitude != null && _locationData.longitude != null
|
||||||
? LatLng(_locationData.latitude!, _locationData.longitude!)
|
? LatLng(_locationData.latitude!, _locationData.longitude!)
|
||||||
: null)!;
|
: null)!;
|
||||||
|
newStartPointLocation = passengerLocation;
|
||||||
// //print location details
|
// //print location details
|
||||||
// //print('Accuracy: ${_locationData.accuracy}');
|
// //print('Accuracy: ${_locationData.accuracy}');
|
||||||
// //print('Latitude: ${_locationData.latitude}');
|
// //print('Latitude: ${_locationData.latitude}');
|
||||||
@@ -1576,7 +1579,9 @@ class MapPassengerController extends GetxController {
|
|||||||
double latPassengerDestination = double.parse(coordDestination[0]);
|
double latPassengerDestination = double.parse(coordDestination[0]);
|
||||||
double lngPassengerDestination = double.parse(coordDestination[1]);
|
double lngPassengerDestination = double.parse(coordDestination[1]);
|
||||||
myDestination = LatLng(latPassengerDestination, lngPassengerDestination);
|
myDestination = LatLng(latPassengerDestination, lngPassengerDestination);
|
||||||
|
// if (origin.isEmpty) {
|
||||||
|
// origin = passengerLocation.toString(); //todo
|
||||||
|
// }
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
var url =
|
var url =
|
||||||
@@ -1610,7 +1615,7 @@ class MapPassengerController extends GetxController {
|
|||||||
LatLngBounds(northeast: northeast, southwest: southwest);
|
LatLngBounds(northeast: northeast, southwest: southwest);
|
||||||
|
|
||||||
// Fit the camera to the bounds
|
// Fit the camera to the bounds
|
||||||
var cameraUpdate = CameraUpdate.newLatLngBounds(boundsData, 130);
|
var cameraUpdate = CameraUpdate.newLatLngBounds(boundsData, 160);
|
||||||
mapController!.animateCamera(cameraUpdate);
|
mapController!.animateCamera(cameraUpdate);
|
||||||
|
|
||||||
// getDistanceFromText(data[0]['distance']['text']);
|
// getDistanceFromText(data[0]['distance']['text']);
|
||||||
|
|||||||
@@ -20,18 +20,21 @@ class LocaleController extends GetxController {
|
|||||||
case "ar":
|
case "ar":
|
||||||
locale = const Locale("ar");
|
locale = const Locale("ar");
|
||||||
appTheme = themeArabic;
|
appTheme = themeArabic;
|
||||||
|
box.write(BoxName.lang, 'ar');
|
||||||
break;
|
break;
|
||||||
case "en":
|
case "en":
|
||||||
locale = const Locale("en");
|
locale = const Locale("en");
|
||||||
appTheme = themeEnglish;
|
appTheme = themeEnglish;
|
||||||
|
box.write(BoxName.lang, 'en');
|
||||||
break;
|
break;
|
||||||
case "tr":
|
case "tr":
|
||||||
locale = const Locale("tr");
|
locale = const Locale("tr");
|
||||||
appTheme = themeEnglish;
|
appTheme = themeEnglish;
|
||||||
|
box.write(BoxName.lang, 'tr');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
locale = Locale(Get.deviceLocale!.languageCode);
|
locale = Locale(Get.deviceLocale!.languageCode);
|
||||||
|
box.write(BoxName.lang, 'en');
|
||||||
appTheme = themeEnglish;
|
appTheme = themeEnglish;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,16 +202,16 @@ class MyTranslation extends Translations {
|
|||||||
"you will pay to Driver": "ستدفع للسائق",
|
"you will pay to Driver": "ستدفع للسائق",
|
||||||
"Driver Cancel Your Trip": "السائق ألغى رحلتك",
|
"Driver Cancel Your Trip": "السائق ألغى رحلتك",
|
||||||
"you will pay to Driver you will be pay the cost of driver time look to your SEFER Wallet":
|
"you will pay to Driver you will be pay the cost of driver time look to your SEFER Wallet":
|
||||||
"ستدفع للسائق تكلفة وقته تفقد محفظتك في سيفر",
|
"ستدفع للسائق تكلفة وقته تفقد محفظتك في سفر",
|
||||||
"I will go now": "سأذهب الآن",
|
"I will go now": "سأذهب الآن",
|
||||||
"You Have Tips": "لديك زيادة مال",
|
"You Have Tips": "لديك زيادة مال",
|
||||||
" tips\nTotal is": "زيادة مال\nالمجموع هو",
|
" tips\nTotal is": "زيادة مال\nالمجموع هو",
|
||||||
"No,I want": "لا، أريد",
|
"No,I want": "لا، أريد",
|
||||||
"Your fee is ": "أجرك هو",
|
"Your fee is ": "أجرك هو",
|
||||||
"Do you want to pay Tips for this Driver":
|
"Do you want to pay Tips for this Driver":
|
||||||
"هل تريد دفع زيادة مال لهذا السائق؟",
|
"هل تريد دفع أكراميه لهذا السائق؟",
|
||||||
"Tip is ": "زيادة المال هي",
|
"Tip is ": " مبلغ الاكراميه هو",
|
||||||
"Tip is": "زيادة المال هي",
|
"Tip is": " مبلغ الاكراميه هو",
|
||||||
"Camera Access Denied.": "تم رفض الوصول إلى الكاميرا.",
|
"Camera Access Denied.": "تم رفض الوصول إلى الكاميرا.",
|
||||||
"Open Settings": "افتح الإعدادات",
|
"Open Settings": "افتح الإعدادات",
|
||||||
"GPS Required Allow !.": "تمكن الـ GPS مطلوب!",
|
"GPS Required Allow !.": "تمكن الـ GPS مطلوب!",
|
||||||
@@ -263,8 +263,8 @@ class MyTranslation extends Translations {
|
|||||||
"Feedback data saved successfully": "تم حفظ بيانات التعليقات بنجاح",
|
"Feedback data saved successfully": "تم حفظ بيانات التعليقات بنجاح",
|
||||||
"No Promo for today .": "لا يوجد عرض ترويجي اليوم.",
|
"No Promo for today .": "لا يوجد عرض ترويجي اليوم.",
|
||||||
"Select your destination": "اختر وجهتك",
|
"Select your destination": "اختر وجهتك",
|
||||||
"Search for your Start point": "بحث عن نقطة بدايتك",
|
"Search for your Start point": "بحث عن نقطة الانطلاق",
|
||||||
"Search for waypoint": "بحث عن نقطة الوجهة",
|
"Search for waypoint": "بحث عن النقطة الة",
|
||||||
"Current Location": "الموقع الحالي",
|
"Current Location": "الموقع الحالي",
|
||||||
"Add Location 1": "إضافة الموقع 1",
|
"Add Location 1": "إضافة الموقع 1",
|
||||||
'You must Verify email !.': "يجب التحقق من البريد الإلكتروني!",
|
'You must Verify email !.': "يجب التحقق من البريد الإلكتروني!",
|
||||||
@@ -273,6 +273,9 @@ class MyTranslation extends Translations {
|
|||||||
'Select Date': "اختر التاريخ",
|
'Select Date': "اختر التاريخ",
|
||||||
'Birth Date': "تاريخ الميلاد",
|
'Birth Date': "تاريخ الميلاد",
|
||||||
'Ok': "موافق",
|
'Ok': "موافق",
|
||||||
|
'the 500 points equal 30 JOD': "النقاط الـ 500 تساوي 30 دينار أردني",
|
||||||
|
'the 500 points equal 30 JOD for you \nSo go and gain your money':
|
||||||
|
"النقاط الـ 500 تساوي 30 دينار أردني\nفاستحق فلوسك واكسب النقاط",
|
||||||
'token updated': "تم تحديث الرمز",
|
'token updated': "تم تحديث الرمز",
|
||||||
'Add Location 2': "إضافة الموقع 2",
|
'Add Location 2': "إضافة الموقع 2",
|
||||||
'Add Location 3': "إضافة الموقع 3",
|
'Add Location 3': "إضافة الموقع 3",
|
||||||
@@ -286,13 +289,14 @@ class MyTranslation extends Translations {
|
|||||||
'is driving a ': "يقود",
|
'is driving a ': "يقود",
|
||||||
' with license plate ': "بلوحة ترخيص",
|
' with license plate ': "بلوحة ترخيص",
|
||||||
' I am currently located at ': "أنا حاليا في",
|
' I am currently located at ': "أنا حاليا في",
|
||||||
|
'Please go to Car now ': 'الرجاء التحرك الى السياره الان',
|
||||||
' If you need to reach me, please contact the driver directly at':
|
' If you need to reach me, please contact the driver directly at':
|
||||||
"إذا كنت تحتاج إلى التواصل معي، يرجى التواصل مع السائق مباشرة على",
|
"إذا كنت تحتاج إلى التواصل معي، يرجى التواصل مع السائق مباشرة على",
|
||||||
'No Car or Driver Found in your area.':
|
'No Car or Driver Found in your area.':
|
||||||
"لم يتم العثور على سيارة أو سائق في منطقتك.",
|
"لم يتم العثور على سيارة أو سائق في منطقتك.",
|
||||||
'Please Try anther time ': "الرجاء إعادة المحاولة",
|
'Please Try anther time ': "الرجاء إعادة المحاولة",
|
||||||
'There no Driver Aplly your order sorry for that ':
|
'There no Driver Aplly your order sorry for that ':
|
||||||
"لا يوجد سائق قدم طلبك، نعتذر عن ذلك",
|
"لا يوجد سائق قبل طلبك، نعتذر عن ذلك",
|
||||||
'Trip Cancelled': "تم إلغاء الرحلة",
|
'Trip Cancelled': "تم إلغاء الرحلة",
|
||||||
'The Driver Will be in your location soon .':
|
'The Driver Will be in your location soon .':
|
||||||
"سيكون السائق قريبا في موقعك.",
|
"سيكون السائق قريبا في موقعك.",
|
||||||
@@ -336,7 +340,7 @@ class MyTranslation extends Translations {
|
|||||||
'Date of Birth': "تاريخ الميلاد",
|
'Date of Birth': "تاريخ الميلاد",
|
||||||
'Age': "العمر",
|
'Age': "العمر",
|
||||||
'Expiry Date': "تاريخ الإنتهاء",
|
'Expiry Date': "تاريخ الإنتهاء",
|
||||||
'Lets check Car license ': "دعونا نتحقق من رخصة السيارة ",
|
'Lets check Car license ': "دعنا نتحقق من رخصة السيارة ",
|
||||||
'Color': "اللون",
|
'Color': "اللون",
|
||||||
'Car Kind': "نوع السيارة",
|
'Car Kind': "نوع السيارة",
|
||||||
'Year': "السنة",
|
'Year': "السنة",
|
||||||
@@ -345,9 +349,10 @@ class MyTranslation extends Translations {
|
|||||||
'Car License Card': "بطاقة رخصة السيارة",
|
'Car License Card': "بطاقة رخصة السيارة",
|
||||||
'No image selected yet': "لم يتم إختيار أي صورة بعد",
|
'No image selected yet': "لم يتم إختيار أي صورة بعد",
|
||||||
'Made :': "الصناعة:",
|
'Made :': "الصناعة:",
|
||||||
'model :': "النموذج:",
|
'model :': "النوع:",
|
||||||
'VIN :': "رقم الشاصي:",
|
'VIN :': "رقم الشاصي:",
|
||||||
'year :': "السنة:",
|
'year :': "السنة:",
|
||||||
|
'ُExpire Date': 'تاريخ الانتهاء',
|
||||||
'Login Driver': "تسجيل دخول السائق",
|
'Login Driver': "تسجيل دخول السائق",
|
||||||
'Password must br at least 6 character.':
|
'Password must br at least 6 character.':
|
||||||
"كلمة المرور يجب أن تكون على الأقل 6 أحرف.",
|
"كلمة المرور يجب أن تكون على الأقل 6 أحرف.",
|
||||||
@@ -366,13 +371,16 @@ class MyTranslation extends Translations {
|
|||||||
'Your name': "إسمك",
|
'Your name': "إسمك",
|
||||||
'Your password': "كلمة المرور الخاصة بك",
|
'Your password': "كلمة المرور الخاصة بك",
|
||||||
'title': "العنوان",
|
'title': "العنوان",
|
||||||
'If You Want be Driver Click Here.':
|
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country.":
|
||||||
"إذا كنت تريد أن تكون سائقًا انقر هنا.",
|
"لكي يتم تقديم أفضل خدمة ومحتوى متخصص لك، نطلب منك تحديد بلدك حتى نتمكن من تخصيص التطبيق بناءًا على مكان سكنك. سوف تساعدنا هذه الخطوة في ضمان حصولك على أحدث المعلومات والتحديثات المتعلقة بدولتك.",
|
||||||
|
'If You Want be Driver \nClick Here.':
|
||||||
|
"إذا كنت تريد أن تكون سائقًا \nانقر هنا.",
|
||||||
'Enter your City': "أدخل مدينتك",
|
'Enter your City': "أدخل مدينتك",
|
||||||
'History Page': "صفحة التاريخ",
|
"Select Your Country": "تحديد دولتك",
|
||||||
|
'History Page': "ارشيف الرحلات",
|
||||||
'This Trip Cancelled': "تم إلغاء هذه الرحلة",
|
'This Trip Cancelled': "تم إلغاء هذه الرحلة",
|
||||||
'Trip Detail': "تفاصيل الرحلة",
|
'Trip Detail': "تفاصيل الرحلة",
|
||||||
'Trip on Map Click here': "ضغط هنا لعرض الرحلة على الخريطة",
|
'Trip on Map Click here': "اضغط هنا لعرض الرحلة على الخريطة",
|
||||||
'Order ID': "رقم الطلب",
|
'Order ID': "رقم الطلب",
|
||||||
'Price is': "السعر هو",
|
'Price is': "السعر هو",
|
||||||
'Distance is': "المسافة هي",
|
'Distance is': "المسافة هي",
|
||||||
@@ -430,7 +438,7 @@ class MyTranslation extends Translations {
|
|||||||
'Distance from Passenger to destination is ':
|
'Distance from Passenger to destination is ':
|
||||||
"المسافة من الراكب إلى الوجهة هي ",
|
"المسافة من الراكب إلى الوجهة هي ",
|
||||||
'Cost Of Trip IS ': "تكلفة الرحلة هي ",
|
'Cost Of Trip IS ': "تكلفة الرحلة هي ",
|
||||||
'Accept Order': "قبول الطلب",
|
'Accept Order': "تم قبول الطلب",
|
||||||
'rejct your order.': "رفض طلبك.",
|
'rejct your order.': "رفض طلبك.",
|
||||||
'Bottom Bar Example': "مثال لشريط الأسفل",
|
'Bottom Bar Example': "مثال لشريط الأسفل",
|
||||||
'Statistics': "الإحصائيات",
|
'Statistics': "الإحصائيات",
|
||||||
@@ -534,29 +542,28 @@ class MyTranslation extends Translations {
|
|||||||
'Car Details': "تفاصيل السيارة",
|
'Car Details': "تفاصيل السيارة",
|
||||||
'VIN is': "رقم الشاصي هو",
|
'VIN is': "رقم الشاصي هو",
|
||||||
'Color is ': "اللون هو ",
|
'Color is ': "اللون هو ",
|
||||||
'Make is ': "الصانع هو",
|
'Make is ': "الشركه الصانعه",
|
||||||
'Model is': "النموذج هو",
|
'Model is': "النوع هو",
|
||||||
'Year is': "السنة هي",
|
'Year is': "السنة هي",
|
||||||
'Expiration Date ': "تاريخ انتهاء الصلاحية ",
|
'Expiration Date ': "تاريخ الانتهاء ",
|
||||||
'Edit Your data': "تعديل بياناتك",
|
'Edit Your data': "تعديل بياناتك",
|
||||||
'write vin for your car': "اكتب رقم الشاصي لسيارتك",
|
'write vin for your car': "اكتب رقم الشاصي لسيارتك",
|
||||||
'VIN': "رقم الشاصي",
|
'VIN': "رقم الشاصي",
|
||||||
'write Color for your car': "اكتب لون سيارتك",
|
'write Color for your car': "اكتب لون سيارتك",
|
||||||
'write Make for your car': "اكتب صانع سيارتك",
|
'write Make for your car': "اكتب صانع سيارتك",
|
||||||
'Make': "الصانع",
|
'Make': "الشركه الصانعه",
|
||||||
'write Model for your car': "اكتب نموذج سيارتك",
|
'write Model for your car': "اكتب نوع سيارتك",
|
||||||
'Model': "النموذج",
|
'Model': "النوع",
|
||||||
'write Year for your car': "اكتب سنة سيارتك",
|
'write Year for your car': "اكتب سنة الصنع",
|
||||||
'Expiration Date': "تاريخ انتهاء الصلاحية",
|
'Expiration Date': "تاريخ الانتهاء ",
|
||||||
'write Expiration Date for your car':
|
'write Expiration Date for your car': "اكتب تاريخ انتهاء رخصه سيارتك",
|
||||||
"اكتب تاريخ انتهاء صلاحية سيارتك",
|
|
||||||
'Tariffs': "التعرفه",
|
'Tariffs': "التعرفه",
|
||||||
'Minimum fare': "الحد الأدنى للأجرة",
|
'Minimum fare': "الحد الأدنى للأجرة",
|
||||||
'Maximum fare': "الحد الأقصى للأجرة",
|
'Maximum fare': "الحد الأقصى للأجرة",
|
||||||
'JOD': "د.أ",
|
'JOD': "د.أ",
|
||||||
'Flag-down fee': "رسوم التشغيل",
|
'Flag-down fee': "رسوم التشغيل",
|
||||||
'Including Tax': "بما في ذلك الضرائب",
|
'Including Tax': "بما في ذلك الضرائب",
|
||||||
'BookingFee': "رسوم الحجز",
|
'BookingFee': "رسوم الطلب",
|
||||||
'Morning': "الصباح",
|
'Morning': "الصباح",
|
||||||
'from 07:30 till 10:30 (Thursday, Friday, Saturday, Monday)':
|
'from 07:30 till 10:30 (Thursday, Friday, Saturday, Monday)':
|
||||||
"من 07:30 إلى 10:30 (يوم الخميس، الجمعة، السبت، الإثنين)",
|
"من 07:30 إلى 10:30 (يوم الخميس، الجمعة، السبت، الإثنين)",
|
||||||
@@ -565,7 +572,8 @@ class MyTranslation extends Translations {
|
|||||||
"من 12:00 إلى 15:00 (يوم الخميس، الجمعة، السبت، الإثنين)",
|
"من 12:00 إلى 15:00 (يوم الخميس، الجمعة، السبت، الإثنين)",
|
||||||
'Night': "الليل",
|
'Night': "الليل",
|
||||||
'You have in account': 'يوجد في حسابك ',
|
'You have in account': 'يوجد في حسابك ',
|
||||||
'Ride Today :': 'عدد الرحلات : ',
|
'Select Country': 'اختر الدوله',
|
||||||
|
'Ride Today : ': 'عدد الرحلات : ',
|
||||||
'After this period\nYou can\'t cancel!':
|
'After this period\nYou can\'t cancel!':
|
||||||
'بعد هذه الفتره \nلا تستطيع الغاء الرحله',
|
'بعد هذه الفتره \nلا تستطيع الغاء الرحله',
|
||||||
'from 23:59 till 05:30': "من 23:59 إلى 05:30",
|
'from 23:59 till 05:30': "من 23:59 إلى 05:30",
|
||||||
@@ -583,6 +591,9 @@ class MyTranslation extends Translations {
|
|||||||
'OrderId': 'رقم الرحله',
|
'OrderId': 'رقم الرحله',
|
||||||
'created time': "وقت الرحله",
|
'created time': "وقت الرحله",
|
||||||
'Map Passenger': 'خارطه الراكب',
|
'Map Passenger': 'خارطه الراكب',
|
||||||
|
"If you want to make Google Map App run directly when you apply order":
|
||||||
|
"إذا كنت تريد أن تفتح تطبيق خرائط جوجل مباشرة عند طلب الخدمة",
|
||||||
|
"You can change the language of the app": "يمكنك تغيير لغة التطبيق",
|
||||||
'Your Budget less than needed': 'القيمه المدخله اقل من رصيدك',
|
'Your Budget less than needed': 'القيمه المدخله اقل من رصيدك',
|
||||||
},
|
},
|
||||||
"tr": {
|
"tr": {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/constant/links.dart';
|
import 'package:SEFER/constant/links.dart';
|
||||||
@@ -16,7 +17,19 @@ class DriverWalletHistoryController extends GetxController {
|
|||||||
var res = await CRUD().get(
|
var res = await CRUD().get(
|
||||||
link: AppLink.getWalletByDriver,
|
link: AppLink.getWalletByDriver,
|
||||||
payload: {'driverID': box.read(BoxName.driverID)});
|
payload: {'driverID': box.read(BoxName.driverID)});
|
||||||
|
if (res == 'failure') {
|
||||||
|
Get.defaultDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
|
title: 'There is no data yet.'.tr,
|
||||||
|
middleText: '',
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Back'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
));
|
||||||
|
}
|
||||||
archive = jsonDecode(res)['message'];
|
archive = jsonDecode(res)['message'];
|
||||||
print(archive);
|
print(archive);
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|||||||
@@ -17,15 +17,36 @@ class CaptainProfileController extends GetxController {
|
|||||||
TextEditingController expirationDate = TextEditingController();
|
TextEditingController expirationDate = TextEditingController();
|
||||||
|
|
||||||
Future updateFields() async {
|
Future updateFields() async {
|
||||||
var res = await CRUD().post(link: AppLink.updateRegisrationCar, payload: {
|
var payload = {
|
||||||
'driverID': box.read(BoxName.driverID),
|
'driverID': box.read(BoxName.driverID),
|
||||||
'vin': vin.text,
|
};
|
||||||
'color': color.text,
|
|
||||||
'model': model.text,
|
if (vin.text.isNotEmpty) {
|
||||||
'make': make.text,
|
payload['vin'] = vin.text;
|
||||||
'year': year.text,
|
}
|
||||||
'expirationDate': expirationDate.text,
|
|
||||||
});
|
if (color.text.isNotEmpty) {
|
||||||
|
payload['color'] = color.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (model.text.isNotEmpty) {
|
||||||
|
payload['model'] = model.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (make.text.isNotEmpty) {
|
||||||
|
payload['make'] = make.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (year.text.isNotEmpty) {
|
||||||
|
payload['year'] = year.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (expirationDate.text.isNotEmpty) {
|
||||||
|
payload['expiration_date'] = expirationDate.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
var res =
|
||||||
|
await CRUD().post(link: AppLink.updateRegisrationCar, payload: payload);
|
||||||
|
|
||||||
if (jsonDecode(res)['status'] == 'success') {
|
if (jsonDecode(res)['status'] == 'success') {
|
||||||
box.write(BoxName.vin, vin.text);
|
box.write(BoxName.vin, vin.text);
|
||||||
@@ -34,7 +55,7 @@ class CaptainProfileController extends GetxController {
|
|||||||
box.write(BoxName.make, make.text);
|
box.write(BoxName.make, make.text);
|
||||||
box.write(BoxName.year, year.text);
|
box.write(BoxName.year, year.text);
|
||||||
box.write(BoxName.expirationDate, expirationDate.text);
|
box.write(BoxName.expirationDate, expirationDate.text);
|
||||||
|
update();
|
||||||
Get.back();
|
Get.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,7 +77,7 @@ class CaptainProfileController extends GetxController {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
if (box.read(BoxName.dobDriver).toString().isEmpty) {
|
if (box.read(BoxName.dobDriver) == null) {
|
||||||
getProfileData();
|
getProfileData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
26
lib/controller/profile/setting_controller.dart
Normal file
26
lib/controller/profile/setting_controller.dart
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
|
import 'package:SEFER/main.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class SettingController extends GetxController {
|
||||||
|
bool isGoogleMapsEnabled = false;
|
||||||
|
|
||||||
|
void onChangMapApp() {
|
||||||
|
if (!isGoogleMapsEnabled) {
|
||||||
|
isGoogleMapsEnabled = true;
|
||||||
|
box.write(BoxName.googlaMapApp, true);
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
isGoogleMapsEnabled = false;
|
||||||
|
box.write(BoxName.googlaMapApp, false);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
isGoogleMapsEnabled = box.read(BoxName.googlaMapApp);
|
||||||
|
update();
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:SEFER/constant/box_name.dart';
|
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|||||||
@@ -51,12 +51,12 @@ class AdminHomePage extends StatelessWidget {
|
|||||||
title: 'Static',
|
title: 'Static',
|
||||||
onPressed: () => Get.to(() => StaticDash())),
|
onPressed: () => Get.to(() => StaticDash())),
|
||||||
AdminWidgetsDashBoard(
|
AdminWidgetsDashBoard(
|
||||||
title: 'Gemeni',
|
title: 'Gemeni', onPressed: () => AI().generateContent()),
|
||||||
onPressed: () => ContentController().generateContent()),
|
|
||||||
AdminWidgetsDashBoard(
|
AdminWidgetsDashBoard(
|
||||||
title: 'GemeniCarRegistration',
|
title: 'CarLicenseJordan',
|
||||||
onPressed: () =>
|
onPressed: () => AI().carLicenseJordan()),
|
||||||
ContentController().getFromCarRegistration()),
|
AdminWidgetsDashBoard(
|
||||||
|
title: 'JordanID', onPressed: () => AI().jordanID()),
|
||||||
AdminWidgetsDashBoard(
|
AdminWidgetsDashBoard(
|
||||||
title: 'Llama',
|
title: 'Llama',
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@ import '../../../constant/style.dart';
|
|||||||
import '../../../controller/auth/captin/login_captin_controller.dart';
|
import '../../../controller/auth/captin/login_captin_controller.dart';
|
||||||
import '../../../controller/auth/login_controller.dart';
|
import '../../../controller/auth/login_controller.dart';
|
||||||
import '../../../main.dart';
|
import '../../../main.dart';
|
||||||
|
import '../../home/profile/passenger_profile_page.dart';
|
||||||
import '../../widgets/elevated_btn.dart';
|
import '../../widgets/elevated_btn.dart';
|
||||||
import '../../widgets/my_scafold.dart';
|
import '../../widgets/my_scafold.dart';
|
||||||
import '../../widgets/mycircular.dart';
|
import '../../widgets/mycircular.dart';
|
||||||
@@ -32,6 +33,8 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
body: [
|
body: [
|
||||||
if (box.read(BoxName.agreeTerms) != 'agreed')
|
if (box.read(BoxName.agreeTerms) != 'agreed')
|
||||||
agreedPage()
|
agreedPage()
|
||||||
|
else if (box.read(BoxName.countryCode) == null)
|
||||||
|
CountryPicker()
|
||||||
else
|
else
|
||||||
SingleChildScrollView(
|
SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
|
import 'package:SEFER/main.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/controller/auth/captin/register_captin_controller.dart';
|
import 'package:SEFER/controller/auth/captin/register_captin_controller.dart';
|
||||||
@@ -33,74 +35,8 @@ class RegisterCaptin extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(children: [
|
child: Column(
|
||||||
// Row(
|
children: [
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// SizedBox(
|
|
||||||
// width: Get.width * .4,
|
|
||||||
// child: TextFormField(
|
|
||||||
// keyboardType: TextInputType.text,
|
|
||||||
// controller: controller.firstNameController,
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// focusedBorder: OutlineInputBorder(
|
|
||||||
// borderSide: const BorderSide(
|
|
||||||
// color: AppColor.primaryColor,
|
|
||||||
// width: 2.0,
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(10),
|
|
||||||
// ),
|
|
||||||
// fillColor: AppColor.accentColor,
|
|
||||||
// hoverColor: AppColor.accentColor,
|
|
||||||
// focusColor: AppColor.accentColor,
|
|
||||||
// border: const OutlineInputBorder(
|
|
||||||
// borderRadius: BorderRadius.all(
|
|
||||||
// Radius.circular(12))),
|
|
||||||
// labelText: 'First name'.tr,
|
|
||||||
// hintText: 'Enter your first name'.tr,
|
|
||||||
// ),
|
|
||||||
// validator: (value) {
|
|
||||||
// if (value!.isEmpty) {
|
|
||||||
// return 'Please enter your first name.'.tr;
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// width: Get.width * .4,
|
|
||||||
// child: TextFormField(
|
|
||||||
// keyboardType: TextInputType.text,
|
|
||||||
// controller: controller.lastNameController,
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// focusedBorder: OutlineInputBorder(
|
|
||||||
// borderSide: const BorderSide(
|
|
||||||
// color: AppColor.primaryColor,
|
|
||||||
// width: 2.0,
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(10),
|
|
||||||
// ),
|
|
||||||
// focusColor: AppColor.accentColor,
|
|
||||||
// fillColor: AppColor.accentColor,
|
|
||||||
// border: const OutlineInputBorder(
|
|
||||||
// borderRadius: BorderRadius.all(
|
|
||||||
// Radius.circular(12))),
|
|
||||||
// labelText: 'Last name'.tr,
|
|
||||||
// hintText: 'Enter your last name'.tr,
|
|
||||||
// ),
|
|
||||||
// validator: (value) {
|
|
||||||
// if (value!.isEmpty) {
|
|
||||||
// return 'Please enter your last name.'.tr;
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// const SizedBox(
|
|
||||||
// height: 15,
|
|
||||||
// ),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: Get.width * .8,
|
width: Get.width * .8,
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
@@ -207,60 +143,18 @@ class RegisterCaptin extends StatelessWidget {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
height: 15,
|
||||||
),
|
),
|
||||||
// Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// InkWell(
|
|
||||||
// onTap: () => controller.getBirthDate(),
|
|
||||||
// child: Container(
|
|
||||||
// height: 50,
|
|
||||||
// width: Get.width * .4,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// border: Border.all(),
|
|
||||||
// borderRadius: BorderRadius.circular(13)),
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.symmetric(
|
|
||||||
// horizontal: 20),
|
|
||||||
// child: Text(
|
|
||||||
// controller.birthDate,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// DropdownButton(
|
|
||||||
// value: controller.gender,
|
|
||||||
// items: [
|
|
||||||
// DropdownMenuItem(
|
|
||||||
// value: 'Male',
|
|
||||||
// child: Text('Male'.tr),
|
|
||||||
// ),
|
|
||||||
// DropdownMenuItem(
|
|
||||||
// value: 'Female',
|
|
||||||
// child: Text('Female'.tr),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// onChanged: (value) {
|
|
||||||
// controller.changeGender(value!);
|
|
||||||
// },
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title: 'Next'.tr,
|
title: 'Next'.tr,
|
||||||
onPressed: () => controller.nextToAIDetection()),
|
onPressed: () => controller.nextToAIDetection()),
|
||||||
// MyElevatedButton(
|
IconButton(
|
||||||
// //todo remove it for test
|
onPressed: () {
|
||||||
// title: 'Car registration ai '.tr,
|
print(box.write(BoxName.countryCode, 'Jordan'));
|
||||||
// kolor: AppColor.blueColor,
|
print(box.read(BoxName.countryCode));
|
||||||
// onPressed: () => Get.to(() => CarLicensePage())),
|
},
|
||||||
|
icon: const Icon(Icons.add),
|
||||||
// controller.isloading
|
)
|
||||||
// ? const MyCircularProgressIndicator()
|
],
|
||||||
// : MyElevatedButton(
|
),
|
||||||
// title: 'Register Captain'.tr,
|
|
||||||
// onPressed: () => controller.register())
|
|
||||||
]),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -236,21 +236,31 @@ class LoginPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
// const Spacer(),
|
// const Spacer(),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 40,
|
height: 100,
|
||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () => Get.to(LoginCaptin()),
|
onTap: () => Get.to(LoginCaptin()),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
const Icon(Icons.drive_eta_rounded),
|
const Icon(
|
||||||
|
Icons.drive_eta_rounded,
|
||||||
|
size: 50,
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
'If You Want be Driver Click Here.'.tr,
|
'If You Want be Driver \nClick Here.'.tr,
|
||||||
style: AppStyle.headTitle2,
|
style: AppStyle.headTitle2,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
box.remove(BoxName.countryCode);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.delete),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -287,7 +297,8 @@ class LoginPage extends StatelessWidget {
|
|||||||
RichText(
|
RichText(
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
text:
|
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,
|
style: AppStyle.title,
|
||||||
children: <TextSpan>[
|
children: <TextSpan>[
|
||||||
TextSpan(
|
TextSpan(
|
||||||
@@ -308,8 +319,8 @@ class LoginPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
));
|
));
|
||||||
}),
|
}),
|
||||||
const TextSpan(
|
TextSpan(
|
||||||
text: '. I am at least 18 years of age.',
|
text: '. I am at least 18 years of age.'.tr,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -26,6 +26,6 @@ class PassengerLocationMapPage extends StatelessWidget {
|
|||||||
const SosConnect(),
|
const SosConnect(),
|
||||||
const GoogleMapApp(),
|
const GoogleMapApp(),
|
||||||
],
|
],
|
||||||
isleading: true);
|
isleading: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
|
import 'package:SEFER/constant/api_key.dart';
|
||||||
|
import 'package:SEFER/constant/links.dart';
|
||||||
|
import 'package:SEFER/constant/style.dart';
|
||||||
|
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||||
|
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||||
|
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/constant/colors.dart';
|
import 'package:SEFER/constant/colors.dart';
|
||||||
@@ -11,9 +20,17 @@ import 'package:SEFER/views/home/my_wallet/walet_captain.dart';
|
|||||||
import 'package:SEFER/views/home/profile/profile_captain.dart';
|
import 'package:SEFER/views/home/profile/profile_captain.dart';
|
||||||
import 'package:SEFER/views/notification/notification_captain.dart';
|
import 'package:SEFER/views/notification/notification_captain.dart';
|
||||||
|
|
||||||
|
import '../../../../controller/functions/upload_image.dart';
|
||||||
|
|
||||||
class DrawerCaptain extends StatelessWidget {
|
class DrawerCaptain extends StatelessWidget {
|
||||||
|
ImageController imageController = Get.put(ImageController());
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
String writeText(int times) {
|
||||||
|
return '*' * times;
|
||||||
|
}
|
||||||
|
|
||||||
return Drawer(
|
return Drawer(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -24,18 +41,84 @@ class DrawerCaptain extends StatelessWidget {
|
|||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
colors: [
|
colors: [
|
||||||
AppColor.greenColor,
|
AppColor.greenColor,
|
||||||
AppColor.yellowColor
|
AppColor.yellowColor,
|
||||||
], // Define your gradient colors
|
],
|
||||||
begin: Alignment.topLeft,
|
begin: Alignment.topLeft,
|
||||||
end: Alignment.bottomRight,
|
end: Alignment.bottomRight,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
accountName: Text(box.read(BoxName.nameDriver)),
|
currentAccountPictureSize: const Size.square(100),
|
||||||
accountEmail: Text(box.read(BoxName.emailDriver)),
|
arrowColor: AppColor.deepPurpleAccent,
|
||||||
currentAccountPicture: const CircleAvatar(
|
accountName: Padding(
|
||||||
backgroundImage: AssetImage('path_to_profile_image'),
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
), //todo image from server
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
box.read(BoxName.nameDriver),
|
||||||
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
|
const Spacer(),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
Get.find<HomeCaptainController>().rating,
|
||||||
|
style: AppStyle.number.copyWith(color: Colors.amber),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
// width: Get.width * .4,
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 4, vertical: 1),
|
||||||
|
color: AppColor.greenColor,
|
||||||
|
child: RatingBar.builder(
|
||||||
|
initialRating: double.parse(
|
||||||
|
Get.find<HomeCaptainController>().rating),
|
||||||
|
minRating: 1,
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
itemCount: 5,
|
||||||
|
itemSize: 20,
|
||||||
|
itemPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 2),
|
||||||
|
itemBuilder: (context, _) => const Icon(
|
||||||
|
Icons.star,
|
||||||
|
color: Colors.amber,
|
||||||
|
),
|
||||||
|
onRatingUpdate: (rating) {}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
accountEmail: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
child: Text(
|
||||||
|
box.read(BoxName.emailDriver),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
currentAccountPicture: Stack(
|
||||||
|
children: [
|
||||||
|
GetBuilder<ImageController>(builder: (imageController) {
|
||||||
|
return imageController.isloading
|
||||||
|
? const MyCircularProgressIndicator()
|
||||||
|
: ClipOval(
|
||||||
|
child: Image.network(
|
||||||
|
'${AK.serverPHP}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg'));
|
||||||
|
}),
|
||||||
|
Positioned(
|
||||||
|
right: 0,
|
||||||
|
top: 0,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
imageController.choosImage(AppLink.uploadImage1);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.edit),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.account_balance_wallet),
|
leading: const Icon(Icons.account_balance_wallet),
|
||||||
title: Text('Wallet'.tr),
|
title: Text('Wallet'.tr),
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Get.put(OrderRequestController());
|
Get.put(OrderRequestController());
|
||||||
|
Get.put(HomeCaptainController());
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: AppColor.greenColor,
|
backgroundColor: AppColor.greenColor,
|
||||||
@@ -135,7 +135,7 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const Icon(
|
const Icon(
|
||||||
Entypo.wallet,
|
Entypo.wallet,
|
||||||
@@ -156,15 +156,19 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(6),
|
||||||
color: AppColor.greenColor,
|
color: AppColor.greenColor,
|
||||||
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsets.symmetric(
|
||||||
const EdgeInsets.symmetric(horizontal: 8),
|
horizontal: 8, vertical: 2),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Ride Today :'.tr +
|
'Ride Today : '.tr +
|
||||||
Get.find<HomeCaptainController>()
|
Get.find<HomeCaptainController>()
|
||||||
.countRideToday,
|
.countRideToday,
|
||||||
style: AppStyle.title,
|
style: AppStyle.title
|
||||||
|
.copyWith(color: AppColor.secondaryColor),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class GoogleDriverMap extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
// Get.put(MapDriverController());
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: GetBuilder<MapDriverController>(
|
child: GetBuilder<MapDriverController>(
|
||||||
@@ -24,11 +25,12 @@ class GoogleDriverMap extends StatelessWidget {
|
|||||||
initialCameraPosition: CameraPosition(
|
initialCameraPosition: CameraPosition(
|
||||||
// bearing: 45,
|
// bearing: 45,
|
||||||
target: locationController.myLocation,
|
target: locationController.myLocation,
|
||||||
zoom: 15,
|
zoom: 16,
|
||||||
tilt: 40,
|
tilt: 40,
|
||||||
),
|
),
|
||||||
|
onCameraMoveStarted: () {},
|
||||||
onCameraMove: (position) {
|
onCameraMove: (position) {
|
||||||
locationController.myLocation = position.target;
|
// locationController.myLocation = position.target;
|
||||||
print(position);
|
print(position);
|
||||||
},
|
},
|
||||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
import 'package:SEFER/controller/functions/location_controller.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/constant/colors.dart';
|
import 'package:SEFER/constant/colors.dart';
|
||||||
@@ -8,10 +10,12 @@ import 'package:SEFER/controller/firebase/firbase_messge.dart';
|
|||||||
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../../../../constant/style.dart';
|
import '../../../../constant/style.dart';
|
||||||
import '../../../../controller/functions/launch.dart';
|
import '../../../../controller/functions/launch.dart';
|
||||||
import '../../../../controller/home/captin/widget/call_page.dart';
|
import '../../../../controller/home/captin/widget/call_page.dart';
|
||||||
|
import 'google_map_app.dart';
|
||||||
|
|
||||||
class PassengerInfoWindow extends StatelessWidget {
|
class PassengerInfoWindow extends StatelessWidget {
|
||||||
const PassengerInfoWindow({
|
const PassengerInfoWindow({
|
||||||
@@ -87,6 +91,24 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
Icons.email,
|
Icons.email,
|
||||||
color: AppColor.redColor,
|
color: AppColor.redColor,
|
||||||
)),
|
)),
|
||||||
|
const SizedBox(
|
||||||
|
width: 25,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
decoration:
|
||||||
|
AppStyle.boxDecoration,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
controller
|
||||||
|
.openGoogleMapFromDriverToPassenger();
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
MaterialCommunityIcons
|
||||||
|
.map_marker_radius,
|
||||||
|
size: 35,
|
||||||
|
color: AppColor.blueColor,
|
||||||
|
),
|
||||||
|
)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -165,7 +187,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
60
|
60
|
||||||
? AppColor.redColor
|
? AppColor.redColor
|
||||||
: AppColor.greenColor,
|
: AppColor.greenColor,
|
||||||
minHeight: 50,
|
minHeight: 35,
|
||||||
borderRadius: BorderRadius.circular(15),
|
borderRadius: BorderRadius.circular(15),
|
||||||
value: controller.progressToPassenger
|
value: controller.progressToPassenger
|
||||||
.toDouble(),
|
.toDouble(),
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
|
import 'package:SEFER/constant/colors.dart';
|
||||||
|
import 'package:SEFER/controller/profile/setting_controller.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/style.dart';
|
import 'package:SEFER/constant/style.dart';
|
||||||
import 'package:SEFER/views/lang/languages.dart';
|
import 'package:SEFER/views/lang/languages.dart';
|
||||||
@@ -9,6 +13,7 @@ class SettingsCaptain extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
Get.put(SettingController());
|
||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'Settings'.tr,
|
title: 'Settings'.tr,
|
||||||
body: [
|
body: [
|
||||||
@@ -20,14 +25,39 @@ class SettingsCaptain extends StatelessWidget {
|
|||||||
'Language'.tr,
|
'Language'.tr,
|
||||||
style: AppStyle.headTitle2,
|
style: AppStyle.headTitle2,
|
||||||
),
|
),
|
||||||
|
subtitle: Text('you can change languge of app'.tr),
|
||||||
onTap: () => Get.to(const Language()),
|
onTap: () => Get.to(const Language()),
|
||||||
),
|
),
|
||||||
// ListTile(
|
const Divider(
|
||||||
// leading: const Icon(Icons.notifications),
|
endIndent: 44,
|
||||||
// title: const Text('Notifications'),
|
indent: 44,
|
||||||
// onTap: () =>
|
),
|
||||||
// Navigator.pushNamed(context, '/notification-settings'),
|
ListTile(
|
||||||
// ),
|
leading: const Icon(
|
||||||
|
MaterialCommunityIcons.map_marker_radius,
|
||||||
|
color: AppColor.redColor,
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
'Google Map App'.tr,
|
||||||
|
style: AppStyle.headTitle2,
|
||||||
|
),
|
||||||
|
subtitle: Text(
|
||||||
|
'If you want to make Google Map App run dirctly when you apply order'
|
||||||
|
.tr),
|
||||||
|
trailing:
|
||||||
|
GetBuilder<SettingController>(builder: (settingController) {
|
||||||
|
return CupertinoSwitch(
|
||||||
|
value: settingController.isGoogleMapsEnabled,
|
||||||
|
onChanged: (bool value) {
|
||||||
|
settingController.onChangMapApp();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
const Divider(
|
||||||
|
endIndent: 44,
|
||||||
|
indent: 44,
|
||||||
|
),
|
||||||
// ListTile(
|
// ListTile(
|
||||||
// leading: const Icon(Icons.account_circle),
|
// leading: const Icon(Icons.account_circle),
|
||||||
// title: const Text('Account'),
|
// title: const Text('Account'),
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import '../../../controller/home/map_passenger_controller.dart';
|
|||||||
GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||||
Get.put(PaymentController());
|
Get.put(PaymentController());
|
||||||
return GetBuilder<MapPassengerController>(
|
return GetBuilder<MapPassengerController>(
|
||||||
builder: (controller) =>
|
builder: (controller) => controller.isBottomSheetShown &&
|
||||||
controller.isBottomSheetShown && controller.rideConfirm == false
|
controller.rideConfirm == false
|
||||||
? Positioned(
|
? Positioned(
|
||||||
left: 5,
|
left: 5,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
@@ -34,8 +34,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
height: 50,
|
height: 50,
|
||||||
width: Get.width * .94,
|
width: Get.width * .94,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding:
|
||||||
horizontal: 8),
|
const EdgeInsets.symmetric(horizontal: 8),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Your trip cost is'.tr +
|
'Your trip cost is'.tr +
|
||||||
' ${controller.totalCostPassenger.toStringAsFixed(2)} '
|
' ${controller.totalCostPassenger.toStringAsFixed(2)} '
|
||||||
@@ -84,6 +84,18 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
],
|
],
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(15))),
|
Radius.circular(15))),
|
||||||
|
child: ListView.builder(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemCount: controller
|
||||||
|
.dataCarsLocationByPassenger.length,
|
||||||
|
itemBuilder:
|
||||||
|
(BuildContext context, int index) {
|
||||||
|
return Container(
|
||||||
|
color: controller.gender == 'Female'
|
||||||
|
? const Color.fromARGB(
|
||||||
|
255, 246, 52, 181)
|
||||||
|
: AppColor.secondaryColor,
|
||||||
|
width: Get.width,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
@@ -91,7 +103,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: Get.width * .15,
|
width: Get.width * .15,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding:
|
||||||
|
const EdgeInsets.all(8.0),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/images/jeep.png',
|
'assets/images/jeep.png',
|
||||||
width: 50,
|
width: 50,
|
||||||
@@ -140,7 +153,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor
|
color: AppColor
|
||||||
.secondaryColor,
|
.secondaryColor,
|
||||||
shape: BoxShape.rectangle,
|
shape:
|
||||||
|
BoxShape.rectangle,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
width: 2,
|
width: 2,
|
||||||
color: AppColor
|
color: AppColor
|
||||||
@@ -148,7 +162,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
||||||
style: AppStyle.subtitle,
|
style:
|
||||||
|
AppStyle.subtitle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -167,7 +182,11 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)),
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
@@ -180,12 +199,11 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
color: AppColor.accentColor,
|
color: AppColor.accentColor,
|
||||||
offset: Offset(2, 2)),
|
offset: Offset(2, 2)),
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: AppColor.accentColor
|
color: AppColor.accentColor.withOpacity(.4),
|
||||||
.withOpacity(.4),
|
|
||||||
offset: const Offset(-2, -2))
|
offset: const Offset(-2, -2))
|
||||||
],
|
],
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius:
|
||||||
Radius.circular(15))),
|
const BorderRadius.all(Radius.circular(15))),
|
||||||
child: controller.data.isEmpty
|
child: controller.data.isEmpty
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: Center(
|
: Center(
|
||||||
@@ -227,8 +245,7 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
style: AppStyle.subtitle,
|
style: AppStyle.subtitle,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
controller.data[0]
|
controller.data[0]['end_address'],
|
||||||
['end_address'],
|
|
||||||
style: AppStyle.subtitle,
|
style: AppStyle.subtitle,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -247,19 +264,17 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor
|
color:
|
||||||
.secondaryColor,
|
AppColor.secondaryColor,
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(
|
BorderRadius.circular(12),
|
||||||
12),
|
|
||||||
// border: Border.all(),
|
// border: Border.all(),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.monetization_on,
|
Icons.monetization_on,
|
||||||
color:
|
color: Colors.green[400],
|
||||||
Colors.green[400],
|
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
@@ -315,12 +330,13 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
400],
|
400],
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap:
|
onTap: () {
|
||||||
() {
|
if (controller
|
||||||
if (controller.promoTaken ==
|
.promoTaken ==
|
||||||
false) {
|
false) {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
title: 'Add Promo'.tr,
|
title: 'Add Promo'.tr,
|
||||||
|
titleStyle: AppStyle.title,
|
||||||
content: Column(
|
content: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -330,6 +346,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: 'Promo Code'.tr,
|
labelText: 'Promo Code'.tr,
|
||||||
hintText: 'Enter promo code'.tr,
|
hintText: 'Enter promo code'.tr,
|
||||||
|
labelStyle: AppStyle.subtitle,
|
||||||
|
hintStyle: AppStyle.subtitle,
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
@@ -369,13 +387,14 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
'You have promo!'.tr,
|
'You have promo!'
|
||||||
|
.tr,
|
||||||
'',
|
'',
|
||||||
backgroundColor: AppColor.redColor);
|
backgroundColor:
|
||||||
|
AppColor.redColor);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child:
|
child: Text(
|
||||||
Text(
|
|
||||||
'Add Promo'
|
'Add Promo'
|
||||||
.tr,
|
.tr,
|
||||||
style: AppStyle
|
style: AppStyle
|
||||||
@@ -403,66 +422,67 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
.changeCashConfirmPageShown();
|
.changeCashConfirmPageShown();
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
: controller.isPassengerChosen ==
|
:
|
||||||
false
|
// controller.isPassengerChosen ==
|
||||||
? MyElevatedButton(
|
// false
|
||||||
title: 'Next'.tr,
|
// ? MyElevatedButton(
|
||||||
onPressed: () {
|
// title: 'Next'.tr,
|
||||||
controller
|
// onPressed: () {
|
||||||
.onChangedPassengersChoose();
|
// controller
|
||||||
Get.defaultDialog(
|
// .onChangedPassengersChoose();
|
||||||
barrierDismissible:
|
// Get.defaultDialog(
|
||||||
false,
|
// barrierDismissible:
|
||||||
title:
|
// false,
|
||||||
'How Many Passengers?'
|
// title:
|
||||||
.tr,
|
// 'How Many Passengers?'
|
||||||
titleStyle:
|
// .tr,
|
||||||
AppStyle
|
// titleStyle:
|
||||||
.title,
|
// AppStyle
|
||||||
content:
|
// .title,
|
||||||
Column(
|
// content:
|
||||||
children: [
|
// Column(
|
||||||
Text(
|
// children: [
|
||||||
'Allowed up to 4 Passengers.'
|
// Text(
|
||||||
.tr,
|
// 'Allowed up to 4 Passengers.'
|
||||||
style: AppStyle
|
// .tr,
|
||||||
.title,
|
// style: AppStyle
|
||||||
),
|
// .title,
|
||||||
SizedBox(
|
// ),
|
||||||
height:
|
// SizedBox(
|
||||||
200, // Set the desired height here
|
// height:
|
||||||
child:
|
// 200, // Set the desired height here
|
||||||
CupertinoPicker(
|
// child:
|
||||||
itemExtent:
|
// CupertinoPicker(
|
||||||
32,
|
// itemExtent:
|
||||||
onSelectedItemChanged:
|
// 32,
|
||||||
(index) {
|
// onSelectedItemChanged:
|
||||||
controller.onChangedPassengerCount(index +
|
// (index) {
|
||||||
1);
|
// controller.onChangedPassengerCount(index +
|
||||||
},
|
// 1);
|
||||||
children: [
|
// },
|
||||||
Text('1 Passenger'.tr),
|
// children: [
|
||||||
Text('2 Passengers'.tr),
|
// Text('1 Passenger'.tr),
|
||||||
Text('3 Passengers'.tr),
|
// Text('2 Passengers'.tr),
|
||||||
Text('4 Passengers'.tr),
|
// Text('3 Passengers'.tr),
|
||||||
],
|
// Text('4 Passengers'.tr),
|
||||||
),
|
// ],
|
||||||
),
|
// ),
|
||||||
|
// ),
|
||||||
|
// MyElevatedButton(
|
||||||
|
// title:
|
||||||
|
// 'Back',
|
||||||
|
// onPressed:
|
||||||
|
// () =>
|
||||||
|
// Get.back(),
|
||||||
|
// )
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// )
|
||||||
|
// :
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title:
|
title: 'Confirm Selection'
|
||||||
'Back',
|
|
||||||
onPressed:
|
|
||||||
() =>
|
|
||||||
Get.back(),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
: MyElevatedButton(
|
|
||||||
title:
|
|
||||||
'Confirm Selection'
|
|
||||||
.tr,
|
.tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
controller
|
controller
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
|||||||
return GetBuilder<MapPassengerController>(
|
return GetBuilder<MapPassengerController>(
|
||||||
builder: ((controller) => controller.rideConfirm
|
builder: ((controller) => controller.rideConfirm
|
||||||
? Positioned(
|
? Positioned(
|
||||||
top: Get.height * .2,
|
top: Get.height * .1,
|
||||||
left: Get.width * .2,
|
left: Get.width * .1,
|
||||||
right: Get.width * .2,
|
right: Get.width * .1,
|
||||||
child: ClipPath(
|
child: ClipPath(
|
||||||
clipper:
|
clipper:
|
||||||
HexagonClipper(), // CustomClipper to create a hexagon shape
|
HexagonClipper(), // CustomClipper to create a hexagon shape
|
||||||
@@ -19,7 +19,7 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
|||||||
duration: const Duration(microseconds: 300),
|
duration: const Duration(microseconds: 300),
|
||||||
height: 250,
|
height: 250,
|
||||||
width: 250,
|
width: 250,
|
||||||
decoration: AppStyle.boxDecoration,
|
// decoration: AppStyle.boxDecoration,
|
||||||
// gradient: const LinearGradient(
|
// gradient: const LinearGradient(
|
||||||
// colors: [AppColor.greenColor, AppColor.secondaryColor],
|
// colors: [AppColor.greenColor, AppColor.secondaryColor],
|
||||||
// begin: Alignment.topLeft,
|
// begin: Alignment.topLeft,
|
||||||
@@ -80,12 +80,6 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
|||||||
.toString(),
|
.toString(),
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
// Text(
|
|
||||||
// controller.dataCarsLocationByPassenger['message']
|
|
||||||
// [controller.carsOrder]['seats']
|
|
||||||
// .toString(),
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// ),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
@@ -95,6 +89,15 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
|||||||
.toString(),
|
.toString(),
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(border: Border.all(width: 2)),
|
||||||
|
child: Text(
|
||||||
|
controller.dataCarsLocationByPassenger['message']
|
||||||
|
[controller.carsOrder]['car_plate']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ GetBuilder<MapPassengerController> formSearchPlacesStart() {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: Get.width * .8,
|
width: Get.width * .75,
|
||||||
height: 40,
|
height: 40,
|
||||||
decoration:
|
decoration:
|
||||||
const BoxDecoration(color: AppColor.secondaryColor),
|
const BoxDecoration(color: AppColor.secondaryColor),
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
if (Platform.isIOS)
|
// if (Platform.isIOS)
|
||||||
AnimatedContainer(
|
AnimatedContainer(
|
||||||
duration: const Duration(microseconds: 200),
|
duration: const Duration(microseconds: 200),
|
||||||
width: controller.widthMapTypeAndTraffic,
|
width: controller.widthMapTypeAndTraffic,
|
||||||
@@ -82,6 +82,9 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
AnimatedContainer(
|
AnimatedContainer(
|
||||||
duration: const Duration(microseconds: 200),
|
duration: const Duration(microseconds: 200),
|
||||||
width: controller.widthMapTypeAndTraffic,
|
width: controller.widthMapTypeAndTraffic,
|
||||||
@@ -118,6 +121,7 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
// remoteID: '',
|
// remoteID: '',
|
||||||
// )
|
// )
|
||||||
// Get.to(() => const CallPage());
|
// Get.to(() => const CallPage());
|
||||||
|
print(box.read(BoxName.lang));
|
||||||
},
|
},
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.call,
|
Icons.call,
|
||||||
|
|||||||
@@ -130,6 +130,11 @@ class TimerToPassengerFromDriver extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Text(
|
||||||
|
'Please go to Car now '.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/colors.dart';
|
import 'package:SEFER/constant/colors.dart';
|
||||||
@@ -6,6 +7,8 @@ import 'package:SEFER/controller/functions/toast.dart';
|
|||||||
import 'package:SEFER/controller/payment/payment_controller.dart';
|
import 'package:SEFER/controller/payment/payment_controller.dart';
|
||||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
|
import '../../../main.dart';
|
||||||
|
|
||||||
class PassengerWalletDialoge extends StatelessWidget {
|
class PassengerWalletDialoge extends StatelessWidget {
|
||||||
const PassengerWalletDialoge({
|
const PassengerWalletDialoge({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -145,9 +148,9 @@ class PassengerWalletDialoge extends StatelessWidget {
|
|||||||
controller.makePaymentStripe(
|
controller.makePaymentStripe(
|
||||||
controller.selectedAmount!
|
controller.selectedAmount!
|
||||||
.toDouble(), // Convert int to double
|
.toDouble(), // Convert int to double
|
||||||
// 'EGP', () {
|
box.read(BoxName.countryCode) == 'Jordan'.tr
|
||||||
// 'USD', () {
|
? 'USD'
|
||||||
'JOD', () {
|
: 'EGP', () {
|
||||||
controller.addPassengerWallet();
|
controller.addPassengerWallet();
|
||||||
controller.changePromoSheetDialogue();
|
controller.changePromoSheetDialogue();
|
||||||
controller.getPassengerWallet();
|
controller.getPassengerWallet();
|
||||||
|
|||||||
@@ -51,14 +51,27 @@ class WaletCaptain extends StatelessWidget {
|
|||||||
? AppColor.redColor
|
? AppColor.redColor
|
||||||
: AppColor.greenColor,
|
: AppColor.greenColor,
|
||||||
),
|
),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Get.snackbar(
|
||||||
|
'the 500 points equal 30 JOD'.tr,
|
||||||
|
'the 500 points equal 30 JOD for you \nSo go and gain your money'
|
||||||
|
.tr,
|
||||||
|
backgroundColor: AppColor.greenColor,
|
||||||
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
|
duration: const Duration(seconds: 4),
|
||||||
|
);
|
||||||
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 4),
|
||||||
child: Text(
|
child: Text(
|
||||||
'${'Total Points is'.tr} ${captainWalletController.totalPoints.toString()} 💎',
|
'${'Total Points is'.tr} ${captainWalletController.totalPoints.toString()} 💎',
|
||||||
style: AppStyle.headTitle2,
|
style: AppStyle.headTitle2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:SEFER/views/auth/login_page.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -11,6 +12,7 @@ import 'package:SEFER/views/widgets/my_scafold.dart';
|
|||||||
import 'package:SEFER/views/widgets/my_textField.dart';
|
import 'package:SEFER/views/widgets/my_textField.dart';
|
||||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||||
|
|
||||||
|
import '../../../controller/auth/login_controller.dart';
|
||||||
import '../../../controller/functions/log_out.dart';
|
import '../../../controller/functions/log_out.dart';
|
||||||
|
|
||||||
class PassengerProfilePage extends StatelessWidget {
|
class PassengerProfilePage extends StatelessWidget {
|
||||||
@@ -317,8 +319,22 @@ class CountryPicker extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<ProfileController>(builder: (controller) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
Text("Select Your Country".tr),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
child: Text(
|
||||||
|
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
|
||||||
|
.tr),
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 300,
|
height: 300,
|
||||||
child: CupertinoPicker(
|
child: CupertinoPicker(
|
||||||
@@ -338,12 +354,16 @@ class CountryPicker extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title: controller.selectedCountry.toString(),
|
title: 'Select Country'.tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
Get.find<LoginController>()
|
||||||
|
.saveCountryCode(controller.selectedCountry.toString());
|
||||||
box.write(
|
box.write(
|
||||||
BoxName.countryCode, controller.selectedCountry.toString());
|
BoxName.countryCode, controller.selectedCountry.toString());
|
||||||
|
Get.off(LoginPage());
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import 'package:SEFER/main.dart';
|
|||||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
|
import '../../../constant/api_key.dart';
|
||||||
import '../../widgets/my_textField.dart';
|
import '../../widgets/my_textField.dart';
|
||||||
|
|
||||||
class ProfileCaptain extends StatelessWidget {
|
class ProfileCaptain extends StatelessWidget {
|
||||||
@@ -32,7 +33,7 @@ class ProfileCaptain extends StatelessWidget {
|
|||||||
radius: Get.width * 0.26,
|
radius: Get.width * 0.26,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
backgroundImage: CachedNetworkImageProvider(
|
backgroundImage: CachedNetworkImageProvider(
|
||||||
"${Env.serverPHP}/card_image/${box.read(BoxName.driverID)}.jpg",
|
'${AK.serverPHP}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
|
|||||||
@@ -832,6 +832,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.4"
|
version: "4.0.4"
|
||||||
|
google_generative_ai:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: google_generative_ai
|
||||||
|
sha256: "946f37c947bbc3591ed1c2878f8a41a0f75e74468dae791f84f14db3df3f3551"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.1-dev"
|
||||||
google_identity_services_web:
|
google_identity_services_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ dependencies:
|
|||||||
agora_rtc_engine: ^6.2.6
|
agora_rtc_engine: ^6.2.6
|
||||||
flutter_tts: ^3.8.5
|
flutter_tts: ^3.8.5
|
||||||
permission_handler: ^11.3.0
|
permission_handler: ^11.3.0
|
||||||
|
google_generative_ai: ^0.0.1-dev
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user