This commit is contained in:
Hamza-Ayed
2024-05-29 16:09:37 +03:00
parent 058fb67a41
commit 4af52f4392
44 changed files with 9509 additions and 2044 deletions

1
.env
View File

@@ -32,3 +32,4 @@ ocpApimSubscriptionKey=17373j50x53u07q0830634f512j731yuXrXlBl
smsPasswordEgypt="J)Vh=qb/@MXrXlBl"
chatGPTkeySeferNew4=zg-vlie-2l1ZlpxiLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
anthropicAIkeySeferNew=zg-qbc-qvo39-n4VdMQ5nuJeIYhMN4PDYr7qox3-t2i1Lh7aNTDfYF-Gf8whUJZCs47EeelKn8_UcmUMmiSLaf0UJg0DvUlQrDt-76CRrkQQXrXlBl
llama3Key=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

View File

@@ -55,8 +55,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 22
targetSdkVersion flutter.targetSdkVersion
versionCode 24
versionName '1.4.8'
versionCode 28
versionName '1.4.93'
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
}

BIN
assets/fonts/digit.ttf Normal file

Binary file not shown.

BIN
assets/fonts/josefin.ttf Normal file

Binary file not shown.

BIN
assets/fonts/mohanad.ttf Normal file

Binary file not shown.

View File

