1/25/2
This commit is contained in:
@@ -1439,6 +1439,7 @@ class MapPassengerController extends GetxController {
|
||||
|
||||
// getDistanceFromText(data[0]['distance']['text']);
|
||||
double distanceOfTrip = (data[0]['distance']['value']) / 1000;
|
||||
distance = distanceOfTrip;
|
||||
print('distance is $distanceOfTrip');
|
||||
// Animate the camera to the adjusted bounds
|
||||
if (distanceOfTrip <= 5) {
|
||||
@@ -1616,12 +1617,6 @@ class MapPassengerController extends GetxController {
|
||||
|
||||
Future bottomSheet() async {
|
||||
if (data.isNotEmpty) {
|
||||
String distanceText = await data[0]['distance']['text'];
|
||||
// String durationText = await data[0]['duration']['text'];
|
||||
print(data[0]['duration']['text']);
|
||||
print('=================================');
|
||||
// distance = getDistanceFromText(distanceText);
|
||||
// duration = getDistanceFromText(durationText);
|
||||
durationToAdd = Duration(seconds: durationToRide);
|
||||
print('durationToRide----- $durationToRide');
|
||||
hours = durationToAdd.inHours;
|
||||
@@ -1637,61 +1632,37 @@ class MapPassengerController extends GetxController {
|
||||
totalME = totalPassenger - tax;
|
||||
update();
|
||||
if (currentTime.hour >= 22) {
|
||||
if (distanceText.contains('km')) {
|
||||
cost = distance * 0.23;
|
||||
update();
|
||||
} else {
|
||||
cost = distance * 0.23 / 1000;
|
||||
update();
|
||||
}
|
||||
cost = distance * 0.23;
|
||||
update();
|
||||
} else if (currentTime.hour < 5) {
|
||||
if (distanceText.contains('km')) {
|
||||
cost = distance * 0.25;
|
||||
update();
|
||||
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
|
||||
if (averageDuration > 2.5) {
|
||||
cost = distance * 0.25;
|
||||
update();
|
||||
} else {
|
||||
cost = distance * 0.25 / 1000;
|
||||
update();
|
||||
}
|
||||
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
|
||||
if (averageDuration > 2.5) {
|
||||
if (distanceText.contains('km')) {
|
||||
cost = distance * 0.25;
|
||||
update();
|
||||
} else {
|
||||
cost = distance * 0.25 / 1000;
|
||||
update();
|
||||
}
|
||||
} else {
|
||||
if (distanceText.contains('km')) {
|
||||
cost = distance * 0.21;
|
||||
update();
|
||||
} else {
|
||||
cost = distance * 0.21 / 1000;
|
||||
update();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (distanceText.contains('km')) {
|
||||
cost = distance * 0.21;
|
||||
update();
|
||||
} else {
|
||||
cost = distance * 0.21 / 1000;
|
||||
update();
|
||||
}
|
||||
} else {
|
||||
cost = distance * 0.21;
|
||||
update();
|
||||
}
|
||||
|
||||
print('cost $cost');
|
||||
if (totalPassenger < 1) {
|
||||
totalPassenger = 1;
|
||||
totalDriver = 1;
|
||||
update();
|
||||
if (totalDriver < .5) {
|
||||
totalDriver = .75;
|
||||
totalME = .21;
|
||||
update();
|
||||
} else {
|
||||
totalDriver = .90;
|
||||
totalME = .06;
|
||||
update();
|
||||
}
|
||||
// if (totalDriver < .5) {
|
||||
// totalDriver = .75;
|
||||
// totalME = .21;
|
||||
// update();
|
||||
// } else {
|
||||
// totalDriver = .90;
|
||||
// totalME = .06;
|
||||
// update();
|
||||
// }
|
||||
}
|
||||
|
||||
// buttomSheetMapPage();
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/links.dart';
|
||||
import 'package:ride/controller/functions/crud.dart';
|
||||
import 'package:ride/main.dart';
|
||||
|
||||
class PassengerWalletHistoryController extends GetxController {
|
||||
bool isLoading = false;
|
||||
List archive = [];
|
||||
|
||||
getArchivePayment() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getPassengerWalletArchive,
|
||||
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
||||
|
||||
archive = jsonDecode(res)['message'];
|
||||
print(archive);
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
getArchivePayment();
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ class PaymentController extends GetxController {
|
||||
bool isPromoSheetDialogue = false;
|
||||
final formKey = GlobalKey<FormState>();
|
||||
final promo = TextEditingController();
|
||||
double totalPassenger = MapPassengerController().totalPassenger;
|
||||
double totalPassenger = Get.find<MapPassengerController>().totalPassenger;
|
||||
int? selectedAmount = 0;
|
||||
List<dynamic> totalPassengerWalletDetails = [];
|
||||
String passengerTotalWalletAmount = '';
|
||||
|
||||
@@ -5,26 +5,12 @@ import '../../constant/colors.dart';
|
||||
|
||||
ThemeData themeEnglish = ThemeData(
|
||||
fontFamily: "PlayfairDisplay",
|
||||
textTheme: const TextTheme(
|
||||
displaySmall: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 24,
|
||||
color: AppColor.primaryColor),
|
||||
displayLarge: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 22,
|
||||
color: AppColor.primaryColor),
|
||||
displayMedium: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 26,
|
||||
color: AppColor.primaryColor),
|
||||
bodyLarge: TextStyle(
|
||||
height: 2,
|
||||
color: AppColor.accentColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14),
|
||||
bodyMedium:
|
||||
TextStyle(height: 2, color: AppColor.accentColor, fontSize: 14)),
|
||||
textTheme: TextTheme(
|
||||
displaySmall: AppStyle.title,
|
||||
displayLarge: AppStyle.title,
|
||||
displayMedium: AppStyle.title,
|
||||
bodyLarge: AppStyle.headTitle,
|
||||
bodyMedium: AppStyle.headTitle2),
|
||||
primarySwatch: Colors.blue,
|
||||
dialogTheme: DialogTheme(
|
||||
backgroundColor: AppColor.secondaryColor,
|
||||
|
||||
Reference in New Issue
Block a user