This commit is contained in:
Hamza-Ayed
2023-09-27 18:30:21 +03:00
parent 7290e5ecc7
commit 5ca5d91cc9
21 changed files with 414 additions and 189 deletions

View File

@@ -12,7 +12,7 @@ import '../../../controller/home/map_page_controller.dart';
GetBuilder<MapController> buttomSheetMapPage() {
Get.put(PaymentController());
return GetBuilder<MapController>(
builder: (controller) => controller.isButtomSheetShown
builder: (controller) => controller.isBottomSheetShown
? Positioned(
left: 5,
bottom: 0,
@@ -23,7 +23,7 @@ GetBuilder<MapController> buttomSheetMapPage() {
onEnd: () {
controller.height = 250;
},
height: controller.heightButtomSheetShown,
height: controller.heightBottomSheetShown,
duration: const Duration(seconds: 2),
child: Column(
children: [
@@ -283,7 +283,7 @@ GetBuilder<MapController> buttomSheetMapPage() {
'Add Promo'.tr,
onPressed:
() async {
controller.applyPromoCodetoPassenger();
controller.applyPromoCodeToPassenger();
},
)
],
@@ -508,7 +508,7 @@ class Details extends StatelessWidget {
style: AppStyle.title,
),
Text(
'totaME ${controller.totaME.toStringAsFixed(2)} ',
'totaME ${controller.totalME.toStringAsFixed(2)} ',
style: AppStyle.title,
),
],

View File

@@ -30,7 +30,7 @@ class DriverTimeArrivePassengerPage extends StatelessWidget {
child: Column(
children: [
Text(
controller.duratioByPassenger.toString() +
controller.durationByPassenger.toString() +
' to arrive you.'.tr,
style: AppStyle.title,
),

View File

@@ -63,10 +63,10 @@ GetBuilder<MapController> formSearchPlaces() {
confirm: MyElevatedButton(
title: 'Confirm'.tr,
onPressed: () async {
controller.clearpolyline();
controller.clearPolyline();
controller.data = [];
await controller.getMap(
'${controller.mylocation.latitude.toString()},${controller.mylocation.longitude.toString()}',
'${controller.myLocation.latitude.toString()},${controller.myLocation.longitude.toString()}',
"${res['geometry']['location']['lat']},${res['geometry']['location']['lng']}");
controller.places = [];
controller.placeController.clear();

View File

@@ -13,7 +13,7 @@ GetBuilder<MapController> leftMainMenuIcons() {
children: [
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTrafic,
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
border: Border.all(),
color: AppColor.secondaryColor,
@@ -34,7 +34,7 @@ GetBuilder<MapController> leftMainMenuIcons() {
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTrafic,
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),

View File

@@ -104,7 +104,7 @@ class MainBottomMenuMap extends StatelessWidget {
child: Text(
(controller.nearestCar != null
? controller
.duratioByPassenger
.durationByPassenger
.toString()
: 'N/A')),
),
@@ -195,7 +195,7 @@ class FavioratePlacesDialogu extends StatelessWidget {
TextButton(
onPressed: () async {
await controller.getMap(
'${controller.mylocation.latitude},${controller.mylocation.longitude}',
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
);
// controller.changePickerShown();

View File

@@ -135,13 +135,13 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
onPressed: () async {
await controller
.getMap(
'${controller.mylocation.latitude},${controller.mylocation.longitude}',
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
);
controller
.changePickerShown();
controller
.changeButtomSheetShown();
.changeBottomSheetShown();
controller
.bottomSheet();
Get.back();
@@ -193,11 +193,11 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
title: 'Go to this Target'.tr,
onPressed: () async {
await controller.getMap(
'${controller.mylocation.latitude},${controller.mylocation.longitude}',
'${controller.newMylocation.latitude},${controller.newMylocation.longitude}',
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
'${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
);
controller.changePickerShown();
controller.changeButtomSheetShown();
controller.changeBottomSheetShown();
controller.bottomSheet();
// await sql
// .getAllData(TableName.placesFavorite)

View File

@@ -1,10 +1,11 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ride/views/home/map_page.dart';
import '../../../constant/style.dart';
import '../../../controller/home/map_page_controller.dart';
GetBuilder<MapController> timerForCancellTripFromPassenger() {
GetBuilder<MapController> timerForCancelTripFromPassenger() {
return GetBuilder<MapController>(
builder: (controller) {
final isNearEnd =

View File

@@ -0,0 +1,70 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../constant/colors.dart';
import '../../../constant/style.dart';
import '../../../controller/home/map_page_controller.dart';
class TimerToPassengerFromDriver extends StatelessWidget {
const TimerToPassengerFromDriver({
super.key,
});
@override
Widget build(BuildContext context) {
return GetBuilder<MapController>(builder: (controller) {
if (controller.remainingTime == 0 &&
controller.timeToPassengerFromDriverAfterApplied > 60) {
return Positioned(
left: 10,
right: 10,
bottom: Get.height * .35,
child: Container(
decoration: AppStyle.boxDecoration,
height: 140,
// width: 100,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'You Can cancel Ride After Captain did not come in the time'
.tr,
style: AppStyle.title,
),
Stack(
children: [
LinearProgressIndicator(
backgroundColor: AppColor.accentColor,
color:
controller.timeToPassengerFromDriverAfterApplied <
60
? AppColor.redColor
: AppColor.greenColor,
minHeight: 50,
borderRadius: BorderRadius.circular(15),
value: controller
.progressTimerToPassengerFromDriverAfterApplied
.toDouble(),
),
Center(
child: Text(
controller
.remainingTimeToPassengerFromDriverAfterApplied
.toString(),
style: AppStyle.title,
),
)
],
),
],
),
),
),
);
} else {
return const SizedBox();
}
});
}
}