@@ -16,6 +16,9 @@ class BoxName {
static const String agreeTerms = "agreeTerms";
static const String addWork = 'addWork';
static const String addHome = 'addHome';
static const String durationData = 'durationData';
static const String rideStaticDriverData = 'rideStaticDriverData';
static const String lastTimeStaticThrottle = 'lastTimeStaticThrottle';
static const String tipPercentage = 'tipPercentage';
static const String accountIdStripeConnect = "accountIdStripeConnect";
static const String faceDetectTimes = "faceDetectTimes";

View File

@@ -1,13 +1,30 @@
import 'package:flutter/material.dart';
class AppColor {
static const Color primaryColor = Colors.black;
static const Color primaryColor = Colors.black; // Slightly softer red
static const Color secondaryColor = Colors.white;
static const Color accentColor = Colors.grey;
static const Color accentColor = Color(0xFFD81F26); // Google Green
static const Color backgroundColor =
Color(0xFFF5F5F5); // Light grey background
static const Color redColor = Color(0xFFEA4335); // Google Red
static const Color greenColor = Color(0xFF34A853); // Google Green
static const Color blueColor = Color(0xFF4285F4); // Google Blue
static const Color yellowColor = Color(0xFFFBBC05); // Google Yellow
static Color deepPurpleAccent =
const Color.fromARGB(255, 123, 76, 254).withOpacity(0.3);
static const Color greyColor =
Color(0xFF9E9E9E); // Light grey for text and dividers
static const Color darkGreyColor =
Color(0xFF333333); // Dark grey for headings
// For dynamic elements like gradients
static List<Color> gradientStartEnd = [
const Color(0xFFD81F26), // Start with primary color
const Color(0xFFEF5350), // End with a slightly darker shade
];
static List<Color> secondaryGradientStartEnd = [
const Color(0xFF34A853), // Start with green
const Color(0xFF4CAF50), // End with a slightly darker shade of green
];
}

View File

@@ -10,6 +10,7 @@ class AppLink {
static String test = "$server/test.php";
//===============firebase==========================
static String getTokens = "$server/ride/firebase/get.php";
static String getDriverToken = "$server/ride/firebase/getDriverToken.php";
static String addTokens = "$server/ride/firebase/add.php";
static String addTokensDriver = "$server/ride/firebase/addDriver.php";
@@ -27,6 +28,9 @@ class AppLink {
static String updatePassengersWallet = "$wallet/update.php";
static String getWalletByDriver = "$walletDriver/getWalletByDriver.php";
static String driverStatistic = "$walletDriver/driverStatistic.php";
static String getDriverWeekPaymentMove =
"$walletDriver/getDriverWeekPaymentMove.php";
static String getDriversWallet = "$walletDriver/get.php";
static String addDriversWalletPoints = "$walletDriver/add.php";
static String deleteDriversWallet = "$walletDriver/delete.php";
@@ -163,6 +167,7 @@ class AppLink {
static String deleteCarsLocationByPassenger = "$location/delete.php";
static String updateCarsLocationByPassenger = "$location/update.php";
static String getTotalDriverDuration = "$location/getTotalDriverDuration.php";
static String getRidesDriverByDay = "$location/getRidesDriverByDay.php";
static String getTotalDriverDurationToday =
"$location/getTotalDriverDurationToday.php";

View File

@@ -1,7 +1,6 @@
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';
class AppStyle {
@@ -9,61 +8,39 @@ class AppStyle {
fontWeight: FontWeight.bold,
fontSize: 40,
color: AppColor.accentColor,
fontFamily: box.read(BoxName.lang) == 'en'
? GoogleFonts.josefinSans().fontFamily
: box.read(BoxName.lang) == 'ar'
? GoogleFonts.amiri().fontFamily
: GoogleFonts.josefinSans().fontFamily);
fontFamily: box.read(BoxName.lang) == 'ar' ? 'mohanad' : 'josefin');
static TextStyle headTitle2 = TextStyle(
fontWeight: FontWeight.bold,
fontSize: 26,
color: AppColor.primaryColor,
fontFamily: box.read(BoxName.lang) == 'en'
? GoogleFonts.josefinSans().fontFamily
: box.read(BoxName.lang) == 'ar'
? GoogleFonts.amiri().fontFamily
: GoogleFonts.josefinSans().fontFamily);
fontFamily: box.read(BoxName.lang) == 'ar' ? 'mohanad' : 'josefin');
static TextStyle title = TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
fontWeight: FontWeight.normal,
fontSize: box.read(BoxName.lang) == 'ar' ? 14 : 16,
color: AppColor.primaryColor,
fontFamily: box.read(BoxName.lang) == 'en'
? GoogleFonts.josefinSans().fontFamily
: box.read(BoxName.lang) == 'ar'
? GoogleFonts.amiri().fontFamily
: GoogleFonts.josefinSans().fontFamily);
fontFamily: box.read(BoxName.lang) == 'ar' ? 'mohanad' : 'josefin');
static TextStyle subtitle = TextStyle(
fontWeight: FontWeight.bold,
fontSize: 13,
color: AppColor.primaryColor,
fontFamily: box.read(BoxName.lang) == 'en'
? GoogleFonts.josefinSans().fontFamily
: box.read(BoxName.lang) == 'ar'
? GoogleFonts.amiri().fontFamily
: GoogleFonts.josefinSans().fontFamily);
static TextStyle number = TextStyle(
fontFamily: box.read(BoxName.lang) == 'ar' ? 'mohanad' : 'josefin');
static TextStyle number = const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: AppColor.primaryColor,
fontFamily: GoogleFonts.averiaSansLibre().fontFamily);
fontFamily: 'digit');
static BoxDecoration boxDecoration = const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(12)),
color: AppColor.secondaryColor,
boxShadow: [
BoxShadow(
color: AppColor.accentColor,
offset: Offset(-3, -3),
blurRadius: 0,
spreadRadius: 0,
blurStyle: BlurStyle.outer),
color: AppColor.accentColor, blurRadius: 5, offset: Offset(2, 4)),
BoxShadow(
color: AppColor.accentColor,
offset: Offset(3, 3),
blurRadius: 0,
spreadRadius: 0,
blurStyle: BlurStyle.outer)
]);
color: AppColor.accentColor, blurRadius: 5, offset: Offset(-2, -2))
],
color: AppColor.secondaryColor,
borderRadius: BorderRadius.all(
Radius.elliptical(15, 30),
));
static BoxDecoration boxDecoration1 = const BoxDecoration(
boxShadow: [
BoxShadow(

View File

@@ -0,0 +1,35 @@
import 'package:firebase_auth/firebase_auth.dart';
import 'package:get/get.dart';
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
class AuthController extends GetxController {
final FirebaseAuth _auth = FirebaseAuth.instance;
Future<User?> signInWithApple() async {
try {
final appleCredential = await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.email,
AppleIDAuthorizationScopes.fullName,
],
);
final oAuthProvider = OAuthProvider('apple.com');
final credential = oAuthProvider.credential(
idToken: appleCredential.identityToken,
accessToken: appleCredential.authorizationCode,
);
UserCredential userCredential =
await _auth.signInWithCredential(credential);
return userCredential.user;
} catch (error) {
print("Error during Apple sign-in: $error");
return null;
}
}
void signOut() async {
await _auth.signOut();
}
}

View File

@@ -16,6 +16,8 @@ import 'package:SEFER/views/auth/captin/verify_email_captain.dart';
import 'package:SEFER/views/home/Captin/home_captain/home_captin.dart';
import 'package:location/location.dart';
import '../../firebase/firbase_messge.dart';
class LoginCaptinController extends GetxController {
final formKey = GlobalKey<FormState>();
TextEditingController emailController = TextEditingController();
@@ -115,7 +117,7 @@ class LoginCaptinController extends GetxController {
}
}
void loginFromSignInGoogle(String driverID, email) async {
loginFromSignInGoogle(String driverID, email) async {
isloading = true;
update();
var res = await CRUD().get(link: AppLink.loginFromGoogleCaptin, payload: {
@@ -125,7 +127,7 @@ class LoginCaptinController extends GetxController {
print(res);
if (res == 'Failure') {
//Failure
Get.offAll(SmsSignupEgypt());
Get.offAll(() => SmsSignupEgypt());
isloading = false;
update();
// Get.snackbar('Failure', '', backgroundColor: Colors.red);
@@ -139,9 +141,36 @@ class LoginCaptinController extends GetxController {
box.write(BoxName.phoneVerified,
jsonDecoeded['data'][0]['is_verified'].toString());
box.write(BoxName.phoneDriver, jsonDecoeded['data'][0]['phone']);
Get.off(HomeCaptain());
box.write(
BoxName.nameDriver,
'${jsonDecoeded['data'][0]['first_name']}'
' ${jsonDecoeded['data'][0]['last_name']}');
print(box.read(BoxName.tokenDriver));
var token = await CRUD().get(
link: AppLink.getDriverToken,
payload: {'captain_id': box.read(BoxName.driverID).toString()});
print(token);
print(box.read(BoxName.tokenDriver));
if (token != 'failure') {
if (jsonDecode(token)['data'][0]['token'] !=
box.read(BoxName.tokenDriver)) {
Get.put(FirebaseMessagesController())
.sendNotificationToAnyWithoutData(
'token change',
'change device',
jsonDecode(token)['data'][0]['token'].toString(),
);
await CRUD().post(link: AppLink.addTokensDriver, payload: {
'token': box.read(BoxName.tokenDriver),
'captain_id': box.read(BoxName.driverID).toString()
}).then((value) => print('cccc'));
}
}
Get.off(() => HomeCaptain());
} else {
Get.offAll(SmsSignupEgypt());
Get.offAll(() => SmsSignupEgypt());
// Get.snackbar(jsonDecoeded['status'], jsonDecoeded['data'],
// backgroundColor: Colors.redAccent);
isloading = false;

View File

@@ -109,13 +109,14 @@ class RegisterCaptainController extends GetxController {
if (res != 'failure') {
// var dec = jsonDecode(res);
box.write(BoxName.phoneDriver, '+2${phoneController.text}');
box.write(BoxName.phoneVerified, '1');
// var res1 = await CRUD().post(
// link: AppLink.updateAccountBank,
// payload: {'phone': '+2${phoneController.text}'});
// if (jsonDecode(res1)['status'] == 'success') {
box.write(BoxName.phoneVerified, 1);
var res1 = await CRUD().post(
link: AppLink.updateAccountBank,
payload: {'phone': '+2${phoneController.text}'});
if (jsonDecode(res1)['status'] == 'success') {
Get.to(EgyptCardAI());
// }
}
}
}
}

View File

@@ -16,6 +16,7 @@ import '../../main.dart';
import '../../views/home/Captin/home_captain/home_captin.dart';
import '../../views/home/Captin/orderCaptin/order_speed_request.dart';
import '../../views/home/Captin/orderCaptin/order_request_page.dart';
import '../auth/google_sign.dart';
import 'local_notification.dart';
class FirebaseMessagesController extends GetxController {
@@ -64,11 +65,8 @@ class FirebaseMessagesController extends GetxController {
Future getToken() async {
fcmToken.getToken().then((token) {
if (box.read(BoxName.email) == null) {
box.write(BoxName.tokenDriver, token);
} else {
box.write(BoxName.tokenFCM, token);
}
print(token);
});
@@ -122,6 +120,10 @@ class FirebaseMessagesController extends GetxController {
NotificationController().showNotification(
'Cancel Trip'.tr, 'Passenger Cancel Trip'.tr, 'cancel');
cancelTripDialog();
} else if (message.notification!.title! == 'token change') {
NotificationController()
.showNotification('token change', 'token change', 'cancel');
GoogleSignInHelper.signOut();
} else if (message.notification!.title! == 'message From passenger') {
NotificationController()
.showNotification('message From passenger'.tr, ''.tr, 'tone2');

View File

@@ -7,9 +7,7 @@ import 'package:http/http.dart' as http;
import 'package:SEFER/env/env.dart';
import '../../constant/api_key.dart';
import '../../constant/colors.dart';
import 'gemeni.dart';
import 'llama_ai.dart';
import 'upload_image.dart';
class CRUD {
@@ -36,7 +34,7 @@ class CRUD {
// print(response.body);
var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') {
// print(jsonData);
print(jsonData);
return response.body;
}
@@ -248,8 +246,8 @@ class CRUD {
return response.body;
} else {
String errorMessage = jsonData['message'];
Get.snackbar('Erroe'.tr, errorMessage.tr,
backgroundColor: AppColor.redColor);
// Get.snackbar('Error'.tr, errorMessage.tr,
// backgroundColor: AppColor.redColor);
print(errorMessage.tr);
return (jsonData['status']);
}

View File

@@ -195,11 +195,11 @@ class AI extends GetxController {
);
} else {
await addDriverEgypt();
// await addRegistrationCarEgypt();
await addRegistrationCarEgypt();
if (isCarSaved && isDriverSaved) {
DeviceController().getDeviceSerialNumber();
box.write(BoxName.phoneVerified, '1');
box.write(BoxName.phoneVerified, 1);
Get.offAll(() => HomeCaptain());
// Get.offAll(() => HomeCaptain());
}

View File

@@ -12,15 +12,42 @@ class DurationController extends GetxController {
final data = DurationData;
// late AnimationController animationController;
late List<MonthlyDataModel> rideData;
late List<MonthlyRideModel> rideCountData;
late List<MonthlyPriceDriverModel> ridePriceDriverData;
Map<String, dynamic> jsonData1 = {};
Map<String, dynamic> jsonData2 = {};
bool isLoading = false;
String totalDurationToday = '';
var chartData;
var chartRideCount;
var chartRidePriceDriver;
List monthlyList = [];
@override
void onInit() async {
super.onInit();
await fetchData();
await fetchRideDriver();
await getStaticDriver();
}
getStaticDriver() async {
isLoading = true;
update();
var res = await CRUD().get(
link: AppLink.driverStatistic,
payload: {'driverID': box.read(BoxName.driverID)});
if (res == 'failure') {
monthlyList = [];
print('monthlyList $monthlyList');
isLoading = false;
update();
} else {
monthlyList = jsonDecode(res)['message'];
print(monthlyList);
isLoading = false;
update();
}
}
Future<void> fetchData() async {
@@ -50,6 +77,44 @@ class DurationController extends GetxController {
update(); // Notify the observers about the data and loading state change
}
Future<void> fetchRideDriver() async {
isLoading = true;
update(); // Notify the observers about the loading state change
var res = await CRUD().get(
link: AppLink.getRidesDriverByDay,
payload: {'driver_id': box.read(BoxName.driverID)},
);
jsonData2 = jsonDecode(res);
var jsonResponse = jsonDecode(res) as Map<String, dynamic>;
isLoading = false;
// print(jsonResponse);
final List<dynamic> jsonData = jsonResponse['message'];
rideCountData = jsonData.map<MonthlyRideModel>((item) {
return MonthlyRideModel.fromJson(item);
}).toList();
ridePriceDriverData = jsonData.map<MonthlyPriceDriverModel>((item) {
return MonthlyPriceDriverModel.fromJson(item);
}).toList();
final List<FlSpot> spots = rideCountData
.map((data) => FlSpot(
data.day.toDouble(),
data.countRide.toDouble(),
))
.toList();
chartRideCount = spots;
final List<FlSpot> spotsDriverPrices = ridePriceDriverData
.map((data) => FlSpot(
data.day.toDouble(),
data.pricePerDay.toDouble(),
))
.toList();
chartRidePriceDriver = spotsDriverPrices;
update(); // Notify the observers about the data and loading state change
}
List<DurationData> parseData(List<dynamic> json) {
return json.map((entry) {
final Map<String, dynamic> entryMap = entry;

View File

@@ -445,7 +445,8 @@ class MapDriverController extends GetxController {
isRideFinished = true;
isRideStarted = false;
isPriceWindow = false;
totalCost = carType != 'Comfort' && carType != 'Mashwari'
totalCost =
carType != 'Comfort' && carType != 'Mashwari' && carType != 'Lady'
? totalPassenger
: price < double.parse(totalPassenger)
? totalPassenger
@@ -574,6 +575,10 @@ class MapDriverController extends GetxController {
? (i ~/ 60) +
(recentDistanceToDash *
Get.find<HomeCaptainController>().speedPrice)
: carType == 'Lady'
? (i ~/ 60) +
(recentDistanceToDash *
Get.find<HomeCaptainController>().comfortPrice)
: carType == 'Mashwari'
? (i ~/ 60) +
(recentDistanceToDash *
@@ -827,6 +832,8 @@ class MapDriverController extends GetxController {
int minutes = 0;
late String carType;
late String kazan;
late String startNameLocation;
late String endNameLocation;
@override
void onInit() async {
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
@@ -860,6 +867,8 @@ class MapDriverController extends GetxController {
timeOfOrder = Get.arguments['timeOfOrder'];
carType = Get.arguments['carType'];
kazan = Get.arguments['kazan'];
startNameLocation = Get.arguments['startNameLocation'];
endNameLocation = Get.arguments['endNameLocation'];
var coords = passengerLocation.split(',');
var coordDestination = passengerDestination.split(',');

View File

@@ -42,18 +42,18 @@ class SplashScreenController extends GetxController
startTimer();
}
void startTimer() {
Timer(const Duration(seconds: 5), () {
void startTimer() async {
debugPrint('onBoarding: ${box.read(BoxName.onBoarding)}');
debugPrint('emailDriver: ${box.read(BoxName.emailDriver)}');
debugPrint('phoneDriver: ${box.read(BoxName.phoneDriver)}');
debugPrint('phoneVerified: ${box.read(BoxName.phoneVerified)}');
Timer(const Duration(seconds: 5), () async {
box.read(BoxName.onBoarding) == null
? Get.off(() => OnBoardingPage())
: box.read(BoxName.emailDriver) != null
// todo
&&
: box.read(BoxName.emailDriver) != null &&
box.read(BoxName.phoneDriver) != null &&
box.read(BoxName.phoneVerified) == '1'
// ? Get.off(() => SmsSignupEgypt())
// ? Get.off(() => HomeCaptain())
? Get.put(LoginCaptinController()).loginFromSignInGoogle(
? await Get.put(LoginCaptinController()).loginFromSignInGoogle(
box.read(BoxName.driverID).toString(),
box.read(BoxName.emailDriver))
: Get.off(() => LoginCaptin());

View File

@@ -32,15 +32,59 @@ class LocaleController extends GetxController {
appTheme = themeEnglish;
box.write(BoxName.lang, 'tr');
break;
case "fr":
locale = const Locale("fr");
appTheme = themeEnglish;
box.write(BoxName.lang, 'fr');
break;
case "it":
locale = const Locale("it");
appTheme = themeEnglish;
box.write(BoxName.lang, 'it');
break;
case "de":
locale = const Locale("de");
appTheme = themeEnglish;
box.write(BoxName.lang, 'de');
break;
case "el":
locale = const Locale("el");
appTheme = themeEnglish;
box.write(BoxName.lang, 'el');
break;
case "es":
locale = const Locale("es");
appTheme = themeEnglish;
box.write(BoxName.lang, 'es');
break;
case "fa":
locale = const Locale("fa");
appTheme = themeEnglish;
box.write(BoxName.lang, 'fa');
break;
case "zh":
locale = const Locale("zh");
appTheme = themeEnglish;
box.write(BoxName.lang, 'zh');
break;
case "ru":
locale = const Locale("ru");
appTheme = themeEnglish;
box.write(BoxName.lang, 'ru');
break;
case "hi":
locale = const Locale("hi");
appTheme = themeEnglish;
box.write(BoxName.lang, 'hi');
break;
default:
locale = Locale(Get.deviceLocale!.languageCode);
box.write(BoxName.lang, 'en');
box.write(BoxName.lang, Get.deviceLocale!.languageCode);
appTheme = themeEnglish;
break;
}
box.write(BoxName.lang, langcode);
// box.write(BoxName.lang, langcode);
Get.changeTheme(appTheme);
Get.updateLocale(locale);
restartApp();
@@ -63,6 +107,42 @@ class LocaleController extends GetxController {
language = const Locale("tr");
appTheme = themeEnglish;
break;
case "fr":
language = const Locale("fr");
appTheme = themeEnglish;
break;
case "it":
language = const Locale("it");
appTheme = themeEnglish;
break;
case "de":
language = const Locale("de");
appTheme = themeEnglish;
break;
case "el":
language = const Locale("el");
appTheme = themeEnglish;
break;
case "es":
language = const Locale("es");
appTheme = themeEnglish;
break;
case "fa":
language = const Locale("fa");
appTheme = themeArabic;
break;
case "zh":
language = const Locale("zh");
appTheme = themeEnglish;
break;
case "ru":
language = const Locale("ru");
appTheme = themeEnglish;
break;
case "hi":
language = const Locale("hi");
appTheme = themeEnglish;
break;
default:
language = Locale(Get.deviceLocale!.languageCode);
appTheme = themeEnglish;

File diff suppressed because it is too large Load Diff

View File

@@ -10,6 +10,7 @@ import 'package:SEFER/main.dart';
class DriverWalletHistoryController extends GetxController {
bool isLoading = false;
List archive = [];
List weeklyList = [];
getArchivePayment() async {
isLoading = true;
@@ -36,9 +37,35 @@ class DriverWalletHistoryController extends GetxController {
update();
}
getWeekllyArchivePayment() async {
isLoading = true;
update();
var res = await CRUD().get(
link: AppLink.getDriverWeekPaymentMove,
payload: {'driverID': box.read(BoxName.driverID)});
print(res);
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();
},
));
}
weeklyList = jsonDecode(res)['message'];
print(archive);
isLoading = false;
update();
}
@override
void onInit() {
getArchivePayment();
// getArchivePayment();
super.onInit();
}
}

View File

@@ -62,6 +62,8 @@ class CaptainProfileController extends GetxController {
Map captainProfileData = {};
Future getProfileData() async {
isLoading = true;
update();
var res = await CRUD().get(
link: AppLink.getCaptainProfile,
payload: {'id': box.read(BoxName.driverID)});
@@ -69,7 +71,7 @@ class CaptainProfileController extends GetxController {
var d = jsonDecode(res);
captainProfileData = d['message'];
update();
print(d['message']);
print(captainProfileData);
box.write(BoxName.sexDriver, d['message']['gender']);
box.write(BoxName.dobDriver, d['message']['birthdate']);
box.write(BoxName.vin, d['message']['vin']);
@@ -80,7 +82,7 @@ class CaptainProfileController extends GetxController {
box.write(BoxName.year, d['message']['year']);
box.write(BoxName.expirationDate, d['message']['expiration_date']);
// box.write(BoxName.acc, d['message']['accountBank']);
isLoading = false;
update();
}
}

View File

@@ -61,6 +61,10 @@ class RateController extends GetxController {
'duration': Get.find<MapDriverController>().duration.toString(),
'phone': Get.find<MapDriverController>().passengerPhone.toString(),
'email': Get.find<MapDriverController>().passengerEmail.toString(),
'startNameLocation':
Get.find<MapDriverController>().startNameLocation.toString(),
'endNameLocation':
Get.find<MapDriverController>().endNameLocation.toString(),
});
// homeCaptainController.isActive = true;
// update();

View File

@@ -38,7 +38,7 @@ ThemeData themeEnglish = ThemeData(
);
ThemeData themeArabic = ThemeData(
fontFamily: "Cairo",
fontFamily: 'mohanad',
textTheme: const TextTheme(
displayLarge: TextStyle(
fontWeight: FontWeight.bold,

View File

@@ -16,8 +16,6 @@ import 'constant/credential.dart';
import 'constant/info.dart';
import 'controller/firebase/firbase_messge.dart';
import 'controller/firebase/local_notification.dart';
import 'controller/functions/device_info.dart';
import 'controller/functions/location_background_controller.dart';
import 'controller/functions/location_controller.dart';
import 'controller/local/local_controller.dart';
import 'controller/local/translations.dart';

View File

@@ -10,3 +10,34 @@ class MonthlyDataModel {
totalDuration:
int.parse(json['total_duration'].toString().split(':')[0]));
}
class MonthlyRideModel {
int day;
int countRide;
int totalCount;
MonthlyRideModel(
{required this.day, required this.countRide, required this.totalCount});
factory MonthlyRideModel.fromJson(Map<String, dynamic> json) =>
MonthlyRideModel(
day: int.parse(json['day'].toString().split('-')[2]),
countRide: int.parse(json['countRide'].toString()),
totalCount: int.parse(json['totalCount'].toString()),
);
}
class MonthlyPriceDriverModel {
int day;
// int price;
double pricePerDay;
MonthlyPriceDriverModel({required this.day, required this.pricePerDay});
factory MonthlyPriceDriverModel.fromJson(Map<String, dynamic> json) =>
MonthlyPriceDriverModel(
day: int.parse(json['day'].toString().split('-')[2]),
// price: int.parse(json['price'].toString()),
pricePerDay: double.parse(json['pricePerDay'].toString()),
);
}

View File

@@ -6,6 +6,7 @@ import 'package:SEFER/constant/info.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';
import 'package:SEFER/views/widgets/mycircular.dart';
import 'package:intl/intl.dart';
import '../../controller/home/captin/duration_controller .dart';
class RideCalculateDriver extends StatelessWidget {
@@ -22,16 +23,19 @@ class RideCalculateDriver extends StatelessWidget {
child: GetBuilder<DurationController>(
builder: (durationController) => durationController.isLoading
? const Center(child: MyCircularProgressIndicator())
: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
: ListView(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'${'Average of Hours of'.tr} ${AppInformation.appName}${' is ON for this month'.tr}${' ${durationController.jsonData1['message'][0]['day'].toString().split('-')[1]}'.tr}',
style: AppStyle.title,
textAlign: TextAlign.center,
),
SizedBox(
Padding(
padding: const EdgeInsets.all(6),
child: Container(
decoration: AppStyle.boxDecoration1,
height: Get.height * .4,
child: LineChart(
duration: const Duration(milliseconds: 150),
@@ -39,9 +43,11 @@ class RideCalculateDriver extends StatelessWidget {
LineChartData(
lineBarsData: [
LineChartBarData(
isStepLineChart: true,
spots: durationController.chartData,
isCurved: true,
color: Colors.deepPurpleAccent, // Custom color
color:
Colors.deepPurpleAccent, // Custom color
barWidth: 3, // Thinner line
dotData: const FlDotData(
show: true), // Show dots on each point
@@ -67,8 +73,7 @@ class RideCalculateDriver extends StatelessWidget {
style: AppStyle.title,
),
axisNameSize: 30,
sideTitles: const SideTitles(
reservedSize: 30, showTitles: true)),
),
bottomTitles: AxisTitles(
axisNameWidget: Text(
'Total Hours on month'.tr,
@@ -92,13 +97,195 @@ class RideCalculateDriver extends StatelessWidget {
borderData: FlBorderData(
show: true,
border: const Border(
bottom: BorderSide(color: AppColor.accentColor),
bottom:
BorderSide(color: AppColor.accentColor),
left: BorderSide(color: AppColor.accentColor),
),
),
),
),
),
),
const SizedBox(
height: 5,
),
Padding(
padding: const EdgeInsets.all(6),
child: Container(
decoration: AppStyle.boxDecoration1,
height: Get.height * .4,
child: LineChart(
duration: const Duration(milliseconds: 150),
curve: Curves.ease,
LineChartData(
lineBarsData: [
LineChartBarData(
spots: durationController.chartRideCount,
// isCurved: true,
color:
Colors.deepPurpleAccent, // Custom color
barWidth: 3, // Thinner line
dotData: const FlDotData(
show: true), // Show dots on each point
belowBarData: BarAreaData(
// Add gradient fill below the line
show: true,
color: AppColor.deepPurpleAccent,
),
isStrokeJoinRound: true,
shadow: const BoxShadow(
color: AppColor.yellowColor,
blurRadius: 4,
offset: Offset(2, 2),
),
),
],
showingTooltipIndicators: const [],
titlesData: FlTitlesData(
show: true,
topTitles: AxisTitles(
axisNameWidget: Text(
'Days'.tr,
style: AppStyle.title,
),
axisNameSize: 30,
// sideTitles: const SideTitles(
// reservedSize: 30, showTitles: true),
),
bottomTitles: AxisTitles(
axisNameWidget: Text(
'${"Total rides on month".tr} = ${durationController.jsonData2['message'][0]['totalCount'].toString()}'
.tr,
style: AppStyle.title,
),
axisNameSize: 30,
sideTitles: const SideTitles(
reservedSize: 30, showTitles: true)),
leftTitles: AxisTitles(
axisNameWidget: Text(
'Counts of rides on days'.tr,
style: AppStyle.title,
),
axisNameSize: 30,
sideTitles: const SideTitles(
reservedSize: 30, showTitles: true)),
),
gridData: const FlGridData(
show: true,
),
borderData: FlBorderData(
show: true,
border: const Border(
bottom:
BorderSide(color: AppColor.accentColor),
left: BorderSide(color: AppColor.accentColor),
),
),
),
),
),
),
const SizedBox(
height: 5,
),
Padding(
padding: const EdgeInsets.all(6),
child: Container(
decoration: AppStyle.boxDecoration1,
height: Get.height * .4,
child: LineChart(
duration: const Duration(milliseconds: 150),
curve: Curves.ease,
LineChartData(
lineBarsData: [
LineChartBarData(
isStepLineChart: true,
spots:
durationController.chartRidePriceDriver,
isCurved: true,
isStrokeCapRound: true,
preventCurveOverShooting: true,
color:
Colors.deepPurpleAccent, // Custom color
barWidth: 3, // Thinner line
dotData: const FlDotData(
show: true), // Show dots on each point
belowBarData: BarAreaData(
// Add gradient fill below the line
show: true,
color: AppColor.deepPurpleAccent,
),
isStrokeJoinRound: true,
shadow: const BoxShadow(
color: AppColor.yellowColor,
blurRadius: 4,
offset: Offset(2, 2),
),
),
],
showingTooltipIndicators: const [],
titlesData: FlTitlesData(
show: true,
topTitles: AxisTitles(
axisNameWidget: Text(
'Days'.tr,
style: AppStyle.title,
),
axisNameSize: 30,
// sideTitles: const SideTitles(
// reservedSize: 30, showTitles: true),
),
bottomTitles: AxisTitles(
axisNameWidget: Text(
'${"Total rides on month".tr} = ${durationController.jsonData2['message'][0]['totalCount'].toString()}'
.tr,
style: AppStyle.title,
),
axisNameSize: 30,
sideTitles: const SideTitles(
reservedSize: 30, showTitles: true)),
leftTitles: AxisTitles(
axisNameWidget: Text(
'Counts of rides on days'.tr,
style: AppStyle.title,
),
axisNameSize: 30,
sideTitles: const SideTitles(
reservedSize: 30, showTitles: true)),
),
gridData: const FlGridData(
show: true,
),
borderData: FlBorderData(
show: true,
border: const Border(
bottom:
BorderSide(color: AppColor.accentColor),
left: BorderSide(color: AppColor.accentColor),
),
),
),
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: AppStyle.boxDecoration1,
child: durationController.monthlyList.isEmpty
? SizedBox(
height: Get.height * .2,
child: Center(
child: Text(
"No data yet".tr,
style: AppStyle.title,
),
),
)
: DriverStatsTable(
monthlyList:
durationController.monthlyList,
)))
],
),
)
@@ -109,103 +296,172 @@ class RideCalculateDriver extends StatelessWidget {
}
}
// class BarChartWidget extends StatelessWidget {
// const BarChartWidget({super.key});
class DriverStatsTable extends StatelessWidget {
final List monthlyList;
// @override
// Widget build(BuildContext context) {
// final durationController = Get.put(DurationController());
// return Obx(() {
// final data = durationController.data;
// double maxDuration = 0;
const DriverStatsTable({Key? key, required this.monthlyList})
: super(key: key);
// // Find the maximum duration to determine the maximum height of the bars
// for (final entry in data) {
// final durationInHours = entry.totalDuration.inHours.toDouble();
// if (durationInHours > maxDuration) {
// maxDuration = durationInHours;
// }
// }
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 2,
blurRadius: 5,
offset: const Offset(0, 3),
),
],
),
padding: const EdgeInsets.all(16),
child: DataTable(
columnSpacing: 12,
columns: [
DataColumn(label: Text('Statistic'.tr)),
DataColumn(label: Text('Value'.tr)),
],
rows: _buildRows(),
),
);
}
// return durationController.isLoading
// ? const Center(
// child: MyCircularProgressIndicator(),
// )
// : Column(
// children: [
// Text(
// 'Average of Hours of ${AppInformation.appName} is ON for this month'
// .tr,
// style: AppStyle.title,
// ),
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: Container(
// height: Get.height * .7,
// decoration: AppStyle.boxDecoration,
// child: ListView.builder(
// scrollDirection: Axis.horizontal,
// itemCount: data.length,
// itemBuilder: (context, index) {
// final entry = data[index];
// final durationInHours =
// entry.totalDuration.inHours.toDouble();
// final dayLabel = entry.day.day.toString();
List<DataRow> _buildRows() {
return [
DataRow(cells: [
DataCell(Text(
'Total Orders'.tr,
style: AppStyle.title,
)),
DataCell(Text(
monthlyList[0]['total_orders'].toString(),
style: AppStyle.number,
)),
]),
DataRow(cells: [
DataCell(Text(
'Completed'.tr,
style: AppStyle.title,
)),
DataCell(Text(
monthlyList[0]['completed_orders'].toString(),
style: AppStyle.number,
)),
]),
DataRow(cells: [
DataCell(Text(
'Canceled Orders'.tr,
style: AppStyle.title,
)),
DataCell(Text(
monthlyList[0]['canceled_orders'].toString(),
style: AppStyle.number,
)),
]),
DataRow(cells: [
DataCell(Text(
'Rejected Orders'.tr,
style: AppStyle.title,
)),
DataCell(Text(
monthlyList[0]['rejected_orders'].toString(),
style: AppStyle.number,
)),
]),
DataRow(cells: [
DataCell(Text(
'Percent Rejected'.tr,
style: AppStyle.title,
)),
DataCell(Text(
'${(monthlyList[0]['percent_rejected']).toString()}%',
style: AppStyle.number.copyWith(
color: double.parse(monthlyList[0]['percent_canceled']) < .3
? AppColor.greenColor
: AppColor.redColor),
)),
]),
DataRow(cells: [
DataCell(Text(
'Percent Canceled'.tr,
style: AppStyle.title,
)),
DataCell(Text(
'${(monthlyList[0]['percent_canceled']).toString()}%',
style: AppStyle.number.copyWith(
color: double.parse(monthlyList[0]['percent_canceled']) < .3
? AppColor.greenColor
: AppColor.redColor),
)),
]),
DataRow(cells: [
DataCell(Text(
'Percent Completed'.tr,
style: AppStyle.title,
)),
DataCell(Text(
'${(monthlyList[0]['percent_completed']).toString()}%',
style: AppStyle.number.copyWith(
color: double.parse(monthlyList[0]['percent_completed']) > .7
? AppColor.greenColor
: AppColor.redColor),
)),
]),
];
}
}
// return Padding(
// padding: const EdgeInsets.symmetric(horizontal: 4),
// child: AnimatedBuilder(
// // animation: durationController.animationController,
// builder: (context, child) {
// final animationValue =
// durationController.animationController.value;
// final animatedValue =
// (durationInHours / maxDuration) *
// animationValue;
class StaticDriverOrder extends StatelessWidget {
const StaticDriverOrder({
Key? key,
required this.title,
required this.jsonTitle,
}) : super(key: key);
// return Column(
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// Transform(
// transform: Matrix4.identity()
// ..setEntry(3, 2,
// 0.001) // Apply perspective for a 3D effect
// ..rotateX(-0.5 *
// animatedValue), // Rotate around X-axis
// alignment: Alignment.bottomCenter,
// child: Container(
// width: 20,
// height:
// (durationInHours / maxDuration) * 400,
// color: durationInHours > 8
// ? AppColor.greenColor
// : AppColor.yellowColor,
// child: Center(
// child: Text(
// durationInHours.toStringAsFixed(
// 0,
// ), // Display the duration value inside the bar
// style: const TextStyle(
// color: Colors.white,
// fontWeight: FontWeight.bold,
// ),
// ),
// ),
// ),
// ),
// const SizedBox(height: 4),
// Text(dayLabel),
// ],
// );
// },
// ),
// );
// },
// ),
// ),
// ),
// ],
// );
// });
// }
// }
final String title, jsonTitle;
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
spreadRadius: 3,
blurRadius: 5,
offset: const Offset(0, 3), // changes position of shadow
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
title,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black54,
),
),
const SizedBox(height: 8.0),
Text(
jsonTitle,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
],
),
);
}
}

View File

@@ -1,3 +1,6 @@
import 'dart:io';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
@@ -7,9 +10,9 @@ import '../../../constant/box_name.dart';
import '../../../constant/colors.dart';
import '../../../constant/info.dart';
import '../../../constant/style.dart';
import '../../../controller/auth/apple_sigin.dart';
import '../../../controller/auth/captin/login_captin_controller.dart';
import '../../../controller/auth/google_sign.dart';
import '../../../controller/functions/location_background_controller.dart';
import '../../../main.dart';
import '../../widgets/elevated_btn.dart';
import '../../widgets/my_scafold.dart';
@@ -19,7 +22,7 @@ class LoginCaptin extends StatelessWidget {
// final controller = Get.put(LoginCaptinController());
LoginCaptin({super.key});
final AuthController authController = Get.put(AuthController());
@override
Widget build(BuildContext context) {
Get.put(LoginCaptinController());
@@ -177,7 +180,7 @@ class LoginCaptin extends StatelessWidget {
Center(
child: Container(
decoration: AppStyle.boxDecoration1,
height: Get.height * .6,
height: Get.height * .7,
width: Get.width * .9,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
@@ -208,6 +211,35 @@ class LoginCaptin extends StatelessWidget {
},
kolor: AppColor.redColor,
),
!Platform.isAndroid
? MyElevatedButton(
title: 'Sign In by Apple'.tr,
onPressed: () async {
User? user = await authController
.signInWithApple();
if (user != null) {
print(
"Successfully signed in: ${user.email}");
print(
"Successfully signed in: ${user.uid}");
box.write(BoxName.driverID, user.uid);
box.write(
BoxName.emailDriver, user.email);
Get.find<LoginCaptinController>()
.loginFromSignInGoogle(
box.read(BoxName.driverID).toString(),
box
.read(BoxName.emailDriver)
.toString(),
);
// Navigate to another screen or perform other actions
} else {
print("Sign-in failed");
}
},
kolor: AppColor.primaryColor,
)
: const SizedBox(),
// MyElevatedButton(
// title: 'Sign In by Google'.tr,
// onPressed: () async {
@@ -297,7 +329,7 @@ class LoginCaptin extends StatelessWidget {
RichText(
text: TextSpan(
text:
'By selecting "I Agree" below, I have reviewed and agree to the Terms of Use and acknowledge the '
"By selecting 'I Agree' below, I have reviewed and agree to the Terms of Use and acknowledge the "
.tr,
style: AppStyle.title,
children: <TextSpan>[
@@ -318,8 +350,8 @@ class LoginCaptin extends StatelessWidget {
),
));
}),
const TextSpan(
text: '. I am at least 18 years of age.',
TextSpan(
text: '. I am at least 18 years of age.'.tr,
),
],
),

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/constant/style.dart';
@@ -20,8 +21,10 @@ class HelpCaptain extends StatelessWidget {
body: [
Column(
children: [
Card(
color: AppColor.yellowColor,
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
@@ -31,6 +34,7 @@ class HelpCaptain extends StatelessWidget {
),
),
),
),
Card(
elevation: 3,
color: AppColor.secondaryColor,
@@ -80,22 +84,34 @@ class HelpCaptain extends StatelessWidget {
),
)),
GetBuilder<HelpController>(
builder: (helpController) => Container(
height: 400,
builder: (helpController) => Padding(
padding: const EdgeInsets.all(10),
child: Container(
height: Get.height * .45,
decoration: AppStyle.boxDecoration,
child: ListView.builder(
itemCount: helpController.helpQuestionDate['message'] !=
null
? helpController.helpQuestionDate['message'].length
itemCount:
helpController.helpQuestionDate['message'] != null
? helpController
.helpQuestionDate['message'].length
: 0,
itemBuilder: (BuildContext context, int index) {
// if (helpController.helpQuestionDate['message'] ==
// null) {
// return const CircularProgressIndicator();
// }
var list =
helpController.helpQuestionDate['message'][index];
return Padding(
var list = helpController
.helpQuestionDate['message'][index];
return helpController
.helpQuestionDate['message'].length ==
0
? Center(
child: Text(
'text',
style: AppStyle.title,
),
)
: Padding(
padding: const EdgeInsets.all(3),
child: Container(
decoration: BoxDecoration(
@@ -103,7 +119,8 @@ class HelpCaptain extends StatelessWidget {
color: AppColor.greenColor,
width: 3,
),
borderRadius: BorderRadius.circular(11)),
borderRadius:
BorderRadius.circular(11)),
// elevation: 3,
// color: AppColor.greenColor,
child: GestureDetector(
@@ -111,8 +128,8 @@ class HelpCaptain extends StatelessWidget {
print(list['id']);
helpController.getindex(
list['id'], list['helpQuestion']);
helpController
.getHelpRepley(list['id'].toString());
helpController.getHelpRepley(
list['id'].toString());
Get.to(
() => const HelpDetailsReplayPage(),
);
@@ -145,6 +162,7 @@ class HelpCaptain extends StatelessWidget {
);
},
),
),
)),
],
),

View File

@@ -1,4 +1,3 @@
import 'package:SEFER/controller/payment/paymob.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
@@ -13,6 +12,7 @@ import '../../../../constant/table_names.dart';
import '../../../../controller/functions/location_controller.dart';
import '../../../../controller/home/captin/home_captain_controller.dart';
import '../../../../controller/home/captin/order_request_controller.dart';
import '../../../widgets/circle_container.dart';
import 'widget/connect.dart';
import 'widget/left_menu_map_captain.dart';
import '../../../../controller/home/payment/captain_wallet_controller.dart';
@@ -30,37 +30,26 @@ class HomeCaptain extends StatelessWidget {
Get.put(HomeCaptainController());
return Scaffold(
appBar: AppBar(
backgroundColor: AppColor.greenColor,
elevation: 0,
// backgroundColor: AppColor.accentColor,
elevation: 1,
title: Text('Home'.tr),
actions: [
GetBuilder<LocationController>(
builder: (locationController) => locationController.isLoading
? const SizedBox(
height: 1,
width: 1,
child: CircularProgressIndicator.adaptive())
: const SizedBox(),
),
GetBuilder<OrderRequestController>(
builder: (orderRequestController) => MyCircleContainer(
child: Text(
orderRequestController.countRefuse.toString(),
style: AppStyle.title,
))),
IconButton(
// onPressed: () => box.remove(BoxName.periods),
onPressed: () => sql.deleteAllData(TableName.driverOrdersRefuse),
icon: const Icon(Icons.remove)),
GetBuilder<OrderRequestController>(
builder: (orderRequestController) => IconButton(
onPressed: () =>
orderRequestController.getRefusedOrderByCaptain(),
icon: const Icon(Icons.get_app)),
),
IconButton(
onPressed: () {
PaymobManager().getPaymentKey(100, 'EGP');
},
icon: const Icon(
Icons.call,
size: 29,
),
),
// GetBuilder<OrderRequestController>(
// builder: (orderRequestController) => IconButton(
// onPressed: () =>
// orderRequestController.getRefusedOrderByCaptain(),
// icon: const Icon(Icons.get_app)),
// ),
],
),
drawer: DrawerCaptain(),
@@ -134,7 +123,7 @@ class HomeCaptain extends StatelessWidget {
color: AppColor.yellowColor,
),
Text(
'${' You Have in'.tr} ${AppInformation.appName} is ${homeCaptainController.totalMoneyInSEFER} ',
'${' You Have in'.tr} ${AppInformation.appName} ${homeCaptainController.totalMoneyInSEFER} ',
style: AppStyle.title,
),
],
@@ -143,7 +132,7 @@ class HomeCaptain extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
'Total points is '.tr +
'Total Budget is '.tr +
Get.find<CaptainWalletController>().totalPoints,
style: AppStyle.title,
),

View File

@@ -1,3 +1,5 @@
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/main.dart';
import 'package:flutter/material.dart';
import 'package:flutter_font_icons/flutter_font_icons.dart';
import 'package:get/get.dart';
@@ -13,43 +15,43 @@ import '../../../../../controller/functions/location_controller.dart';
GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
return GetBuilder<HomeCaptainController>(
builder: (controller) => Positioned(
bottom: Get.height * .17,
bottom: Get.height * .2,
left: 6,
child: Column(
children: [
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
border: Border.all(),
color: AppColor.secondaryColor,
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
AC credentials = AC();
String apiKey = '21010e54b50f41a4904708c526e102df';
String convertedStringN = credentials.c(
credentials.c(credentials.c(apiKey, cs), cC), cn);
print('Converted v: $convertedStringN');
// AnimatedContainer(
// duration: const Duration(microseconds: 200),
// width: controller.widthMapTypeAndTraffic,
// decoration: BoxDecoration(
// border: Border.all(),
// color: AppColor.secondaryColor,
// borderRadius: BorderRadius.circular(15)),
// child: IconButton(
// onPressed: () {
// AC credentials = AC();
// String apiKey = '21010e54b50f41a4904708c526e102df';
// String convertedStringN = credentials.c(
// credentials.c(credentials.c(apiKey, cs), cC), cn);
// print('Converted v: $convertedStringN');
String retrievedStringS = credentials.r(
credentials.r(credentials.r(convertedStringN, cn), cC),
cs);
print('Retrieved String: $retrievedStringS');
//
if (retrievedStringS == apiKey) {
print('same');
}
},
icon: const Icon(
FontAwesome.map_signs,
size: 24,
color: Colors.black,
)),
),
const SizedBox(
height: 5,
),
// String retrievedStringS = credentials.r(
// credentials.r(credentials.r(convertedStringN, cn), cC),
// cs);
// print('Retrieved String: $retrievedStringS');
// //
// if (retrievedStringS == apiKey) {
// print('same');
// }
// },
// icon: const Icon(
// FontAwesome.map_signs,
// size: 24,
// color: Colors.black,
// )),
// ),
// const SizedBox(
// height: 5,
// ),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
@@ -113,6 +115,9 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
),
),
),
const SizedBox(
height: 5,
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
@@ -122,7 +127,25 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
final now = DateTime.now();
DateTime? lastRequestTime =
box.read(BoxName.lastTimeStaticThrottle);
if (lastRequestTime == null ||
now.difference(lastRequestTime).inMinutes >= 15) {
// Update the last request time to now
lastRequestTime = now;
box.write(BoxName.lastTimeStaticThrottle, lastRequestTime);
// Navigate to the RideCalculateDriver page
Get.to(() => RideCalculateDriver());
} else {
// Optionally show a message or handle the throttling case
final minutesLeft =
15 - now.difference(lastRequestTime).inMinutes;
Get.snackbar(
'Please wait $minutesLeft minutes before trying again.',
'');
}
},
icon: const Icon(FontAwesome5.chart_bar),
),

View File

@@ -47,8 +47,8 @@ GetBuilder<MapDriverController> driverEndRideBar() {
const Icon(Icons.timelapse),
Text(
mapDriverController.hours > 1
? '${'${'Your Ride Duration is '.tr}${mapDriverController.hours}${' H and'.tr}'} ${mapDriverController.minutes} m'
: '${'Your Ride Duration is '.tr} ${mapDriverController.minutes} ${'m'.tr}',
? '${'${mapDriverController.hours}${' H and'.tr}'} ${mapDriverController.minutes} m'
: '${mapDriverController.minutes} ${'m'.tr}',
style: AppStyle.title),
],
),
@@ -148,18 +148,20 @@ GetBuilder<MapDriverController> driverEndRideBar() {
)
],
)
: const SizedBox(),
mapDriverController.remainingTimeTimerRideBegin < 60
? Row(
: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
MyElevatedButton(
mapDriverController.remainingTimeTimerRideBegin <
60
? MyElevatedButton(
title: 'End Ride'.tr,
onPressed: () {
mapDriverController.finishRideFromDriver();
mapDriverController
.finishRideFromDriver();
},
kolor: AppColor.redColor,
),
)
: const SizedBox(),
Container(
decoration: AppStyle.boxDecoration1,
child: Text(
@@ -168,8 +170,7 @@ GetBuilder<MapDriverController> driverEndRideBar() {
),
)
],
)
: const SizedBox(),
),
mapDriverController.carType != 'Comfort' &&
mapDriverController.carType != 'Mashwari'
? Stack(

View File

@@ -92,7 +92,7 @@ class OrderRequestPage extends StatelessWidget {
// SizedBox(height: 200, child: Text(pointsList.toString())),
// Text(message.notification!.body.toString()),
SizedBox(
height: Get.height * .2,
height: Get.height * .3,
child: GoogleMap(
initialCameraPosition: CameraPosition(
zoom: 12,
@@ -357,11 +357,13 @@ class OrderRequestPage extends StatelessWidget {
'step2': myList[23].toString(),
'step3': myList[24].toString(),
'step4': myList[25].toString(),
'passengerWalletBurc': myList[26].toString(),
'passengerWalletBurc': myList[27].toString(),
'timeOfOrder': DateTime.now().toString(),
'totalPassenger': myList[2].toString(),
'carType': myList[31].toString(),
'kazan': myList[32].toString(),
'startNameLocation': myList[29].toString(),
'endNameLocation': myList[30].toString(),
});
},
),

View File

@@ -34,6 +34,10 @@ class PointsCaptain extends StatelessWidget {
titleStyle: AppStyle.title,
content: Column(
children: [
Text(
'${'you can buy '.tr}$countPoint ${'LE'.tr}${'by '.tr}${'$pricePoint'.tr}',
style: AppStyle.title,
),
MyElevatedButton(
title: '💳 Pay with Credit Card'.tr,
onPressed: () async {
@@ -55,7 +59,7 @@ class PointsCaptain extends StatelessWidget {
),
// Add some spacing between buttons
MyElevatedButton(
kolor: AppColor.yellowColor,
kolor: AppColor.redColor,
title: '💰 Pay with Wallet'.tr,
onPressed: () async {
Get.back();
@@ -86,9 +90,11 @@ class PointsCaptain extends StatelessWidget {
await captainWalletController.getCaptainWalletFromBuyPoints();
});
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 3, vertical: 8),
child: Container(
width: Get.width * .22,
height: Get.width * .15,
height: Get.width * .22,
margin: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: kolor,
@@ -106,10 +112,12 @@ class PointsCaptain extends StatelessWidget {
Text(
'$pricePoint ${box.read(BoxName.countryCode) == 'Jordan' ? 'JOD'.tr : 'LE'.tr}',
style: AppStyle.title,
textAlign: TextAlign.center,
),
],
),
)),
),
);
}
}

View File

@@ -1,4 +1,5 @@
import 'package:SEFER/controller/functions/tts.dart';
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
import 'package:SEFER/views/home/my_wallet/payment_history_driver_page.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -14,8 +15,10 @@ import 'package:SEFER/views/widgets/my_textField.dart';
import 'package:SEFER/views/widgets/mycircular.dart';
import 'package:path/path.dart';
import '../../../controller/payment/driver_payment_controller.dart';
import '../../widgets/my_scafold.dart';
import 'points_captain.dart';
import 'weekly_payment_page.dart';
class WalletCaptain extends StatelessWidget {
WalletCaptain({super.key});
@@ -23,7 +26,7 @@ class WalletCaptain extends StatelessWidget {
Get.put(CaptainWalletController());
@override
Widget build(BuildContext context) {
// Get.put(MapPassengerController());
Get.put(MapDriverController()).totalPassenger = '0';
return MyScafolld(
title: 'Driver Wallet'.tr,
body: [
@@ -38,20 +41,20 @@ class WalletCaptain extends StatelessWidget {
children: [
const SizedBox(),
Container(
decoration: AppStyle.boxDecoration.copyWith(
color: double.parse(captainWalletController
.totalPoints) <
// decoration: AppStyle.boxDecoration1.copyWith(
color: double.parse(
captainWalletController.totalPoints) <
0 &&
double.parse(captainWalletController
.totalPoints) >
double.parse(
captainWalletController.totalPoints) >
-300
? AppColor.yellowColor
: double.parse(captainWalletController
.totalPoints) <
: double.parse(
captainWalletController.totalPoints) <
-300
? AppColor.redColor
: AppColor.greenColor,
),
// ),
child: InkWell(
onTap: () {
Get.snackbar(
@@ -69,6 +72,7 @@ class WalletCaptain extends StatelessWidget {
child: Text(
'${'Total Points is'.tr} ${captainWalletController.totalPoints.toString()} 💎',
style: AppStyle.headTitle2,
textAlign: TextAlign.center,
),
),
),
@@ -111,8 +115,8 @@ class WalletCaptain extends StatelessWidget {
Get.snackbar(
icon: InkWell(
onTap: () async {
await Get.find<
TextToSpeechController>()
await Get.put(
TextToSpeechController())
.speakText(
'This amount for all trip I get from Passengers'
.tr);
@@ -255,7 +259,9 @@ class WalletCaptain extends StatelessWidget {
const SizedBox(
height: 10,
),
Container(
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: AppStyle.boxDecoration,
child: Column(
children: [
@@ -276,7 +282,7 @@ class WalletCaptain extends StatelessWidget {
),
Container(
decoration: AppStyle.boxDecoration,
height: Get.height * .1,
height: Get.height * .19,
child: ListView(
scrollDirection: Axis.horizontal,
children: [
@@ -337,6 +343,7 @@ class WalletCaptain extends StatelessWidget {
],
),
),
),
const SizedBox(
height: 30,
),
@@ -362,17 +369,30 @@ class WalletCaptain extends StatelessWidget {
height: 30,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
MyElevatedButton(
kolor: AppColor.blueColor,
title: 'Payment History'.tr,
onPressed: () {
onPressed: () async {
await Get.put(DriverWalletHistoryController())
.getArchivePayment();
Get.to(() => const PaymentHistoryDriverPage(),
transition: Transition.size);
},
),
MyElevatedButton(
kolor: AppColor.blueColor,
title: 'Weekly Budget'.tr,
onPressed: () async {
await Get.put(DriverWalletHistoryController())
.getWeekllyArchivePayment();
Get.to(() => const WeeklyPaymentPage(),
transition: Transition.size);
},
),
],
),
),

View File

@@ -0,0 +1,96 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';
import 'package:SEFER/views/widgets/mycircular.dart';
import '../../../controller/payment/driver_payment_controller.dart';
class WeeklyPaymentPage extends StatelessWidget {
const WeeklyPaymentPage({super.key});
@override
Widget build(BuildContext context) {
Get.put(DriverWalletHistoryController());
return MyScafolld(
title: 'Payment History'.tr,
body: [
GetBuilder<DriverWalletHistoryController>(
builder: (controller) => controller.isLoading
? const MyCircularProgressIndicator()
: Column(
children: [
Container(
width: Get.width * .8,
decoration: AppStyle.boxDecoration1,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
decoration: AppStyle.boxDecoration1,
child: Text(
controller.weeklyList[0]['totalAmount']
.toString(),
style: AppStyle.title,
),
),
Text(
' Total weekly points is '.tr,
style: AppStyle.title,
),
],
),
),
const SizedBox(
height: 10,
),
SizedBox(
height: Get.height * .8,
child: ListView.builder(
itemCount: controller.weeklyList.length,
itemBuilder: (BuildContext context, int index) {
var list = controller.weeklyList[index];
return Padding(
padding: const EdgeInsets.all(2.0),
child: Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(4),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
list['amount'],
style: AppStyle.title,
),
Text(
list['dateUpdated'],
style: AppStyle.title,
),
Card(
elevation: 2,
color: list['paymentMethod'] == 'visa'
? AppColor.blueColor
: AppColor.secondaryColor,
child: Text(
list['paymentMethod'],
style: AppStyle.title,
),
),
],
),
),
),
);
},
),
),
],
),
)
],
isleading: true);
}
}

View File

@@ -1,16 +1,10 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/views/widgets/mycircular.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/profile/captain_profile_controller.dart';
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 {
const ProfileCaptain({super.key});
@@ -25,70 +19,45 @@ class ProfileCaptain extends StatelessWidget {
padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CircleAvatar(
radius: Get.width * 0.26,
backgroundColor: Colors.white,
backgroundImage: CachedNetworkImageProvider(
'${AK.serverPHP}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg',
),
),
const SizedBox(height: 8.0),
Text(
box.read(BoxName.nameDriver) +
child: controller.isLoading
? const MyCircularProgressIndicator()
: DriverProfileCard(
driverId:
controller.captainProfileData['driverID'] ?? '',
name: controller.captainProfileData['first_name'] +
' ' +
box.read(BoxName.lastNameDriver).toString(),
style: AppStyle.title),
const SizedBox(height: 8.0),
Text('${'Email is'.tr} :${box.read(BoxName.emailDriver)}',
style: AppStyle.title),
const SizedBox(height: 8.0),
Text(
'${'Phone Number is'.tr} :${box.read(BoxName.phoneDriver)}',
style: AppStyle.title),
const SizedBox(height: 8.0),
Text(
'${'Date of Birth is'.tr} :${box.read(BoxName.dobDriver)}',
style: AppStyle.title),
const SizedBox(height: 8.0),
Text('${'Sex is '.tr}:${box.read(BoxName.sexDriver)}',
style: AppStyle.title),
const SizedBox(height: 8.0),
const Divider(
// height: 2,
endIndent: 1,
indent: 2,
thickness: 2,
),
const SizedBox(height: 8.0),
Text('Car Details'.tr, style: AppStyle.headTitle2),
const SizedBox(height: 8.0),
Text('${'VIN is'.tr} :${box.read(BoxName.vin)}',
style: AppStyle.title),
const SizedBox(height: 8.0),
Text('${'Color is '.tr} :${box.read(BoxName.color)}',
style: AppStyle.title),
const SizedBox(height: 8.0),
Text(
'${'Car Plate is '.tr} :${box.read(BoxName.carPlate)}',
style: AppStyle.title),
const SizedBox(height: 8.0),
Text('${'Make is '.tr}:${box.read(BoxName.make)}',
style: AppStyle.title),
const SizedBox(height: 8.0),
Text('${'Model is'.tr} :${box.read(BoxName.model)}',
style: AppStyle.title),
const SizedBox(height: 8.0),
Text('${'Year is'.tr} :${box.read(BoxName.year)}',
style: AppStyle.title),
const SizedBox(height: 8.0),
Text(
'${'Expiration Date '.tr} :${box.read(BoxName.expirationDate)}',
style: AppStyle.title),
const SizedBox(height: 8.0),
],
(controller.captainProfileData['last_name'] ?? ''),
phoneNumber:
controller.captainProfileData['phone'] ?? '',
email: controller.captainProfileData['email'] ?? '',
birthdate:
controller.captainProfileData['birthdate'] ?? '',
gender: controller.captainProfileData['gender'] ?? '',
education:
controller.captainProfileData['education'] ?? '',
carMake: controller.captainProfileData['make'] ?? '',
carModel: controller.captainProfileData['model'] ?? '',
carPlate:
controller.captainProfileData['car_plate'] ?? '',
carColor: controller.captainProfileData['color'] ?? '',
vin: controller.captainProfileData['vin'] ?? '',
registrationDate: controller
.captainProfileData['registration_date'] ??
'',
expirationDate:
controller.captainProfileData['expiration_date'] ??
'',
ratingCount:
controller.captainProfileData['ratingCount'] ?? 0,
ratingDriver:
controller.captainProfileData['ratingDriver'] !=
null
? double.tryParse(controller
.captainProfileData['ratingDriver']
.toString()) ??
0
: null,
age: controller.captainProfileData['age'] ?? 0,
),
),
),
@@ -96,62 +65,279 @@ class ProfileCaptain extends StatelessWidget {
)
],
isleading: true,
action: GetBuilder<CaptainProfileController>(
builder: (controller) => IconButton(
onPressed: () {
Get.defaultDialog(
title: 'Edit Your data'.tr,
titleStyle: AppStyle.title,
content: SizedBox(
height: Get.height * .4,
child: SingleChildScrollView(
// action: GetBuilder<CaptainProfileController>(
// builder: (controller) => IconButton(
// onPressed: () {
// Get.defaultDialog(
// title: 'Edit Your data'.tr,
// titleStyle: AppStyle.title,
// content: SizedBox(
// height: Get.height * .4,
// child: SingleChildScrollView(
// child: Column(
// children: [
// MyTextForm(
// controller: controller.vin,
// hint: 'write vin for your car'.tr,
// label: 'VIN'.tr,
// type: TextInputType.emailAddress,
// ),
// MyTextForm(
// controller: controller.color,
// hint: 'write Color for your car'.tr,
// label: 'Color'.tr,
// type: TextInputType.emailAddress,
// ),
// MyTextForm(
// controller: controller.make,
// hint: 'write Make for your car'.tr,
// label: 'Make'.tr,
// type: TextInputType.emailAddress,
// ),
// MyTextForm(
// controller: controller.model,
// hint: 'write Model for your car'.tr,
// label: 'Model'.tr,
// type: TextInputType.emailAddress,
// ),
// MyTextForm(
// controller: controller.year,
// hint: 'write Year for your car'.tr,
// label: 'Year'.tr,
// type: TextInputType.number,
// ),
// MyTextForm(
// controller: controller.expirationDate,
// hint: 'write Expiration Date for your car'.tr,
// label: 'Expiration Date'.tr,
// type: TextInputType.datetime),
// MyElevatedButton(
// title: 'Update'.tr,
// onPressed: () => controller.updateFields())
// ],
// ),
// ),
// ));
// },
// icon: const Icon(Icons.edit),
// ),
// )
);
}
}
class DriverProfileCard extends StatelessWidget {
final String driverId;
final String name;
final String phoneNumber;
final String email;
final String birthdate;
final String gender;
final String education;
final String carMake;
final String carModel;
final String carPlate;
final String carColor;
final String vin;
final String registrationDate;
final String expirationDate;
final int ratingCount;
final double? ratingDriver;
final int age;
DriverProfileCard({
required this.driverId,
required this.name,
required this.phoneNumber,
required this.email,
required this.birthdate,
required this.gender,
required this.education,
required this.carMake,
required this.carModel,
required this.carPlate,
required this.carColor,
required this.vin,
required this.registrationDate,
required this.expirationDate,
required this.ratingCount,
required this.ratingDriver,
required this.age,
});
@override
Widget build(BuildContext context) {
return Card(
elevation: 8,
margin: const EdgeInsets.all(16),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MyTextForm(
controller: controller.vin,
hint: 'write vin for your car'.tr,
label: 'VIN'.tr,
type: TextInputType.emailAddress,
Text(
style: AppStyle.title,
name,
),
MyTextForm(
controller: controller.color,
hint: 'write Color for your car'.tr,
label: 'Color'.tr,
type: TextInputType.emailAddress,
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.phone),
const SizedBox(width: 8),
Text(style: AppStyle.title, phoneNumber),
],
),
MyTextForm(
controller: controller.make,
hint: 'write Make for your car'.tr,
label: 'Make'.tr,
type: TextInputType.emailAddress,
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.calendar_today),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'birthdate'.tr} : $birthdate',
),
MyTextForm(
controller: controller.model,
hint: 'write Model for your car'.tr,
label: 'Model'.tr,
type: TextInputType.emailAddress,
],
),
MyTextForm(
controller: controller.year,
hint: 'write Year for your car'.tr,
label: 'Year'.tr,
type: TextInputType.number,
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.wc),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'gender'.tr} : $gender',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.school),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'education'.tr} : $education',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.car_repair),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'Make'.tr} : $carMake',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.model_training),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'car_model'.tr} : $carModel',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.drive_eta),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'car_plate'.tr} : $carPlate',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.color_lens),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'car_color'.tr} : $carColor',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.confirmation_number),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'vin'.tr} : $vin',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.calendar_today),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'registration_date'.tr} : $registrationDate',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.calendar_today),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'expiration_date'.tr} : $expirationDate',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.star),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'rating_count'.tr} : $ratingCount',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.star_rate),
const SizedBox(width: 8),
ratingDriver != null
? Text(
style: AppStyle.title,
'${'rating_driver'.tr} : $ratingDriver',
)
: Text(
style: AppStyle.title,
'${'rating_driver'.tr} : 0',
),
],
),
const SizedBox(height: 8),
Row(
children: [
const Icon(Icons.person),
const SizedBox(width: 8),
Text(
style: AppStyle.title,
'${'age'.tr} : $age',
),
],
),
MyTextForm(
controller: controller.expirationDate,
hint: 'write Expiration Date for your car'.tr,
label: 'Expiration Date'.tr,
type: TextInputType.datetime),
MyElevatedButton(
title: 'Update'.tr,
onPressed: () => controller.updateFields())
],
),
),
));
},
icon: const Icon(Icons.edit),
),
));
);
}
}

View File

@@ -1,11 +1,10 @@
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/views/home/Captin/home_captain/home_captin.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/main.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import '../../constant/box_name.dart';
import '../../controller/local/local_controller.dart';
import '../auth/login_page.dart';
class Language extends StatelessWidget {
const Language({Key? key}) : super(key: key);
@@ -17,8 +16,8 @@ class Language extends StatelessWidget {
builder: (controller) => Center(
child: Container(
padding: const EdgeInsets.all(15),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
child: ListView(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
"Choose Language".tr,
@@ -26,24 +25,183 @@ class Language extends StatelessWidget {
),
const SizedBox(height: 20),
MyElevatedButton(
title: 'Ar',
title: 'العربية',
onPressed: () {
controller.changeLang("ar");
Get.offAll(() => const MyApp());
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.offAll(() => HomeCaptain());
}));
},
),
MyElevatedButton(
title: "En",
title: "English",
onPressed: () {
controller.changeLang("en");
Get.offAll(() => const MyApp());
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.offAll(() => HomeCaptain());
}));
},
),
MyElevatedButton(
title: "Tr",
title: "Türkçe",
onPressed: () {
controller.changeLang("tr");
Get.offAll(() => const MyApp());
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.offAll(() => HomeCaptain());
}));
},
),
MyElevatedButton(
title: "Français",
onPressed: () {
controller.changeLang("fr");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.offAll(() => HomeCaptain());
}));
},
),
MyElevatedButton(
title: "Italiano",
onPressed: () {
controller.changeLang("it");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.offAll(() => HomeCaptain());
}));
},
),
MyElevatedButton(
title: "Deutsch",
onPressed: () {
controller.changeLang("de");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.offAll(() => HomeCaptain());
}));
},
),
MyElevatedButton(
title: "Ελληνικά",
onPressed: () {
controller.changeLang("el");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.offAll(() => HomeCaptain());
}));
},
),
MyElevatedButton(
title: "Español",
onPressed: () {
controller.changeLang("es");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.offAll(() => HomeCaptain());
}));
},
),
MyElevatedButton(
title: "فارسی",
onPressed: () {
controller.changeLang("fa");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.offAll(() => HomeCaptain());
}));
},
),
MyElevatedButton(
title: "中文",
onPressed: () {
controller.changeLang("zh");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.offAll(() => HomeCaptain());
}));
},
),
MyElevatedButton(
title: "Русский",
onPressed: () {
controller.changeLang("ru");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.offAll(() => HomeCaptain());
}));
},
),
MyElevatedButton(
title: "हिन्दी",
onPressed: () {
controller.changeLang("hi");
Get.defaultDialog(
title: 'You should restart app to change language'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () {
Get.offAll(() => HomeCaptain());
}));
},
),
],

