hom
This commit is contained in:
@@ -195,15 +195,17 @@ class FirebaseMessagesController extends GetxController {
|
||||
// Handle the result here, e.g., show a dialog or update the UI
|
||||
var result = jsonDecode(result0);
|
||||
MyDialogContent().getDialog(
|
||||
'Face Detection Result'.tr,
|
||||
Text(
|
||||
result['similar'].toString() == 'true'
|
||||
? 'similar'.tr
|
||||
: 'not similar'.tr,
|
||||
style: AppStyle.title,
|
||||
), () {
|
||||
Get.back();
|
||||
});
|
||||
'Face Detection Result'.tr,
|
||||
Text(
|
||||
result['similar'].toString() == 'true'
|
||||
? 'similar'.tr
|
||||
: 'not similar'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
() {
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
|
||||
update();
|
||||
} else if (message.notification!.title! == 'Hi ,I will go now') {
|
||||
|
||||
@@ -306,7 +306,7 @@ class ImageController extends GetxController {
|
||||
'POST',
|
||||
Uri.parse(link),
|
||||
);
|
||||
|
||||
Log.print('request: ${request}');
|
||||
var length = await file.length();
|
||||
var stream = http.ByteStream(file.openRead());
|
||||
var multipartFile = http.MultipartFile(
|
||||
|
||||
@@ -10,73 +10,140 @@ import '../../constant/box_name.dart';
|
||||
import '../../main.dart';
|
||||
import '../../views/auth/captin/login_captin.dart';
|
||||
|
||||
// class SplashScreenController extends GetxController
|
||||
// with GetTickerProviderStateMixin {
|
||||
// late AnimationController _animationController;
|
||||
// late Animation<double> animation;
|
||||
|
||||
// String packageInfo = '';
|
||||
|
||||
// Future<void> _getPackageInfo() async {
|
||||
// final info = await PackageInfo.fromPlatform();
|
||||
// packageInfo = info.version;
|
||||
// box.write(BoxName.packagInfo, packageInfo);
|
||||
// update();
|
||||
// }
|
||||
|
||||
// @override
|
||||
// void onInit() {
|
||||
// super.onInit();
|
||||
// _getPackageInfo();
|
||||
// _animationController = AnimationController(
|
||||
// vsync: this,
|
||||
// duration: const Duration(milliseconds: 1500), // Reduced duration
|
||||
// )..forward();
|
||||
|
||||
// animation =
|
||||
// CurvedAnimation(parent: _animationController, curve: Curves.easeOut);
|
||||
|
||||
// startTimer();
|
||||
// }
|
||||
|
||||
// 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 {
|
||||
// // Reduced timer duration
|
||||
// box.read(BoxName.onBoarding) == null
|
||||
// ? Get.off(() => OnBoardingPage())
|
||||
// : box.read(BoxName.emailDriver) != null &&
|
||||
// box.read(BoxName.phoneDriver) != null &&
|
||||
// box.read(BoxName.phoneVerified) == '1'
|
||||
// ? await Get.put(LoginDriverController())
|
||||
// .loginWithGoogleCredential(
|
||||
// box.read(BoxName.driverID).toString(),
|
||||
// box.read(BoxName.emailDriver))
|
||||
// : Get.off(() => LoginCaptin());
|
||||
// });
|
||||
// }
|
||||
|
||||
// @override
|
||||
// void onClose() {
|
||||
// _animationController.dispose();
|
||||
// super.onClose();
|
||||
// }
|
||||
// }
|
||||
class SplashScreenController extends GetxController
|
||||
with SingleGetTickerProviderMixin {
|
||||
late AnimationController animationController;
|
||||
late Animation<double> zoomInAnimation;
|
||||
late Animation<double> zoomOutAnimation;
|
||||
with GetTickerProviderStateMixin {
|
||||
late AnimationController _animationController;
|
||||
late Animation<double> animation;
|
||||
final progress = 0.0.obs;
|
||||
Timer? _progressTimer;
|
||||
|
||||
String packageInfo = '';
|
||||
|
||||
Future<void> checkForUpdate() async {
|
||||
final packageInfo = await PackageInfo.fromPlatform();
|
||||
final currentVersion = packageInfo.buildNumber;
|
||||
final version1 = packageInfo.version;
|
||||
print('currentVersion is : $currentVersion');
|
||||
// Fetch the latest version from your server
|
||||
|
||||
Future<void> _getPackageInfo() async {
|
||||
final info = await PackageInfo.fromPlatform();
|
||||
packageInfo = info.version;
|
||||
box.write(BoxName.packagInfo, packageInfo);
|
||||
update();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
checkForUpdate();
|
||||
animationController = AnimationController(
|
||||
_getPackageInfo();
|
||||
_animationController = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(seconds: 4),
|
||||
);
|
||||
duration: const Duration(milliseconds: 1500), // Reduced duration
|
||||
)..forward();
|
||||
|
||||
zoomInAnimation = Tween<double>(begin: 1.0, end: 1.5).animate(
|
||||
CurvedAnimation(
|
||||
parent: animationController,
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
);
|
||||
animation =
|
||||
CurvedAnimation(parent: _animationController, curve: Curves.easeOut);
|
||||
|
||||
zoomOutAnimation = Tween<double>(begin: 1.5, end: 1.0).animate(
|
||||
CurvedAnimation(
|
||||
parent: animationController,
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
);
|
||||
|
||||
animationController.repeat(reverse: true);
|
||||
startTimer();
|
||||
_startProgressTimer();
|
||||
}
|
||||
|
||||
void _startProgressTimer() {
|
||||
const totalTime = 3000; // 5 seconds in milliseconds
|
||||
const interval = 50; // Update every 50ms
|
||||
int elapsed = 0;
|
||||
|
||||
_progressTimer =
|
||||
Timer.periodic(const Duration(milliseconds: interval), (timer) async {
|
||||
elapsed += interval;
|
||||
progress.value = (elapsed / totalTime).clamp(0.0, 1.0);
|
||||
|
||||
if (elapsed >= totalTime) {
|
||||
timer.cancel();
|
||||
|
||||
box.read(BoxName.onBoarding) == null
|
||||
? Get.off(() => OnBoardingPage())
|
||||
: box.read(BoxName.emailDriver) != null &&
|
||||
box.read(BoxName.phoneDriver) != null &&
|
||||
box.read(BoxName.phoneVerified) == '1'
|
||||
? await Get.put(LoginDriverController())
|
||||
.loginWithGoogleCredential(
|
||||
box.read(BoxName.driverID).toString(),
|
||||
box.read(BoxName.emailDriver))
|
||||
: Get.off(() => LoginCaptin());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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 &&
|
||||
box.read(BoxName.phoneDriver) != null &&
|
||||
box.read(BoxName.phoneVerified) == '1'
|
||||
? await Get.put(LoginDriverController())
|
||||
.loginWithGoogleCredential(
|
||||
box.read(BoxName.driverID).toString(),
|
||||
box.read(BoxName.emailDriver))
|
||||
: Get.off(() => LoginCaptin());
|
||||
// box.read(BoxName.onBoarding) == null
|
||||
// ? Get.off(() => OnBoardingPage())
|
||||
// : box.read(BoxName.email) != null &&
|
||||
// box.read(BoxName.phone) != null &&
|
||||
// box.read(BoxName.isVerified) == '1'
|
||||
// // ? Get.off(() => const MapPagePassenger())
|
||||
// ? await Get.put(LoginController()).loginUsingCredentials(
|
||||
// box.read(BoxName.passengerID).toString(),
|
||||
// box.read(BoxName.email).toString(),
|
||||
// )
|
||||
// : Get.off(() => LoginPage());
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
animationController.dispose();
|
||||
_progressTimer?.cancel();
|
||||
_animationController.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -942,7 +942,8 @@ Store your money with us and receive it in your bank as a monthly salary.''':
|
||||
"You can change the Country to get all features":
|
||||
"يمكنك تغيير الدولة للحصول على جميع الميزات",
|
||||
"Slide to End Trip": "اسحب لإنهاء الرحلة",
|
||||
"App Preferences": "تفضيلات التطبيق",
|
||||
"App Preferences": "تفضيلات التطبيق", "For Egypt": "للمصريين",
|
||||
"Non Egypt": "لغير المصريين",
|
||||
"Google Map App": "تطبيق خرائط جوجل",
|
||||
"If you want to make Google Map App run directly when you apply order":
|
||||
"إذا كنت تريد تشغيل تطبيق خرائط جوجل مباشرة عند تطبيق الطلب",
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import 'package:sefer_driver/constant/colors.dart';
|
||||
import 'package:sefer_driver/controller/firebase/firbase_messge.dart';
|
||||
import 'package:sefer_driver/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:sefer_driver/controller/payment/payment_controller.dart';
|
||||
import 'package:sefer_driver/views/widgets/error_snakbar.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -13,8 +11,6 @@ import 'package:sefer_driver/main.dart';
|
||||
import 'package:sefer_driver/views/home/Captin/home_captain/home_captin.dart';
|
||||
import 'package:sefer_driver/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../home/payment/captain_wallet_controller.dart';
|
||||
|
||||
// import '../home/captin/home_captain_controller.dart';
|
||||
|
||||
class RateController extends GetxController {
|
||||
@@ -43,9 +39,8 @@ class RateController extends GetxController {
|
||||
|
||||
Future addPassengerWallet() async {
|
||||
if (formKey.currentState!.validate()) {
|
||||
var priceOfTrip =
|
||||
double.parse(price.toString());
|
||||
// double.parse(Get.find<MapDriverController>().paymentAmount);
|
||||
var priceOfTrip = double.parse(price.toString());
|
||||
// double.parse(Get.find<MapDriverController>().paymentAmount);
|
||||
double remainingFee = double.parse(passengerPayAmount.text) - priceOfTrip;
|
||||
if (remainingFee > 0) {
|
||||
var paymentToken2 = await Get.find<MapDriverController>()
|
||||
|
||||
Reference in New Issue
Block a user