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
|
||||
payPalSecret=EKkasSl9O61lrfrbaJfXp1B-CIs2Rv71J0WPouxxugi38DsWaMhWpovJxN2ftYPQ0l6v9eoBvnyWkemp
|
||||
geminiApi=AIzaSyADz49pIaeO1grPEcpV8HNCJijzekd037o
|
||||
geminiApiMasa=AIzaSyAOxZ8NLyGzqXEIV1xSv5-t7MHctu1VQrA
|
||||
|
||||
|
||||
@@ -9,17 +9,17 @@ if (localPropertiesFile.exists()) {
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
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')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '11'
|
||||
flutterVersionCode = '12'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.1.1'
|
||||
flutterVersionName = '1.1.2'
|
||||
}
|
||||
|
||||
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.
|
||||
minSdkVersion 26
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode 18
|
||||
versionName '1.4.2'
|
||||
versionCode 20
|
||||
versionName '1.4.4'
|
||||
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ android {
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig signingConfigs.release
|
||||
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
class BoxName {
|
||||
static const String driverID = "driverID";
|
||||
static const String countryCode = "countryCode";
|
||||
static const String googlaMapApp = "googlaMapApp";
|
||||
|
||||
static const String lang = "lang";
|
||||
static const String statusDriverLocation = "statusDriverLocation";
|
||||
|
||||
@@ -135,6 +135,7 @@ class AppLink {
|
||||
// ===========================================
|
||||
static String pathImage = "$server/upload/types/";
|
||||
static String uploadImage = "$server/uploadImage.php";
|
||||
static String uploadImage1 = "$server/uploadImage1.php";
|
||||
static String uploadImagePortrate = "$server/uploadImagePortrate.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:google_fonts/google_fonts.dart';
|
||||
import 'colors.dart';
|
||||
@@ -7,22 +9,38 @@ class AppStyle {
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 40,
|
||||
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(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 26,
|
||||
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(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
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(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13,
|
||||
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(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:SEFER/controller/auth/captin/login_captin_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.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/car_license_page.dart';
|
||||
import '../../../views/home/Captin/home_captain/home_captin.dart';
|
||||
|
||||
class RegisterCaptainController extends GetxController {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
@@ -67,14 +69,21 @@ class RegisterCaptainController extends GetxController {
|
||||
|
||||
sendVerifications() async {
|
||||
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,
|
||||
});
|
||||
|
||||
if (res != 'failure') {
|
||||
if (Get.find<LoginCaptinController>().emailController.text.toString() !=
|
||||
'') {
|
||||
Get.offAll(() => HomeCaptain());
|
||||
} else {
|
||||
Get.to(() => CarLicensePage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nextToAIDetection() async {
|
||||
//Todo dont forget this
|
||||
|
||||
@@ -39,6 +39,11 @@ class LoginController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
void saveCountryCode(String countryCode) {
|
||||
box.write(BoxName.countryCode, countryCode);
|
||||
update();
|
||||
}
|
||||
|
||||
void adminDashboardOpen() async {
|
||||
if (formKeyAdmin.currentState!.validate()) {
|
||||
await DeviceInfoPlus.getDeviceInfo();
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import 'dart:convert';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/links.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:SEFER/env/env.dart';
|
||||
|
||||
import '../../constant/api_key.dart';
|
||||
import '../home/captin/map_driver_controller.dart';
|
||||
|
||||
class CRUD {
|
||||
Future<dynamic> get({
|
||||
@@ -32,8 +30,9 @@ class CRUD {
|
||||
);
|
||||
print("-----request----" + response.request.toString());
|
||||
// print("-----headers-----" + response.headers.toString());
|
||||
// print("-----payload-----" + payload.toString());
|
||||
print("-----payload-----" + payload.toString());
|
||||
if (response.statusCode == 200) {
|
||||
// print(response.body);
|
||||
var jsonData = jsonDecode(response.body);
|
||||
if (jsonData['status'] == 'success') {
|
||||
// print(jsonData);
|
||||
@@ -178,6 +177,7 @@ class CRUD {
|
||||
print(payload);
|
||||
|
||||
var jsonData = jsonDecode(response.body);
|
||||
// print(jsonData);
|
||||
if (response.statusCode == 200) {
|
||||
if (jsonData['status'] == 'success') {
|
||||
// Get.snackbar(
|
||||
@@ -205,7 +205,8 @@ class CRUD {
|
||||
request.headers.addAll(headers);
|
||||
|
||||
http.StreamedResponse response = await request.send();
|
||||
|
||||
// print(request.body);
|
||||
// print(response);
|
||||
if (response.statusCode == 200) {
|
||||
print(await response.stream.bytesToString());
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
import 'package:get/get.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/colors.dart';
|
||||
|
||||
class ContentController extends GetxController {
|
||||
class AI extends GetxController {
|
||||
final picker = ImagePicker();
|
||||
Map<String, dynamic> responseMap = {};
|
||||
Map<String, dynamic> responseCarLicenseMap = {};
|
||||
@@ -157,7 +158,7 @@ class ContentController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> generateDriverLicenseJordanContent() async {
|
||||
Future<void> getDriverLicenseJordanContent() async {
|
||||
await pickImage();
|
||||
isloading = true;
|
||||
update();
|
||||
@@ -253,7 +254,7 @@ class ContentController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> generateCarLicenseJordanContent() async {
|
||||
Future<void> getCarLicenseJordanContent() async {
|
||||
await pickImage();
|
||||
isloading = true;
|
||||
update();
|
||||
@@ -273,7 +274,114 @@ class ContentController extends GetxController {
|
||||
},
|
||||
{
|
||||
'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 {
|
||||
await pickImage();
|
||||
isloading = true;
|
||||
|
||||
@@ -31,7 +31,7 @@ class LocationController extends GetxController {
|
||||
}
|
||||
|
||||
void startLocationUpdates() async {
|
||||
_locationTimer = Timer.periodic(const Duration(seconds: 10), (timer) async {
|
||||
_locationTimer = Timer.periodic(const Duration(seconds: 5), (timer) async {
|
||||
try {
|
||||
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 isCallOn = false;
|
||||
String totalMoneyToday = '0';
|
||||
String rating = '0';
|
||||
String countRideToday = '0';
|
||||
String totalMoneyInSEFER = '0';
|
||||
String totalDurationToday = '0';
|
||||
@@ -104,7 +105,7 @@ class HomeCaptainController extends GetxController {
|
||||
await sql.getCustomQuery(customQuery);
|
||||
countRefuse = results[0]['count'].toString();
|
||||
update();
|
||||
if (int.parse(countRefuse) > 3 || double.parse(totalPoints) < -100) {
|
||||
if (int.parse(countRefuse) > 3 || double.parse(totalPoints) <= -500) {
|
||||
print('total point is $totalPoints');
|
||||
locationController.stopLocationUpdates();
|
||||
activeStartTime = null;
|
||||
@@ -196,11 +197,11 @@ class HomeCaptainController extends GetxController {
|
||||
await addToken();
|
||||
await getlocation();
|
||||
onButtonSelected();
|
||||
getPaymentToday();
|
||||
await getPaymentToday();
|
||||
getCountRideToday();
|
||||
getAllPayment();
|
||||
startPeriodicExecution();
|
||||
onMapCreated(mapHomeCaptaiController!);
|
||||
onMapCreated(mapHomeCaptaiController);
|
||||
getRefusedOrderByCaptain();
|
||||
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
||||
// LocationController().getLocation();
|
||||
@@ -222,7 +223,7 @@ class HomeCaptainController extends GetxController {
|
||||
payload: {'driverID': box.read(BoxName.driverID).toString()});
|
||||
data = jsonDecode(res);
|
||||
totalMoneyToday = data['message'][0]['todayAmount'];
|
||||
|
||||
rating = data['message'][0]['rating'].toString();
|
||||
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:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../../constant/api_key.dart';
|
||||
import '../../../constant/box_name.dart';
|
||||
@@ -130,6 +131,22 @@ class MapDriverController extends GetxController {
|
||||
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 {
|
||||
if (isDriverNearPassengerStart) {
|
||||
Timer.periodic(const Duration(seconds: 3), (timer) {
|
||||
@@ -248,6 +265,9 @@ class MapDriverController extends GetxController {
|
||||
'DriverIsGoingToPassenger',
|
||||
box.read(BoxName.name).toString(),
|
||||
tokenPassenger);
|
||||
if (box.read(BoxName.googlaMapApp) == true) {
|
||||
openGoogleMapFromDriverToPassenger();
|
||||
}
|
||||
}
|
||||
|
||||
bool isSocialPressed = false;
|
||||
@@ -291,7 +311,12 @@ class MapDriverController extends GetxController {
|
||||
}
|
||||
|
||||
Position? currentPosition;
|
||||
|
||||
void startRideFromDriver() async {
|
||||
double _distance =
|
||||
await calculateDistanseBetweenDriverAndPassengerLocation();
|
||||
|
||||
if (_distance < 50) {
|
||||
changeRideToBeginToPassenger();
|
||||
isPassengerInfoWindow = false;
|
||||
isRideStarted = true;
|
||||
@@ -312,30 +337,46 @@ class MapDriverController extends GetxController {
|
||||
await CRUD().post(link: AppLink.updateRides, payload: {
|
||||
'id': rideId,
|
||||
'rideTimeStart': DateTime.now().toString(),
|
||||
'status': 'Begin'
|
||||
'status': 'Begin',
|
||||
});
|
||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
'RideIsBegin', box.read(BoxName.name).toString(), tokenPassenger);
|
||||
rideIsBeginPassengerTimer();
|
||||
double pointsSubstraction = 0;
|
||||
pointsSubstraction = double.parse(paymentAmount) * -100;
|
||||
var res = await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
|
||||
pointsSubstraction = double.parse(paymentAmount) * -17;
|
||||
var res =
|
||||
await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
|
||||
'paymentID': 'rideId$rideId',
|
||||
'amount': (pointsSubstraction).toString(),
|
||||
'paymentMethod': paymentMethod,
|
||||
'driverID': box.read(BoxName.driverID).toString(),
|
||||
});
|
||||
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;
|
||||
|
||||
try {
|
||||
for (var i = 0; i < remainingTimeTimerRideBegin; i++) {
|
||||
await Future.delayed(const Duration(seconds: 2));
|
||||
locationSubscription =
|
||||
Geolocator.getPositionStream().listen((Position position) {
|
||||
currentPosition = position;
|
||||
@@ -343,24 +384,27 @@ class MapDriverController extends GetxController {
|
||||
mapController!.animateCamera(
|
||||
CameraUpdate.newCameraPosition(
|
||||
CameraPosition(
|
||||
target: LatLng(position.latitude, position.longitude),
|
||||
zoom: 7,
|
||||
target: myLocation,
|
||||
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) {
|
||||
locationSubscription?.cancel();
|
||||
}
|
||||
} catch (error) {
|
||||
debugPrint('Error listening to GPS: $error');
|
||||
// Handle GPS errors gracefully, e.g., show a user-friendly message
|
||||
// Handle GPS errors gracefully
|
||||
}
|
||||
|
||||
update();
|
||||
print('...................');
|
||||
print(d);
|
||||
print('...................');
|
||||
// Periodically call updateLocation again
|
||||
await Future.delayed(const Duration(seconds: 2));
|
||||
updateLocation();
|
||||
}
|
||||
|
||||
calculateDistanseBetweenDriverAndPassengerLocation() {
|
||||
@@ -527,6 +571,7 @@ class MapDriverController extends GetxController {
|
||||
int seconds = remainingTimeTimerRideBegin % 60;
|
||||
stringRemainingTimeRideBegin =
|
||||
'$minutes:${seconds.toString().padLeft(2, '0')}';
|
||||
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ class MapPassengerController extends GetxController {
|
||||
double heightBottomSheetShown = 0;
|
||||
double cashConfirmPageShown = 250;
|
||||
late String driverId;
|
||||
late String gender;
|
||||
double widthMapTypeAndTraffic = 50;
|
||||
double paymentPageShown = Get.height * .6;
|
||||
late LatLng southwest;
|
||||
@@ -910,6 +911,8 @@ class MapPassengerController extends GetxController {
|
||||
// if (dataCarsLocationByPassenger.length > carsOrder) {
|
||||
driverId = dataCarsLocationByPassenger['message'][carsOrder]['driver_id']
|
||||
.toString();
|
||||
gender = dataCarsLocationByPassenger['message'][carsOrder]['gender']
|
||||
.toString();
|
||||
// }
|
||||
|
||||
// //print('driverId==============$driverId');
|
||||
@@ -1368,7 +1371,7 @@ class MapPassengerController extends GetxController {
|
||||
(_locationData.latitude != null && _locationData.longitude != null
|
||||
? LatLng(_locationData.latitude!, _locationData.longitude!)
|
||||
: null)!;
|
||||
|
||||
newStartPointLocation = passengerLocation;
|
||||
// //print location details
|
||||
// //print('Accuracy: ${_locationData.accuracy}');
|
||||
// //print('Latitude: ${_locationData.latitude}');
|
||||
@@ -1576,7 +1579,9 @@ class MapPassengerController extends GetxController {
|
||||
double latPassengerDestination = double.parse(coordDestination[0]);
|
||||
double lngPassengerDestination = double.parse(coordDestination[1]);
|
||||
myDestination = LatLng(latPassengerDestination, lngPassengerDestination);
|
||||
|
||||
// if (origin.isEmpty) {
|
||||
// origin = passengerLocation.toString(); //todo
|
||||
// }
|
||||
isLoading = false;
|
||||
update();
|
||||
var url =
|
||||
@@ -1610,7 +1615,7 @@ class MapPassengerController extends GetxController {
|
||||
LatLngBounds(northeast: northeast, southwest: southwest);
|
||||
|
||||
// Fit the camera to the bounds
|
||||
var cameraUpdate = CameraUpdate.newLatLngBounds(boundsData, 130);
|
||||
var cameraUpdate = CameraUpdate.newLatLngBounds(boundsData, 160);
|
||||
mapController!.animateCamera(cameraUpdate);
|
||||
|
||||
// getDistanceFromText(data[0]['distance']['text']);
|
||||
|
||||
@@ -20,18 +20,21 @@ class LocaleController extends GetxController {
|
||||
case "ar":
|
||||
locale = const Locale("ar");
|
||||
appTheme = themeArabic;
|
||||
box.write(BoxName.lang, 'ar');
|
||||
break;
|
||||
case "en":
|
||||
locale = const Locale("en");
|
||||
appTheme = themeEnglish;
|
||||
box.write(BoxName.lang, 'en');
|
||||
break;
|
||||
case "tr":
|
||||
locale = const Locale("tr");
|
||||
appTheme = themeEnglish;
|
||||
box.write(BoxName.lang, 'tr');
|
||||
break;
|
||||
default:
|
||||
locale = Locale(Get.deviceLocale!.languageCode);
|
||||
|
||||
box.write(BoxName.lang, 'en');
|
||||
appTheme = themeEnglish;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -202,16 +202,16 @@ class MyTranslation extends Translations {
|
||||
"you will pay to Driver": "ستدفع للسائق",
|
||||
"Driver Cancel Your Trip": "السائق ألغى رحلتك",
|
||||
"you will pay to Driver you will be pay the cost of driver time look to your SEFER Wallet":
|
||||
"ستدفع للسائق تكلفة وقته تفقد محفظتك في سيفر",
|
||||
"ستدفع للسائق تكلفة وقته تفقد محفظتك في سفر",
|
||||
"I will go now": "سأذهب الآن",
|
||||
"You Have Tips": "لديك زيادة مال",
|
||||
" tips\nTotal is": "زيادة مال\nالمجموع هو",
|
||||
"No,I want": "لا، أريد",
|
||||
"Your fee is ": "أجرك هو",
|
||||
"Do you want to pay Tips for this Driver":
|
||||
"هل تريد دفع زيادة مال لهذا السائق؟",
|
||||
"Tip is ": "زيادة المال هي",
|
||||
"Tip is": "زيادة المال هي",
|
||||
"هل تريد دفع أكراميه لهذا السائق؟",
|
||||
"Tip is ": " مبلغ الاكراميه هو",
|
||||
"Tip is": " مبلغ الاكراميه هو",
|
||||
"Camera Access Denied.": "تم رفض الوصول إلى الكاميرا.",
|
||||
"Open Settings": "افتح الإعدادات",
|
||||
"GPS Required Allow !.": "تمكن الـ GPS مطلوب!",
|
||||
@@ -263,8 +263,8 @@ class MyTranslation extends Translations {
|
||||
"Feedback data saved successfully": "تم حفظ بيانات التعليقات بنجاح",
|
||||
"No Promo for today .": "لا يوجد عرض ترويجي اليوم.",
|
||||
"Select your destination": "اختر وجهتك",
|
||||
"Search for your Start point": "بحث عن نقطة بدايتك",
|
||||
"Search for waypoint": "بحث عن نقطة الوجهة",
|
||||
"Search for your Start point": "بحث عن نقطة الانطلاق",
|
||||
"Search for waypoint": "بحث عن النقطة الة",
|
||||
"Current Location": "الموقع الحالي",
|
||||
"Add Location 1": "إضافة الموقع 1",
|
||||
'You must Verify email !.': "يجب التحقق من البريد الإلكتروني!",
|
||||
@@ -273,6 +273,9 @@ class MyTranslation extends Translations {
|
||||
'Select Date': "اختر التاريخ",
|
||||
'Birth Date': "تاريخ الميلاد",
|
||||
'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': "تم تحديث الرمز",
|
||||
'Add Location 2': "إضافة الموقع 2",
|
||||
'Add Location 3': "إضافة الموقع 3",
|
||||
@@ -286,13 +289,14 @@ class MyTranslation extends Translations {
|
||||
'is driving a ': "يقود",
|
||||
' with license plate ': "بلوحة ترخيص",
|
||||
' I am currently located at ': "أنا حاليا في",
|
||||
'Please go to Car now ': 'الرجاء التحرك الى السياره الان',
|
||||
' If you need to reach me, please contact the driver directly at':
|
||||
"إذا كنت تحتاج إلى التواصل معي، يرجى التواصل مع السائق مباشرة على",
|
||||
'No Car or Driver Found in your area.':
|
||||
"لم يتم العثور على سيارة أو سائق في منطقتك.",
|
||||
'Please Try anther time ': "الرجاء إعادة المحاولة",
|
||||
'There no Driver Aplly your order sorry for that ':
|
||||
"لا يوجد سائق قدم طلبك، نعتذر عن ذلك",
|
||||
"لا يوجد سائق قبل طلبك، نعتذر عن ذلك",
|
||||
'Trip Cancelled': "تم إلغاء الرحلة",
|
||||
'The Driver Will be in your location soon .':
|
||||
"سيكون السائق قريبا في موقعك.",
|
||||
@@ -336,7 +340,7 @@ class MyTranslation extends Translations {
|
||||
'Date of Birth': "تاريخ الميلاد",
|
||||
'Age': "العمر",
|
||||
'Expiry Date': "تاريخ الإنتهاء",
|
||||
'Lets check Car license ': "دعونا نتحقق من رخصة السيارة ",
|
||||
'Lets check Car license ': "دعنا نتحقق من رخصة السيارة ",
|
||||
'Color': "اللون",
|
||||
'Car Kind': "نوع السيارة",
|
||||
'Year': "السنة",
|
||||
@@ -345,9 +349,10 @@ class MyTranslation extends Translations {
|
||||
'Car License Card': "بطاقة رخصة السيارة",
|
||||
'No image selected yet': "لم يتم إختيار أي صورة بعد",
|
||||
'Made :': "الصناعة:",
|
||||
'model :': "النموذج:",
|
||||
'model :': "النوع:",
|
||||
'VIN :': "رقم الشاصي:",
|
||||
'year :': "السنة:",
|
||||
'ُExpire Date': 'تاريخ الانتهاء',
|
||||
'Login Driver': "تسجيل دخول السائق",
|
||||
'Password must br at least 6 character.':
|
||||
"كلمة المرور يجب أن تكون على الأقل 6 أحرف.",
|
||||
@@ -366,13 +371,16 @@ class MyTranslation extends Translations {
|
||||
'Your name': "إسمك",
|
||||
'Your password': "كلمة المرور الخاصة بك",
|
||||
'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': "أدخل مدينتك",
|
||||
'History Page': "صفحة التاريخ",
|
||||
"Select Your Country": "تحديد دولتك",
|
||||
'History Page': "ارشيف الرحلات",
|
||||
'This Trip Cancelled': "تم إلغاء هذه الرحلة",
|
||||
'Trip Detail': "تفاصيل الرحلة",
|
||||
'Trip on Map Click here': "ضغط هنا لعرض الرحلة على الخريطة",
|
||||
'Trip on Map Click here': "اضغط هنا لعرض الرحلة على الخريطة",
|
||||
'Order ID': "رقم الطلب",
|
||||
'Price is': "السعر هو",
|
||||
'Distance is': "المسافة هي",
|
||||
@@ -430,7 +438,7 @@ class MyTranslation extends Translations {
|
||||
'Distance from Passenger to destination is ':
|
||||
"المسافة من الراكب إلى الوجهة هي ",
|
||||
'Cost Of Trip IS ': "تكلفة الرحلة هي ",
|
||||
'Accept Order': "قبول الطلب",
|
||||
'Accept Order': "تم قبول الطلب",
|
||||
'rejct your order.': "رفض طلبك.",
|
||||
'Bottom Bar Example': "مثال لشريط الأسفل",
|
||||
'Statistics': "الإحصائيات",
|
||||
@@ -534,29 +542,28 @@ class MyTranslation extends Translations {
|
||||
'Car Details': "تفاصيل السيارة",
|
||||
'VIN is': "رقم الشاصي هو",
|
||||
'Color is ': "اللون هو ",
|
||||
'Make is ': "الصانع هو",
|
||||
'Model is': "النموذج هو",
|
||||
'Make is ': "الشركه الصانعه",
|
||||
'Model is': "النوع هو",
|
||||
'Year is': "السنة هي",
|
||||
'Expiration Date ': "تاريخ انتهاء الصلاحية ",
|
||||
'Expiration Date ': "تاريخ الانتهاء ",
|
||||
'Edit Your data': "تعديل بياناتك",
|
||||
'write vin for your car': "اكتب رقم الشاصي لسيارتك",
|
||||
'VIN': "رقم الشاصي",
|
||||
'write Color for your car': "اكتب لون سيارتك",
|
||||
'write Make for your car': "اكتب صانع سيارتك",
|
||||
'Make': "الصانع",
|
||||
'write Model for your car': "اكتب نموذج سيارتك",
|
||||
'Model': "النموذج",
|
||||
'write Year for your car': "اكتب سنة سيارتك",
|
||||
'Expiration Date': "تاريخ انتهاء الصلاحية",
|
||||
'write Expiration Date for your car':
|
||||
"اكتب تاريخ انتهاء صلاحية سيارتك",
|
||||
'Make': "الشركه الصانعه",
|
||||
'write Model for your car': "اكتب نوع سيارتك",
|
||||
'Model': "النوع",
|
||||
'write Year for your car': "اكتب سنة الصنع",
|
||||
'Expiration Date': "تاريخ الانتهاء ",
|
||||
'write Expiration Date for your car': "اكتب تاريخ انتهاء رخصه سيارتك",
|
||||
'Tariffs': "التعرفه",
|
||||
'Minimum fare': "الحد الأدنى للأجرة",
|
||||
'Maximum fare': "الحد الأقصى للأجرة",
|
||||
'JOD': "د.أ",
|
||||
'Flag-down fee': "رسوم التشغيل",
|
||||
'Including Tax': "بما في ذلك الضرائب",
|
||||
'BookingFee': "رسوم الحجز",
|
||||
'BookingFee': "رسوم الطلب",
|
||||
'Morning': "الصباح",
|
||||
'from 07:30 till 10:30 (Thursday, Friday, Saturday, Monday)':
|
||||
"من 07:30 إلى 10:30 (يوم الخميس، الجمعة، السبت، الإثنين)",
|
||||
@@ -565,7 +572,8 @@ class MyTranslation extends Translations {
|
||||
"من 12:00 إلى 15:00 (يوم الخميس، الجمعة، السبت، الإثنين)",
|
||||
'Night': "الليل",
|
||||
'You have in account': 'يوجد في حسابك ',
|
||||
'Ride Today :': 'عدد الرحلات : ',
|
||||
'Select Country': 'اختر الدوله',
|
||||
'Ride Today : ': 'عدد الرحلات : ',
|
||||
'After this period\nYou can\'t cancel!':
|
||||
'بعد هذه الفتره \nلا تستطيع الغاء الرحله',
|
||||
'from 23:59 till 05:30': "من 23:59 إلى 05:30",
|
||||
@@ -583,6 +591,9 @@ class MyTranslation extends Translations {
|
||||
'OrderId': 'رقم الرحله',
|
||||
'created time': "وقت الرحله",
|
||||
'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': 'القيمه المدخله اقل من رصيدك',
|
||||
},
|
||||
"tr": {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/links.dart';
|
||||
@@ -16,7 +17,19 @@ class DriverWalletHistoryController extends GetxController {
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getWalletByDriver,
|
||||
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'];
|
||||
print(archive);
|
||||
isLoading = false;
|
||||
|
||||
@@ -17,15 +17,36 @@ class CaptainProfileController extends GetxController {
|
||||
TextEditingController expirationDate = TextEditingController();
|
||||
|
||||
Future updateFields() async {
|
||||
var res = await CRUD().post(link: AppLink.updateRegisrationCar, payload: {
|
||||
var payload = {
|
||||
'driverID': box.read(BoxName.driverID),
|
||||
'vin': vin.text,
|
||||
'color': color.text,
|
||||
'model': model.text,
|
||||
'make': make.text,
|
||||
'year': year.text,
|
||||
'expirationDate': expirationDate.text,
|
||||
});
|
||||
};
|
||||
|
||||
if (vin.text.isNotEmpty) {
|
||||
payload['vin'] = vin.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') {
|
||||
box.write(BoxName.vin, vin.text);
|
||||
@@ -34,7 +55,7 @@ class CaptainProfileController extends GetxController {
|
||||
box.write(BoxName.make, make.text);
|
||||
box.write(BoxName.year, year.text);
|
||||
box.write(BoxName.expirationDate, expirationDate.text);
|
||||
|
||||
update();
|
||||
Get.back();
|
||||
}
|
||||
}
|
||||
@@ -56,7 +77,7 @@ class CaptainProfileController extends GetxController {
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
if (box.read(BoxName.dobDriver).toString().isEmpty) {
|
||||
if (box.read(BoxName.dobDriver) == null) {
|
||||
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 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -51,12 +51,12 @@ class AdminHomePage extends StatelessWidget {
|
||||
title: 'Static',
|
||||
onPressed: () => Get.to(() => StaticDash())),
|
||||
AdminWidgetsDashBoard(
|
||||
title: 'Gemeni',
|
||||
onPressed: () => ContentController().generateContent()),
|
||||
title: 'Gemeni', onPressed: () => AI().generateContent()),
|
||||
AdminWidgetsDashBoard(
|
||||
title: 'GemeniCarRegistration',
|
||||
onPressed: () =>
|
||||
ContentController().getFromCarRegistration()),
|
||||
title: 'CarLicenseJordan',
|
||||
onPressed: () => AI().carLicenseJordan()),
|
||||
AdminWidgetsDashBoard(
|
||||
title: 'JordanID', onPressed: () => AI().jordanID()),
|
||||
AdminWidgetsDashBoard(
|
||||
title: 'Llama',
|
||||
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/login_controller.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../home/profile/passenger_profile_page.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import '../../widgets/my_scafold.dart';
|
||||
import '../../widgets/mycircular.dart';
|
||||
@@ -32,6 +33,8 @@ class LoginCaptin extends StatelessWidget {
|
||||
body: [
|
||||
if (box.read(BoxName.agreeTerms) != 'agreed')
|
||||
agreedPage()
|
||||
else if (box.read(BoxName.countryCode) == null)
|
||||
CountryPicker()
|
||||
else
|
||||
SingleChildScrollView(
|
||||
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:get/get.dart';
|
||||
import 'package:SEFER/controller/auth/captin/register_captin_controller.dart';
|
||||
@@ -33,74 +35,8 @@ class RegisterCaptin extends StatelessWidget {
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(children: [
|
||||
// Row(
|
||||
// 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,
|
||||
// ),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .8,
|
||||
child: TextFormField(
|
||||
@@ -207,60 +143,18 @@ class RegisterCaptin extends StatelessWidget {
|
||||
const SizedBox(
|
||||
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(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () => controller.nextToAIDetection()),
|
||||
// MyElevatedButton(
|
||||
// //todo remove it for test
|
||||
// title: 'Car registration ai '.tr,
|
||||
// kolor: AppColor.blueColor,
|
||||
// onPressed: () => Get.to(() => CarLicensePage())),
|
||||
|
||||
// controller.isloading
|
||||
// ? const MyCircularProgressIndicator()
|
||||
// : MyElevatedButton(
|
||||
// title: 'Register Captain'.tr,
|
||||
// onPressed: () => controller.register())
|
||||
]),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
print(box.write(BoxName.countryCode, 'Jordan'));
|
||||
print(box.read(BoxName.countryCode));
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -236,21 +236,31 @@ class LoginPage extends StatelessWidget {
|
||||
),
|
||||
// const Spacer(),
|
||||
const SizedBox(
|
||||
height: 40,
|
||||
height: 100,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () => Get.to(LoginCaptin()),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
const Icon(Icons.drive_eta_rounded),
|
||||
const Icon(
|
||||
Icons.drive_eta_rounded,
|
||||
size: 50,
|
||||
),
|
||||
Text(
|
||||
'If You Want be Driver Click Here.'.tr,
|
||||
'If You Want be Driver \nClick Here.'.tr,
|
||||
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(
|
||||
text: TextSpan(
|
||||
text:
|
||||
'By selecting "I Agree" below, I have reviewed and agree to the Terms of Use and acknowledge the ',
|
||||
'By selecting "I Agree" below, I have reviewed and agree to the Terms of Use and acknowledge the '
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
@@ -308,8 +319,8 @@ class LoginPage extends StatelessWidget {
|
||||
),
|
||||
));
|
||||
}),
|
||||
const TextSpan(
|
||||
text: '. I am at least 18 years of age.',
|
||||
TextSpan(
|
||||
text: '. I am at least 18 years of age.'.tr,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -26,6 +26,6 @@ class PassengerLocationMapPage extends StatelessWidget {
|
||||
const SosConnect(),
|
||||
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/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:SEFER/constant/box_name.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/notification/notification_captain.dart';
|
||||
|
||||
import '../../../../controller/functions/upload_image.dart';
|
||||
|
||||
class DrawerCaptain extends StatelessWidget {
|
||||
ImageController imageController = Get.put(ImageController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String writeText(int times) {
|
||||
return '*' * times;
|
||||
}
|
||||
|
||||
return Drawer(
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -24,18 +41,84 @@ class DrawerCaptain extends StatelessWidget {
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
AppColor.greenColor,
|
||||
AppColor.yellowColor
|
||||
], // Define your gradient colors
|
||||
AppColor.yellowColor,
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
),
|
||||
accountName: Text(box.read(BoxName.nameDriver)),
|
||||
accountEmail: Text(box.read(BoxName.emailDriver)),
|
||||
currentAccountPicture: const CircleAvatar(
|
||||
backgroundImage: AssetImage('path_to_profile_image'),
|
||||
), //todo image from server
|
||||
currentAccountPictureSize: const Size.square(100),
|
||||
arrowColor: AppColor.deepPurpleAccent,
|
||||
accountName: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
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(
|
||||
leading: const Icon(Icons.account_balance_wallet),
|
||||
title: Text('Wallet'.tr),
|
||||
|
||||
@@ -27,7 +27,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(OrderRequestController());
|
||||
|
||||
Get.put(HomeCaptainController());
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColor.greenColor,
|
||||
@@ -135,7 +135,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.wallet,
|
||||
@@ -156,15 +156,19 @@ class HomeCaptain extends StatelessWidget {
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8, vertical: 2),
|
||||
child: Text(
|
||||
'Ride Today :'.tr +
|
||||
'Ride Today : '.tr +
|
||||
Get.find<HomeCaptainController>()
|
||||
.countRideToday,
|
||||
style: AppStyle.title,
|
||||
style: AppStyle.title
|
||||
.copyWith(color: AppColor.secondaryColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -16,6 +16,7 @@ class GoogleDriverMap extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Get.put(MapDriverController());
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: GetBuilder<MapDriverController>(
|
||||
@@ -24,11 +25,12 @@ class GoogleDriverMap extends StatelessWidget {
|
||||
initialCameraPosition: CameraPosition(
|
||||
// bearing: 45,
|
||||
target: locationController.myLocation,
|
||||
zoom: 15,
|
||||
zoom: 16,
|
||||
tilt: 40,
|
||||
),
|
||||
onCameraMoveStarted: () {},
|
||||
onCameraMove: (position) {
|
||||
locationController.myLocation = position.target;
|
||||
// locationController.myLocation = position.target;
|
||||
print(position);
|
||||
},
|
||||
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/widgets.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
@@ -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/main.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../../../controller/functions/launch.dart';
|
||||
import '../../../../controller/home/captin/widget/call_page.dart';
|
||||
import 'google_map_app.dart';
|
||||
|
||||
class PassengerInfoWindow extends StatelessWidget {
|
||||
const PassengerInfoWindow({
|
||||
@@ -87,6 +91,24 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
Icons.email,
|
||||
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
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 50,
|
||||
minHeight: 35,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
value: controller.progressToPassenger
|
||||
.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_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/views/lang/languages.dart';
|
||||
@@ -9,6 +13,7 @@ class SettingsCaptain extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(SettingController());
|
||||
return MyScafolld(
|
||||
title: 'Settings'.tr,
|
||||
body: [
|
||||
@@ -20,14 +25,39 @@ class SettingsCaptain extends StatelessWidget {
|
||||
'Language'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text('you can change languge of app'.tr),
|
||||
onTap: () => Get.to(const Language()),
|
||||
),
|
||||
// ListTile(
|
||||
// leading: const Icon(Icons.notifications),
|
||||
// title: const Text('Notifications'),
|
||||
// onTap: () =>
|
||||
// Navigator.pushNamed(context, '/notification-settings'),
|
||||
// ),
|
||||
const Divider(
|
||||
endIndent: 44,
|
||||
indent: 44,
|
||||
),
|
||||
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(
|
||||
// leading: const Icon(Icons.account_circle),
|
||||
// title: const Text('Account'),
|
||||
|
||||
@@ -14,8 +14,8 @@ import '../../../controller/home/map_passenger_controller.dart';
|
||||
GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
Get.put(PaymentController());
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) =>
|
||||
controller.isBottomSheetShown && controller.rideConfirm == false
|
||||
builder: (controller) => controller.isBottomSheetShown &&
|
||||
controller.rideConfirm == false
|
||||
? Positioned(
|
||||
left: 5,
|
||||
bottom: 0,
|
||||
@@ -34,8 +34,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
height: 50,
|
||||
width: Get.width * .94,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Text(
|
||||
'Your trip cost is'.tr +
|
||||
' ${controller.totalCostPassenger.toStringAsFixed(2)} '
|
||||
@@ -84,6 +84,18 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
],
|
||||
borderRadius: const BorderRadius.all(
|
||||
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(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
@@ -91,7 +103,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
SizedBox(
|
||||
width: Get.width * .15,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
'assets/images/jeep.png',
|
||||
width: 50,
|
||||
@@ -140,7 +153,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor
|
||||
.secondaryColor,
|
||||
shape: BoxShape.rectangle,
|
||||
shape:
|
||||
BoxShape.rectangle,
|
||||
border: Border.all(
|
||||
width: 2,
|
||||
color: AppColor
|
||||
@@ -148,7 +162,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
||||
style: AppStyle.subtitle,
|
||||
style:
|
||||
AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -167,7 +182,11 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
@@ -180,12 +199,11 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(2, 2)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor
|
||||
.withOpacity(.4),
|
||||
color: AppColor.accentColor.withOpacity(.4),
|
||||
offset: const Offset(-2, -2))
|
||||
],
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(15))),
|
||||
borderRadius:
|
||||
const BorderRadius.all(Radius.circular(15))),
|
||||
child: controller.data.isEmpty
|
||||
? const SizedBox()
|
||||
: Center(
|
||||
@@ -227,8 +245,7 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
controller.data[0]
|
||||
['end_address'],
|
||||
controller.data[0]['end_address'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
@@ -247,19 +264,17 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor
|
||||
.secondaryColor,
|
||||
color:
|
||||
AppColor.secondaryColor,
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12),
|
||||
BorderRadius.circular(12),
|
||||
// border: Border.all(),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.monetization_on,
|
||||
color:
|
||||
Colors.green[400],
|
||||
color: Colors.green[400],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
@@ -315,12 +330,13 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
400],
|
||||
),
|
||||
InkWell(
|
||||
onTap:
|
||||
() {
|
||||
if (controller.promoTaken ==
|
||||
onTap: () {
|
||||
if (controller
|
||||
.promoTaken ==
|
||||
false) {
|
||||
Get.defaultDialog(
|
||||
title: 'Add Promo'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
@@ -330,6 +346,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Promo Code'.tr,
|
||||
hintText: 'Enter promo code'.tr,
|
||||
labelStyle: AppStyle.subtitle,
|
||||
hintStyle: AppStyle.subtitle,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
@@ -369,13 +387,14 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
));
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'You have promo!'.tr,
|
||||
'You have promo!'
|
||||
.tr,
|
||||
'',
|
||||
backgroundColor: AppColor.redColor);
|
||||
backgroundColor:
|
||||
AppColor.redColor);
|
||||
}
|
||||
},
|
||||
child:
|
||||
Text(
|
||||
child: Text(
|
||||
'Add Promo'
|
||||
.tr,
|
||||
style: AppStyle
|
||||
@@ -403,66 +422,67 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
.changeCashConfirmPageShown();
|
||||
},
|
||||
)
|
||||
: controller.isPassengerChosen ==
|
||||
false
|
||||
? MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.onChangedPassengersChoose();
|
||||
Get.defaultDialog(
|
||||
barrierDismissible:
|
||||
false,
|
||||
title:
|
||||
'How Many Passengers?'
|
||||
.tr,
|
||||
titleStyle:
|
||||
AppStyle
|
||||
.title,
|
||||
content:
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'Allowed up to 4 Passengers.'
|
||||
.tr,
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
SizedBox(
|
||||
height:
|
||||
200, // Set the desired height here
|
||||
child:
|
||||
CupertinoPicker(
|
||||
itemExtent:
|
||||
32,
|
||||
onSelectedItemChanged:
|
||||
(index) {
|
||||
controller.onChangedPassengerCount(index +
|
||||
1);
|
||||
},
|
||||
children: [
|
||||
Text('1 Passenger'.tr),
|
||||
Text('2 Passengers'.tr),
|
||||
Text('3 Passengers'.tr),
|
||||
Text('4 Passengers'.tr),
|
||||
],
|
||||
),
|
||||
),
|
||||
:
|
||||
// controller.isPassengerChosen ==
|
||||
// false
|
||||
// ? MyElevatedButton(
|
||||
// title: 'Next'.tr,
|
||||
// onPressed: () {
|
||||
// controller
|
||||
// .onChangedPassengersChoose();
|
||||
// Get.defaultDialog(
|
||||
// barrierDismissible:
|
||||
// false,
|
||||
// title:
|
||||
// 'How Many Passengers?'
|
||||
// .tr,
|
||||
// titleStyle:
|
||||
// AppStyle
|
||||
// .title,
|
||||
// content:
|
||||
// Column(
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Allowed up to 4 Passengers.'
|
||||
// .tr,
|
||||
// style: AppStyle
|
||||
// .title,
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height:
|
||||
// 200, // Set the desired height here
|
||||
// child:
|
||||
// CupertinoPicker(
|
||||
// itemExtent:
|
||||
// 32,
|
||||
// onSelectedItemChanged:
|
||||
// (index) {
|
||||
// controller.onChangedPassengerCount(index +
|
||||
// 1);
|
||||
// },
|
||||
// children: [
|
||||
// Text('1 Passenger'.tr),
|
||||
// Text('2 Passengers'.tr),
|
||||
// Text('3 Passengers'.tr),
|
||||
// Text('4 Passengers'.tr),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// MyElevatedButton(
|
||||
// title:
|
||||
// 'Back',
|
||||
// onPressed:
|
||||
// () =>
|
||||
// Get.back(),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// )
|
||||
// :
|
||||
MyElevatedButton(
|
||||
title:
|
||||
'Back',
|
||||
onPressed:
|
||||
() =>
|
||||
Get.back(),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
)
|
||||
: MyElevatedButton(
|
||||
title:
|
||||
'Confirm Selection'
|
||||
title: 'Confirm Selection'
|
||||
.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
|
||||
@@ -9,9 +9,9 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: ((controller) => controller.rideConfirm
|
||||
? Positioned(
|
||||
top: Get.height * .2,
|
||||
left: Get.width * .2,
|
||||
right: Get.width * .2,
|
||||
top: Get.height * .1,
|
||||
left: Get.width * .1,
|
||||
right: Get.width * .1,
|
||||
child: ClipPath(
|
||||
clipper:
|
||||
HexagonClipper(), // CustomClipper to create a hexagon shape
|
||||
@@ -19,7 +19,7 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
||||
duration: const Duration(microseconds: 300),
|
||||
height: 250,
|
||||
width: 250,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
// gradient: const LinearGradient(
|
||||
// colors: [AppColor.greenColor, AppColor.secondaryColor],
|
||||
// begin: Alignment.topLeft,
|
||||
@@ -80,12 +80,6 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
||||
.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
// Text(
|
||||
// controller.dataCarsLocationByPassenger['message']
|
||||
// [controller.carsOrder]['seats']
|
||||
// .toString(),
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
@@ -95,6 +89,15 @@ GetBuilder<MapPassengerController> hexagonClipper() {
|
||||
.toString(),
|
||||
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,
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width * .8,
|
||||
width: Get.width * .75,
|
||||
height: 40,
|
||||
decoration:
|
||||
const BoxDecoration(color: AppColor.secondaryColor),
|
||||
|
||||
@@ -61,7 +61,7 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
if (Platform.isIOS)
|
||||
// if (Platform.isIOS)
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
@@ -82,6 +82,9 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
@@ -118,6 +121,7 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
// remoteID: '',
|
||||
// )
|
||||
// Get.to(() => const CallPage());
|
||||
print(box.read(BoxName.lang));
|
||||
},
|
||||
icon: const Icon(
|
||||
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:get/get.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/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../main.dart';
|
||||
|
||||
class PassengerWalletDialoge extends StatelessWidget {
|
||||
const PassengerWalletDialoge({
|
||||
super.key,
|
||||
@@ -145,9 +148,9 @@ class PassengerWalletDialoge extends StatelessWidget {
|
||||
controller.makePaymentStripe(
|
||||
controller.selectedAmount!
|
||||
.toDouble(), // Convert int to double
|
||||
// 'EGP', () {
|
||||
// 'USD', () {
|
||||
'JOD', () {
|
||||
box.read(BoxName.countryCode) == 'Jordan'.tr
|
||||
? 'USD'
|
||||
: 'EGP', () {
|
||||
controller.addPassengerWallet();
|
||||
controller.changePromoSheetDialogue();
|
||||
controller.getPassengerWallet();
|
||||
|
||||
@@ -51,14 +51,27 @@ class WaletCaptain extends StatelessWidget {
|
||||
? AppColor.redColor
|
||||
: 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(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text(
|
||||
'${'Total Points is'.tr} ${captainWalletController.totalPoints.toString()} 💎',
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:SEFER/views/auth/login_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.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/mycircular.dart';
|
||||
|
||||
import '../../../controller/auth/login_controller.dart';
|
||||
import '../../../controller/functions/log_out.dart';
|
||||
|
||||
class PassengerProfilePage extends StatelessWidget {
|
||||
@@ -317,8 +319,22 @@ class CountryPicker extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<ProfileController>(builder: (controller) {
|
||||
return Column(
|
||||
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(
|
||||
height: 300,
|
||||
child: CupertinoPicker(
|
||||
@@ -338,12 +354,16 @@ class CountryPicker extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: controller.selectedCountry.toString(),
|
||||
title: 'Select Country'.tr,
|
||||
onPressed: () {
|
||||
Get.find<LoginController>()
|
||||
.saveCountryCode(controller.selectedCountry.toString());
|
||||
box.write(
|
||||
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/my_scafold.dart';
|
||||
|
||||
import '../../../constant/api_key.dart';
|
||||
import '../../widgets/my_textField.dart';
|
||||
|
||||
class ProfileCaptain extends StatelessWidget {
|
||||
@@ -32,7 +33,7 @@ class ProfileCaptain extends StatelessWidget {
|
||||
radius: Get.width * 0.26,
|
||||
backgroundColor: Colors.white,
|
||||
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),
|
||||
|
||||
@@ -832,6 +832,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -53,6 +53,7 @@ dependencies:
|
||||
agora_rtc_engine: ^6.2.6
|
||||
flutter_tts: ^3.8.5
|
||||
permission_handler: ^11.3.0
|
||||
google_generative_ai: ^0.0.1-dev
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user