5/6/1
This commit is contained in:
@@ -54,13 +54,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
left: 5,
|
||||
right: 5,
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
color: Color.fromARGB(255, 255, 255, 255),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(8),
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: Get.height * .4,
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -406,8 +400,8 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class Burc extends StatelessWidget {
|
||||
const Burc({super.key});
|
||||
class BurcMoney extends StatelessWidget {
|
||||
const BurcMoney({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -467,6 +461,66 @@ class Burc extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class HeaderDestination extends StatelessWidget {
|
||||
const HeaderDestination({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (mapPassengerController) {
|
||||
return mapPassengerController.data.isNotEmpty &&
|
||||
mapPassengerController.isBottomSheetShown &&
|
||||
mapPassengerController.rideConfirm == false
|
||||
? Positioned(
|
||||
top: Get.height * .1,
|
||||
left: 5,
|
||||
right: 5,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: Get.height * .16,
|
||||
width: Get.width * .8,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
mapPassengerController
|
||||
.getDialog('Are you want to change'.tr, '', () {
|
||||
Get.back();
|
||||
mapPassengerController.cancelRide();
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'🤢 ${mapPassengerController.startNameAddress}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
'😡 ${mapPassengerController.endNameAddress}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'📍 ${mapPassengerController.distance} ${'KM'.tr} ⌛ ${mapPassengerController.hours > 0 ? '${'Your Ride Duration is '.tr}${mapPassengerController.hours} ${'H and'.tr} ${mapPassengerController.minutes} ${'m'.tr}' : '${'Your Ride Duration is '.tr} ${mapPassengerController.minutes} m'}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CarDialogue extends StatelessWidget {
|
||||
const CarDialogue({
|
||||
super.key,
|
||||
|
||||
@@ -110,7 +110,26 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
|
||||
box.read(BoxName.addWork).split(',')[1]),
|
||||
);
|
||||
print(latLng);
|
||||
controller.newMyLocation = latLng;
|
||||
controller.newMyLocation =
|
||||
controller.newStartPointLocation;
|
||||
controller.changeMainBottomMenuMap();
|
||||
|
||||
controller.getMap(
|
||||
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
|
||||
'${latLng.latitude},${latLng.longitude}',
|
||||
);
|
||||
controller.currentLocationToFormPlaces = false;
|
||||
controller.placesDestination = [];
|
||||
// controller.isCancelRidePageShown = true;
|
||||
controller.clearPlacesStart();
|
||||
controller.clearPlacesDestination();
|
||||
controller.passengerStartLocationFromMap =
|
||||
false;
|
||||
controller.isPickerShown = false;
|
||||
// controller.showBottomSheet1();
|
||||
// Get.back();
|
||||
controller.showBottomSheet1();
|
||||
// controller.newMyLocation = latLng;
|
||||
controller.update();
|
||||
}
|
||||
},
|
||||
@@ -128,11 +147,16 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
|
||||
}));
|
||||
},
|
||||
child: Container(
|
||||
width: Get.width * .25,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.greenColor.withOpacity(.4),
|
||||
border: Border.all()),
|
||||
child: Text(
|
||||
'${'Work :'.tr} ${box.read(BoxName.addWork).toString() == 'addWork' ? 'Add Work' : box.read(BoxName.addWork).toString().split(',')[0] + box.read(BoxName.addWork).toString().split(',')[1]} '),
|
||||
' ${box.read(BoxName.addWork)}' == 'addWork'
|
||||
? 'Add Work'
|
||||
: 'Work',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
@@ -165,16 +189,37 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
|
||||
box.read(BoxName.addHome).split(',')[1]),
|
||||
);
|
||||
print(latLng);
|
||||
controller.newMyLocation = latLng;
|
||||
controller.changeMainBottomMenuMap();
|
||||
|
||||
// controller.newMyLocation = latLng;
|
||||
controller.getMap(
|
||||
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
|
||||
'${latLng.latitude},${latLng.longitude}',
|
||||
);
|
||||
controller.currentLocationToFormPlaces = false;
|
||||
controller.placesDestination = [];
|
||||
// controller.isCancelRidePageShown = true;
|
||||
controller.clearPlacesStart();
|
||||
controller.clearPlacesDestination();
|
||||
controller.passengerStartLocationFromMap =
|
||||
false;
|
||||
controller.isPickerShown = false;
|
||||
// controller.showBottomSheet1();
|
||||
// Get.back();
|
||||
controller.showBottomSheet1();
|
||||
// controller.newMyLocation = latLng;
|
||||
controller.update();
|
||||
controller.update();
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: Get.width * .25,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.yellowColor.withOpacity(.4),
|
||||
border: Border.all()),
|
||||
child: Text(
|
||||
'Home : ${box.read(BoxName.addHome) == 'addHome' ? 'Add Home' : box.read(BoxName.addHome)} '),
|
||||
textAlign: TextAlign.center,
|
||||
'${box.read(BoxName.addHome) == 'addHome' ? 'Add Home' : 'Home'} '),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/constant/table_names.dart';
|
||||
import 'package:SEFER/controller/functions/crud.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
@@ -15,10 +17,10 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
final textToSpeechController = Get.put(TextToSpeechController());
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: 85,
|
||||
left: 6,
|
||||
top: Get.height * .008,
|
||||
left: Get.width * .2,
|
||||
child: Builder(builder: (context) {
|
||||
return Column(
|
||||
return Row(
|
||||
children: [
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
@@ -39,7 +41,7 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
width: 5,
|
||||
),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
@@ -60,7 +62,7 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
width: 5,
|
||||
),
|
||||
// if (Platform.isIOS)
|
||||
AnimatedContainer(
|
||||
@@ -84,25 +86,25 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
width: 5,
|
||||
),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () async {
|
||||
sql.deleteAllData(TableName.recentLocations);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.voice_chat,
|
||||
size: 29,
|
||||
),
|
||||
),
|
||||
),
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// border: Border.all(),
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: IconButton(
|
||||
// onPressed: () async {
|
||||
// await Get.find<AudioRecorderController>().stopRecording();
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// Icons.voice_chat,
|
||||
// size: 29,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
|
||||
@@ -145,7 +145,7 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
SizedBox recentPlacesWidget(MapPassengerController controller) {
|
||||
final textToSpeechController = Get.put(TextToSpeechController());
|
||||
return SizedBox(
|
||||
height: 50,
|
||||
height: controller.recentPlaces.isEmpty ? 0 : 50,
|
||||
child: ListView.builder(
|
||||
itemCount: controller.recentPlaces.length,
|
||||
scrollDirection: Axis.horizontal,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -8,6 +11,7 @@ import 'package:SEFER/views/home/profile/feed_back_page.dart';
|
||||
import 'package:SEFER/views/home/profile/order_history.dart';
|
||||
import 'package:SEFER/views/home/profile/promos_passenger_page.dart';
|
||||
import 'package:SEFER/views/home/profile/taarif_page.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
@@ -160,9 +164,24 @@ class MapMenuWidget extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconMainPageMap(
|
||||
onTap: () {
|
||||
// Get.to(const RegisterCaptin());
|
||||
//todo use url to use driver app
|
||||
onTap: () async {
|
||||
final String driverAppUrl;
|
||||
if (defaultTargetPlatform == TargetPlatform.android) {
|
||||
driverAppUrl =
|
||||
'https://play.google.com/store/apps/details?id=id6458734951'; // Replace with your driver app's Play Store URL
|
||||
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
|
||||
driverAppUrl =
|
||||
'https://apps.apple.com/app/id6458734951'; // Replace with your driver app's App Store ID
|
||||
} else {
|
||||
// Handle other platforms or unknown platform (optional)
|
||||
return;
|
||||
}
|
||||
|
||||
if (await canLaunch(driverAppUrl)) {
|
||||
await launch(driverAppUrl);
|
||||
} else {
|
||||
throw 'Could not launch app store URL';
|
||||
}
|
||||
},
|
||||
title: 'Driver'.tr,
|
||||
icon: WeatherIcons.wi_moon_14,
|
||||
|
||||
@@ -15,7 +15,7 @@ class MenuIconMapPageWidget extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: 30,
|
||||
top: Get.height * .008,
|
||||
left: box.read(BoxName.lang) != 'ar' ? 5 : null,
|
||||
right: box.read(BoxName.lang) == 'ar' ? 5 : null,
|
||||
child: Container(
|
||||
|
||||
Reference in New Issue
Block a user