View File

@@ -9,6 +9,7 @@ import agora_rtc_engine
import audio_session
import device_info_plus
import file_selector_macos
import firebase_auth
import firebase_core
import firebase_messaging
import flutter_local_notifications
@@ -22,6 +23,7 @@ import location
import package_info_plus
import path_provider_foundation
import record_darwin
import sign_in_with_apple
import sqflite
import url_launcher_macos
import video_player_avfoundation
@@ -32,6 +34,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
@@ -45,6 +48,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
RecordPlugin.register(with: registry.registrar(forPlugin: "RecordPlugin"))
SignInWithApplePlugin.register(with: registry.registrar(forPlugin: "SignInWithApplePlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))

View File

@@ -13,10 +13,10 @@ packages:
dependency: transitive
description:
name: _flutterfire_internals
sha256: f5628cd9c92ed11083f425fd1f8f1bc60ecdda458c81d73b143aeda036c35fe7
sha256: e4be6711f96d3d4eebe79728897d645b7a5585bbfdd6d534878d202c171266d7
url: "https://pub.dev"
source: hosted
version: "1.3.16"
version: "1.3.34"
agora_rtc_engine:
dependency: "direct main"
description:
@@ -154,7 +154,7 @@ packages:
source: hosted
version: "8.8.1"
cached_network_image:
dependency: "direct main"
dependency: transitive
description:
name: cached_network_image
sha256: f98972704692ba679db144261172a8e20feb145636c617af0eb4022132a6797f
@@ -249,14 +249,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.7.4"
cli_util:
dependency: transitive
description:
name: cli_util
sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19
url: "https://pub.dev"
source: hosted
version: "0.4.1"
clock:
dependency: transitive
description:
@@ -298,7 +290,7 @@ packages:
source: hosted
version: "0.3.3+7"
crypto:
dependency: "direct main"
dependency: transitive
description:
name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
@@ -321,14 +313,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.6"
custom_searchable_dropdown:
dependency: "direct main"
description:
name: custom_searchable_dropdown
sha256: c2676b1ee55f0b71a7cd890ae473cf97651f018b2695b3bf57c8c28a14e2fa95
url: "https://pub.dev"
source: hosted
version: "2.1.1"
dart_style:
dependency: transitive
description:
@@ -346,7 +330,7 @@ packages:
source: hosted
version: "0.7.10"
device_info_plus:
dependency: "direct main"
dependency: transitive
description:
name: device_info_plus
sha256: "0042cb3b2a76413ea5f8a2b40cec2a33e01d0c937e91f0f7c211fde4f7739ba6"
@@ -449,14 +433,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.9.3+1"
firebase_auth:
dependency: "direct main"
description:
name: firebase_auth
sha256: ea95cd29e27e8ec1971af263d74b208ce85dbc7df9197d8b5eab2aa7de7cfea8
url: "https://pub.dev"
source: hosted
version: "4.19.6"
firebase_auth_platform_interface:
dependency: transitive
description:
name: firebase_auth_platform_interface
sha256: c252d2c97a02cf03fbf3595c5f7edf2a731062356b09d2c338f0b3d63567239f
url: "https://pub.dev"
source: hosted
version: "7.2.7"
firebase_auth_web:
dependency: transitive
description:
name: firebase_auth_web
sha256: "5db2319d59b4bb08cf0cc26e0f110f9ae1cf9cf775ce516e5cc38cd6704253de"
url: "https://pub.dev"
source: hosted
version: "5.11.6"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
sha256: "96607c0e829a581c2a483c658f04e8b159964c3bae2730f73297070bc85d40bb"
sha256: "4b5100e2dbc3fe72c2d4241a046d3f01457fe11293283a324f5c52575e3406f8"
url: "https://pub.dev"
source: hosted
version: "2.24.2"
version: "2.31.1"
firebase_core_platform_interface:
dependency: transitive
description:
@@ -469,10 +477,10 @@ packages:
dependency: transitive
description:
name: firebase_core_web
sha256: d585bdf3c656c3f7821ba1bd44da5f13365d22fcecaf5eb75c4295246aaa83c0
sha256: "43d9e951ac52b87ae9cc38ecdcca1e8fa7b52a1dd26a96085ba41ce5108db8e9"
url: "https://pub.dev"
source: hosted
version: "2.10.0"
version: "2.17.0"
firebase_messaging:
dependency: "direct main"
description:
@@ -534,14 +542,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.2.7"
flutter_launcher_icons:
dependency: "direct main"
description:
name: flutter_launcher_icons
sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea"
url: "https://pub.dev"
source: hosted
version: "0.13.1"
flutter_lints:
dependency: "direct dev"
description:
@@ -840,22 +840,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.2"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6"
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:
@@ -1296,14 +1280,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.0"
lottie:
dependency: "direct main"
description:
name: lottie
sha256: a93542cc2d60a7057255405f62252533f8e8956e7e06754955669fd32fb4b216
url: "https://pub.dev"
source: hosted
version: "2.7.0"
matcher:
dependency: transitive
description:
@@ -1656,6 +1632,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.4"
sign_in_with_apple:
dependency: "direct main"
description:
name: sign_in_with_apple
sha256: b0abd9c0d0407140829b12cd99a250f10b20352573ff08c7e0c5174c64b4973e
url: "https://pub.dev"
source: hosted
version: "6.1.0"
sign_in_with_apple_platform_interface:
dependency: transitive
description:
name: sign_in_with_apple_platform_interface
sha256: c2ef2ce6273fce0c61acd7e9ff5be7181e33d7aa2b66508b39418b786cca2119
url: "https://pub.dev"
source: hosted
version: "1.1.0"
sign_in_with_apple_web:
dependency: transitive
description:
name: sign_in_with_apple_web
sha256: c009e9beeb6c376e86aaa154fcc8b4e075d4bad90c56286b9668a51cdb6129ea
url: "https://pub.dev"
source: hosted
version: "2.1.0"
sky_engine:
dependency: transitive
description: flutter

View File

@@ -1,12 +1,11 @@
name: SEFER
description: A new Flutter project.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: '>=3.0.5 <4.0.0'
sdk: ">=3.0.5 <4.0.0"
dependencies:
flutter:
@@ -18,40 +17,40 @@ dependencies:
google_maps_flutter: ^2.5.0
sqflite: ^2.3.0
path: ^1.8.3
lottie: ^2.5.0
# lottie: ^2.5.0
intl: ^0.18.1
google_fonts: ^ 4.0.4
# google_fonts: ^ 4.0.4
http: ^0.13.6
get: ^4.6.5
get_storage: ^2.1.1
url_launcher: ^6.1.12
location: ^5.0.2+1
google_polyline_algorithm: ^3.1.0
custom_searchable_dropdown: ^2.1.1
# custom_searchable_dropdown: ^2.1.1
animated_text_kit: ^4.2.2
flutter_secure_storage: ^9.0.0
geolocator: ^10.0.0
flutter_paypal: ^0.2.0
flutter_launcher_icons: ^0.13.1
crypto: ^3.0.3
# flutter_launcher_icons: ^0.13.1 #to be remove
# crypto: ^3.0.3
flutter_rating_bar: ^4.0.1
flutter_font_icons: ^2.2.5
device_info_plus: ^9.1.0
# device_info_plus: ^9.1.0
image_picker: ^1.0.4
flutter_stripe: ^9.5.0+1
camera: ^0.10.5+5
camera: ^0.10.5+5 #to be remove
flutter_widget_from_html: ^0.14.6
local_auth: ^2.1.7
image: ^4.1.3
image: ^4.1.3 #to be remove
image_cropper: ^4.0.1
envied: ^0.5.2
cached_network_image: ^3.3.0
# cached_network_image: ^3.3.0 #to be remove
calendar_builder: ^0.0.6
fl_chart: ^0.66.0
agora_rtc_engine: ^6.2.6
flutter_tts: ^3.8.5
permission_handler: ^11.3.0
google_generative_ai: ^0.0.1-dev
# google_generative_ai: ^0.0.1-dev
vibration: ^1.8.4
wakelock_plus:
background_location: ^0.13.0
@@ -62,34 +61,33 @@ dependencies:
share: ^2.0.4
google_sign_in: ^6.2.1
google_mlkit_text_recognition: ^0.13.0
sign_in_with_apple: ^6.1.0
firebase_auth: ^4.19.6
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^ 3.0.1
flutter_lints: ^3.0.1
envied_generator: ^0.5.2
build_runner: ^2.4.6
flutter_launcher_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/logo.png"
min_sdk_android: 21
web:
generate: true
image_path: "assets/images/logo.png"
background_color: "#hexcode"
theme_color: "#hexcode"
windows:
generate: true
image_path: "assets/images/logo.png"
icon_size: 48
macos:
generate: true
image_path: "assets/images/logo.png"
# flutter_launcher_icons:
# android: "launcher_icon"
# ios: true
# image_path: "assets/images/logo.png"
# min_sdk_android: 21
# web:
# generate: true
# image_path: "assets/images/logo.png"
# background_color: "#hexcode"
# theme_color: "#hexcode"
# windows:
# generate: true
# image_path: "assets/images/logo.png"
# icon_size: 48
# macos:
# generate: true
# image_path: "assets/images/logo.png"
flutter:
uses-material-design: true
@@ -100,6 +98,12 @@ flutter:
- shorebird.yaml
fonts:
- family: digital-counter-7
- family: mohanad
fonts:
- asset: assets/fonts/digital-counter-7.regular.ttf
- asset: assets/fonts/mohanad.ttf
- family: josefin
fonts:
- asset: assets/fonts/josefin.ttf
- family: digit
fonts:
- asset: assets/fonts/digit.ttf

View File

@@ -8,6 +8,7 @@
#include <agora_rtc_engine/agora_rtc_engine_plugin.h>
#include <file_selector_windows/file_selector_windows.h>
#include <firebase_auth/firebase_auth_plugin_c_api.h>
#include <firebase_core/firebase_core_plugin_c_api.h>
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
#include <flutter_tts/flutter_tts_plugin.h>
@@ -23,6 +24,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("AgoraRtcEnginePlugin"));
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
FirebaseAuthPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi"));
FirebaseCorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(

View File

@@ -5,6 +5,7 @@
list(APPEND FLUTTER_PLUGIN_LIST
agora_rtc_engine
file_selector_windows
firebase_auth
firebase_core
flutter_secure_storage_windows
flutter_tts