5/29/3
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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
|
||||
];
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
35
lib/controller/auth/apple_sigin.dart
Normal file
35
lib/controller/auth/apple_sigin.dart
Normal 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();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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') {
|
||||
Get.to(EgyptCardAI());
|
||||
// }
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
box.write(BoxName.tokenDriver, 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');
|
||||
|
||||
@@ -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']);
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -445,11 +445,12 @@ class MapDriverController extends GetxController {
|
||||
isRideFinished = true;
|
||||
isRideStarted = false;
|
||||
isPriceWindow = false;
|
||||
totalCost = carType != 'Comfort' && carType != 'Mashwari'
|
||||
? totalPassenger
|
||||
: price < double.parse(totalPassenger)
|
||||
totalCost =
|
||||
carType != 'Comfort' && carType != 'Mashwari' && carType != 'Lady'
|
||||
? totalPassenger
|
||||
: price.toStringAsFixed(2);
|
||||
: price < double.parse(totalPassenger)
|
||||
? totalPassenger
|
||||
: price.toStringAsFixed(2);
|
||||
paymentAmount = totalCost;
|
||||
box.write(BoxName.statusDriverLocation, 'off');
|
||||
// changeRideToBeginToPassenger();
|
||||
@@ -574,14 +575,18 @@ class MapDriverController extends GetxController {
|
||||
? (i ~/ 60) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().speedPrice)
|
||||
: carType == 'Mashwari'
|
||||
: carType == 'Lady'
|
||||
? (i ~/ 60) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().deliveryPrice)
|
||||
: (i ~/ 60) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>()
|
||||
.mashwariPrice); // $1 for each minute + $4 for each km
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: carType == 'Mashwari'
|
||||
? (i ~/ 60) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().deliveryPrice)
|
||||
: (i ~/ 60) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>()
|
||||
.mashwariPrice); // $1 for each minute + $4 for each km
|
||||
price = (price * .10) + price; // Add 10% tax
|
||||
speed = Get.find<LocationController>().speed * 3.6;
|
||||
progressTimerRideBegin = i / durationOfRide;
|
||||
@@ -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(',');
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -38,7 +38,7 @@ ThemeData themeEnglish = ThemeData(
|
||||
);
|
||||
|
||||
ThemeData themeArabic = ThemeData(
|
||||
fontFamily: "Cairo",
|
||||
fontFamily: 'mohanad',
|
||||
textTheme: const TextTheme(
|
||||
displayLarge: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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()),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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,83 +23,269 @@ 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(
|
||||
height: Get.height * .4,
|
||||
child: LineChart(
|
||||
duration: const Duration(milliseconds: 150),
|
||||
curve: Curves.ease,
|
||||
LineChartData(
|
||||
lineBarsData: [
|
||||
LineChartBarData(
|
||||
spots: durationController.chartData,
|
||||
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,
|
||||
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.chartData,
|
||||
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),
|
||||
),
|
||||
),
|
||||
isStrokeJoinRound: true,
|
||||
shadow: const BoxShadow(
|
||||
color: AppColor.yellowColor,
|
||||
blurRadius: 4,
|
||||
offset: Offset(2, 2),
|
||||
),
|
||||
),
|
||||
],
|
||||
showingTooltipIndicators: const [],
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
topTitles: AxisTitles(
|
||||
],
|
||||
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 Hours on month'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30, showTitles: true)),
|
||||
leftTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Counts of Hours 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),
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Total Hours on month'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30, showTitles: true)),
|
||||
leftTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Counts of Hours 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(
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -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,14 +21,17 @@ class HelpCaptain extends StatelessWidget {
|
||||
body: [
|
||||
Column(
|
||||
children: [
|
||||
Card(
|
||||
color: AppColor.yellowColor,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'If you need any help or have question this is right site to do that and your welcome'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'If you need any help or have question this is right site to do that and your welcome'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -80,70 +84,84 @@ class HelpCaptain extends StatelessWidget {
|
||||
),
|
||||
)),
|
||||
GetBuilder<HelpController>(
|
||||
builder: (helpController) => Container(
|
||||
height: 400,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: ListView.builder(
|
||||
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(
|
||||
padding: const EdgeInsets.all(3),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor.greenColor,
|
||||
width: 3,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(11)),
|
||||
// elevation: 3,
|
||||
// color: AppColor.greenColor,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
print(list['id']);
|
||||
helpController.getindex(
|
||||
list['id'], list['helpQuestion']);
|
||||
helpController
|
||||
.getHelpRepley(list['id'].toString());
|
||||
Get.to(
|
||||
() => const HelpDetailsReplayPage(),
|
||||
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
|
||||
: 0,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
// if (helpController.helpQuestionDate['message'] ==
|
||||
// null) {
|
||||
// return const CircularProgressIndicator();
|
||||
// }
|
||||
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(
|
||||
border: Border.all(
|
||||
color: AppColor.greenColor,
|
||||
width: 3,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(11)),
|
||||
// elevation: 3,
|
||||
// color: AppColor.greenColor,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
print(list['id']);
|
||||
helpController.getindex(
|
||||
list['id'], list['helpQuestion']);
|
||||
helpController.getHelpRepley(
|
||||
list['id'].toString());
|
||||
Get.to(
|
||||
() => const HelpDetailsReplayPage(),
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .6,
|
||||
child: Text(
|
||||
list['helpQuestion'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .3,
|
||||
child: Text(
|
||||
list['datecreated'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .6,
|
||||
child: Text(
|
||||
list['helpQuestion'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .3,
|
||||
child: Text(
|
||||
list['datecreated'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
},
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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: () {
|
||||
Get.to(() => RideCalculateDriver());
|
||||
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),
|
||||
),
|
||||
|
||||
@@ -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(
|
||||
title: 'End Ride'.tr,
|
||||
onPressed: () {
|
||||
mapDriverController.finishRideFromDriver();
|
||||
},
|
||||
kolor: AppColor.redColor,
|
||||
),
|
||||
mapDriverController.remainingTimeTimerRideBegin <
|
||||
60
|
||||
? MyElevatedButton(
|
||||
title: 'End Ride'.tr,
|
||||
onPressed: () {
|
||||
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(
|
||||
|
||||
@@ -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(),
|
||||
});
|
||||
},
|
||||
),
|
||||
|
||||
@@ -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,30 +90,34 @@ class PointsCaptain extends StatelessWidget {
|
||||
await captainWalletController.getCaptainWalletFromBuyPoints();
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: Get.width * .22,
|
||||
height: Get.width * .15,
|
||||
margin: const EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
color: kolor,
|
||||
border: Border.all(color: AppColor.accentColor),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
shape: BoxShape.rectangle,
|
||||
),
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'$countPoint ${'Point'.tr}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
'$pricePoint ${box.read(BoxName.countryCode) == 'Jordan' ? 'JOD'.tr : 'LE'.tr}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 3, vertical: 8),
|
||||
child: Container(
|
||||
width: Get.width * .22,
|
||||
height: Get.width * .22,
|
||||
margin: const EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
color: kolor,
|
||||
border: Border.all(color: AppColor.accentColor),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
shape: BoxShape.rectangle,
|
||||
),
|
||||
)),
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'$countPoint ${'Point'.tr}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
'$pricePoint ${box.read(BoxName.countryCode) == 'Jordan' ? 'JOD'.tr : 'LE'.tr}',
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) <
|
||||
0 &&
|
||||
double.parse(captainWalletController
|
||||
.totalPoints) >
|
||||
-300
|
||||
? AppColor.yellowColor
|
||||
: double.parse(captainWalletController
|
||||
.totalPoints) <
|
||||
-300
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
),
|
||||
// decoration: AppStyle.boxDecoration1.copyWith(
|
||||
color: double.parse(
|
||||
captainWalletController.totalPoints) <
|
||||
0 &&
|
||||
double.parse(
|
||||
captainWalletController.totalPoints) >
|
||||
-300
|
||||
? AppColor.yellowColor
|
||||
: 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,86 +259,89 @@ class WalletCaptain extends StatelessWidget {
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'You can buy Points to let you online\nby this list below'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const Divider(
|
||||
indent: 30,
|
||||
endIndent: 30,
|
||||
color: AppColor.accentColor,
|
||||
thickness: 3,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: Get.height * .1,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: [
|
||||
PointsCaptain(
|
||||
kolor: AppColor.blueColor,
|
||||
pricePoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? 5
|
||||
: 100,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? '300'
|
||||
: '100',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: Colors.green,
|
||||
pricePoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? 10
|
||||
: 200,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? '1040'
|
||||
: '210',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: Colors.amberAccent,
|
||||
pricePoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? 22
|
||||
: 400,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? '2300'
|
||||
: '450',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: AppColor.yellowColor,
|
||||
pricePoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? 50
|
||||
: 1000,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? '55000'
|
||||
: '1200',
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'You can buy Points to let you online\nby this list below'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const Divider(
|
||||
indent: 30,
|
||||
endIndent: 30,
|
||||
color: AppColor.accentColor,
|
||||
thickness: 3,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: Get.height * .19,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: [
|
||||
PointsCaptain(
|
||||
kolor: AppColor.blueColor,
|
||||
pricePoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? 5
|
||||
: 100,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? '300'
|
||||
: '100',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: Colors.green,
|
||||
pricePoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? 10
|
||||
: 200,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? '1040'
|
||||
: '210',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: Colors.amberAccent,
|
||||
pricePoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? 22
|
||||
: 400,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? '2300'
|
||||
: '450',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: AppColor.yellowColor,
|
||||
pricePoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? 50
|
||||
: 1000,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) ==
|
||||
'Jordan'
|
||||
? '55000'
|
||||
: '1200',
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
@@ -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);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
96
lib/views/home/my_wallet/weekly_payment_page.dart
Normal file
96
lib/views/home/my_wallet/weekly_payment_page.dart
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -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});
|
||||
|
||||
@@ -18,140 +12,332 @@ class ProfileCaptain extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(CaptainProfileController());
|
||||
return MyScafolld(
|
||||
title: 'My Profile'.tr,
|
||||
body: [
|
||||
GetBuilder<CaptainProfileController>(
|
||||
builder: (controller) => Padding(
|
||||
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',
|
||||
),
|
||||
title: 'My Profile'.tr,
|
||||
body: [
|
||||
GetBuilder<CaptainProfileController>(
|
||||
builder: (controller) => Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Center(
|
||||
child: controller.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: DriverProfileCard(
|
||||
driverId:
|
||||
controller.captainProfileData['driverID'] ?? '',
|
||||
name: controller.captainProfileData['first_name'] +
|
||||
' ' +
|
||||
(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,
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
box.read(BoxName.nameDriver) +
|
||||
' ' +
|
||||
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),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
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(
|
||||
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),
|
||||
),
|
||||
));
|
||||
)
|
||||
],
|
||||
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(
|
||||
// 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: [
|
||||
Text(
|
||||
style: AppStyle.title,
|
||||
name,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.phone),
|
||||
const SizedBox(width: 8),
|
||||
Text(style: AppStyle.title, phoneNumber),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.calendar_today),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
style: AppStyle.title,
|
||||
'${'birthdate'.tr} : $birthdate',
|
||||
),
|
||||
],
|
||||
),
|
||||
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',
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}));
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user