10/6/1
This commit is contained in:
@@ -314,7 +314,7 @@ class MapPage extends StatelessWidget {
|
||||
timerForCancelTripFromPassenger(),
|
||||
// const DriverTimeArrivePassengerPage(),
|
||||
const TimerToPassengerFromDriver(),
|
||||
const PassengerInfoWindow()
|
||||
// const PassengerInfoWindow()
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -12,7 +12,8 @@ import '../../../controller/home/map_page_controller.dart';
|
||||
GetBuilder<MapController> buttomSheetMapPage() {
|
||||
Get.put(PaymentController());
|
||||
return GetBuilder<MapController>(
|
||||
builder: (controller) => controller.isBottomSheetShown
|
||||
builder: (controller) => controller.isBottomSheetShown &&
|
||||
controller.rideConfirm == false
|
||||
? Positioned(
|
||||
left: 5,
|
||||
bottom: 0,
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
import 'package:animated_text_kit/animated_text_kit.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/controller/firebase/firbase_messge.dart';
|
||||
import 'package:ride/controller/home/captin/map_dirction.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/links.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/home/map_page_controller.dart';
|
||||
import '../../../controller/functions/crud.dart';
|
||||
import '../../../controller/functions/launch.dart';
|
||||
|
||||
class PassengerInfoWindow extends StatelessWidget {
|
||||
const PassengerInfoWindow({
|
||||
@@ -11,18 +20,215 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapController());
|
||||
return GetBuilder<MapController>(
|
||||
builder: (controller) => controller.isPassengerInfoWindow
|
||||
? Positioned(
|
||||
bottom: 2,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
height: controller.passengerInfoWindow,
|
||||
width: Get.width,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
Get.put(MapDirection());
|
||||
return GetBuilder<MapDirection>(
|
||||
builder: (controller) => controller.isPassengerInfoWindow == true
|
||||
? Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
bottom: 6,
|
||||
left: 8,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
height: controller.passengerInfoWindow,
|
||||
width: Get.width * .8,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
DefaultTextStyle(
|
||||
style: AppStyle.title,
|
||||
child: AnimatedTextKit(
|
||||
animatedTexts: [
|
||||
ScaleAnimatedText(
|
||||
'Go to passenger Location now'.tr,
|
||||
),
|
||||
WavyAnimatedText(
|
||||
'Go to passenger Location now'.tr),
|
||||
FlickerAnimatedText(
|
||||
'Go to passenger Location now'.tr),
|
||||
WavyAnimatedText(
|
||||
'Go to passenger Location now'.tr),
|
||||
],
|
||||
isRepeatingAnimation: true,
|
||||
onTap: () {
|
||||
// print("Tap Event");
|
||||
},
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text('Duration of the Ride is '.tr,
|
||||
style: AppStyle.title),
|
||||
Text(
|
||||
controller.duration.toString() +
|
||||
' ' +
|
||||
'Minute'.tr,
|
||||
style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text('Distance of the Ride is '.tr,
|
||||
style: AppStyle.title),
|
||||
Text(
|
||||
controller.distance.toString() + ' ' + 'KM'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text('Name of the Passenger is '.tr,
|
||||
style: AppStyle.title),
|
||||
Text(
|
||||
controller.name.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
controller.isRideBegin
|
||||
? const SizedBox()
|
||||
: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
launchCommunication('phone',
|
||||
controller.phone.toString(), '');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.phone,
|
||||
color: AppColor.blueColor,
|
||||
)),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
launchCommunication(
|
||||
'whatsapp',
|
||||
controller.phone.toString(),
|
||||
'Hello this is Captain ${box.read(BoxName.nameDriver)}');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.whatshot,
|
||||
color: AppColor.greenColor,
|
||||
)),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
launchCommunication(
|
||||
'sms',
|
||||
controller.phone.toString(),
|
||||
'Hello this is Captain ${box.read(BoxName.nameDriver)}');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.sms_rounded,
|
||||
color: AppColor.blueColor,
|
||||
)),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
launchCommunication(
|
||||
'email',
|
||||
controller.phone.toString(),
|
||||
'Hello this is Captain ${box.read(BoxName.nameDriver)}');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.email,
|
||||
color: AppColor.redColor,
|
||||
)),
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Hi',
|
||||
'body',
|
||||
controller.tokenPassenger,
|
||||
[]),
|
||||
icon:
|
||||
const Icon(Icons.notification_add))
|
||||
],
|
||||
),
|
||||
controller.remainingTimeToPassenger != 0
|
||||
? Stack(
|
||||
children: [
|
||||
LinearProgressIndicator(
|
||||
backgroundColor: AppColor.accentColor,
|
||||
color:
|
||||
controller.remainingTimeToPassenger <
|
||||
60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 50,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
value: controller.progressToPassenger
|
||||
.toDouble(),
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
controller.remainingTimeToPassenger
|
||||
.toString() +
|
||||
' Seconds'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
: controller.isRideBegin
|
||||
? const SizedBox()
|
||||
: MyElevatedButton(
|
||||
title: 'Start the Ride'.tr,
|
||||
onPressed: () {
|
||||
controller.beginRideFromDriver();
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox());
|
||||
],
|
||||
)
|
||||
: Positioned(
|
||||
bottom: Get.height * .3,
|
||||
left: 15,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
const CircularProgressIndicator(
|
||||
backgroundColor: AppColor.redColor,
|
||||
strokeWidth: 10,
|
||||
color: AppColor.redColor,
|
||||
value: 1,
|
||||
),
|
||||
CircularProgressIndicator(
|
||||
value: controller.progress,
|
||||
// Set the color based on the "isNearEnd" condition
|
||||
color: AppColor.yellowColor,
|
||||
),
|
||||
Text(
|
||||
'${controller.remainingTimeToShowPassengerInfoWindowFromDriver}',
|
||||
style: AppStyle.number,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
'Please Wait If passenger want To Cancel!'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,19 +15,36 @@ GetBuilder<MapController> timerForCancelTripFromPassenger() {
|
||||
? Positioned(
|
||||
bottom: Get.height * .35,
|
||||
left: Get.width * .05,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
CircularProgressIndicator(
|
||||
value: controller.progress,
|
||||
// Set the color based on the "isNearEnd" condition
|
||||
color: isNearEnd ? Colors.red : Colors.blue,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
CircularProgressIndicator(
|
||||
value: controller.progress,
|
||||
// Set the color based on the "isNearEnd" condition
|
||||
color: isNearEnd ? Colors.red : Colors.blue,
|
||||
),
|
||||
Text(
|
||||
'${controller.remainingTime}',
|
||||
style: AppStyle.number,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 30,
|
||||
),
|
||||
Text(
|
||||
'You can cancel Ride now'.tr,
|
||||
style: AppStyle.title,
|
||||
)
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'${controller.remainingTime}',
|
||||
style: AppStyle.number,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox();
|
||||
|
||||
@@ -78,7 +78,7 @@ class TimerToPassengerFromDriver extends StatelessWidget {
|
||||
controller.driverArrivePassenger();
|
||||
// Send notification to driver to alert him that trip is begin
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToDriverId(
|
||||
.sendNotificationToAnyWithoutData(
|
||||
'BeginTrip',
|
||||
box.read(BoxName.name).toString(),
|
||||
controller.driverToken.toString(),
|
||||
|
||||
@@ -74,7 +74,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: 'Tatal From Passenger is '.tr,
|
||||
text: 'Total From Passenger is '.tr,
|
||||
style: AppStyle.title,
|
||||
children: [
|
||||
TextSpan(
|
||||
@@ -116,7 +116,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: 'Tatal For You is '.tr,
|
||||
text: 'Total For You is '.tr,
|
||||
style: AppStyle.title,
|
||||
children: [
|
||||
TextSpan(
|
||||
@@ -179,7 +179,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
];
|
||||
// print(bodyToPassenger);
|
||||
FirebaseMessagesController()
|
||||
.sendNotificanToPassengerToken(
|
||||
.sendNotificationToPassengerToken(
|
||||
'Apply Ride',
|
||||
arguments['DriverList'][9].toString(),
|
||||
arguments['DriverList'][9].toString(),
|
||||
@@ -189,6 +189,16 @@ class OrderRequestPage extends StatelessWidget {
|
||||
Get.back();
|
||||
Get.to(() => PassengerLocationDirection(), arguments: {
|
||||
'passengerLocation': myList[0].toString(),
|
||||
'Duration': myList[4].toString(),
|
||||
'Distance': myList[5].toString(),
|
||||
'name': myList[8].toString(),
|
||||
'phone': myList[10].toString(),
|
||||
'WalletChecked': myList[13].toString(),
|
||||
'tokenPassenger': myList[9].toString(),
|
||||
'direction':
|
||||
'https://www.google.com/maps/dir/${myList[0]}/${myList[1]}/',
|
||||
'DurationToPassenger': myList[15].toString(),
|
||||
'rideId': myList[16].toString(),
|
||||
});
|
||||
},
|
||||
),
|
||||
@@ -225,7 +235,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
myList[6].toString(), body.toString());
|
||||
|
||||
FirebaseMessagesController()
|
||||
.sendNotificanToPassengerToken(
|
||||
.sendNotificationToPassengerToken(
|
||||
'Refused Ride',
|
||||
arguments['DriverList'][9].toString(),
|
||||
arguments['DriverList'][9].toString(),
|
||||
|
||||
@@ -5,6 +5,8 @@ import 'package:ride/controller/home/captin/map_dirction.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../constant/colors.dart';
|
||||
import '../../constant/style.dart';
|
||||
import '../../controller/functions/launch.dart';
|
||||
import '../../controller/functions/location_controller.dart';
|
||||
import '../home/map_widget.dart/passenger_info_window.dart';
|
||||
import '../home/map_widget.dart/timer_to_passenger_from_driver.dart';
|
||||
@@ -24,10 +26,18 @@ class PassengerLocationDirection extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: GetBuilder<MapDirection>(
|
||||
builder: (controller) => GoogleMap(
|
||||
onMapCreated: controller.onMapCreated,
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: locationController.myLocation,
|
||||
zoom: 15,
|
||||
),
|
||||
// onCameraMove: (position) {
|
||||
// locationController.myLocation = position.target;
|
||||
// print(position);
|
||||
// },
|
||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||
buildingsEnabled: true,
|
||||
mapToolbarEnabled: true,
|
||||
polylines: {
|
||||
Polyline(
|
||||
zIndex: 2,
|
||||
@@ -55,14 +65,10 @@ class PassengerLocationDirection extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
},
|
||||
onCameraMove: (cameraPosition) {
|
||||
controller.updateMarker();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
// const TimerToPassengerFromDriver(),
|
||||
const PassengerInfoWindow()
|
||||
const PassengerInfoWindow(),
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user