10/2/1
This commit is contained in:
@@ -11,6 +11,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapController());
|
||||
return GetBuilder<MapController>(
|
||||
builder: (controller) => controller.isPassengerInfoWindow
|
||||
? Positioned(
|
||||
|
||||
@@ -3,10 +3,13 @@ import 'package:get/get.dart';
|
||||
import 'package:ride/constant/links.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/firebase/firbase_messge.dart';
|
||||
import '../../../controller/functions/crud.dart';
|
||||
import '../../../controller/home/map_page_controller.dart';
|
||||
import '../../../main.dart';
|
||||
|
||||
class TimerToPassengerFromDriver extends StatelessWidget {
|
||||
const TimerToPassengerFromDriver({
|
||||
@@ -66,6 +69,8 @@ class TimerToPassengerFromDriver extends StatelessWidget {
|
||||
onPressed: () async {
|
||||
MapController mapController =
|
||||
Get.find<MapController>();
|
||||
final firebasMessagesController =
|
||||
Get.put(FirebasMessagesController());
|
||||
//todo start the trip and rest all counter ,start new counter of the trip time
|
||||
await CRUD()
|
||||
.post(link: AppLink.updateRides, payload: {
|
||||
@@ -74,6 +79,20 @@ class TimerToPassengerFromDriver extends StatelessWidget {
|
||||
'status': 'Applied'
|
||||
});
|
||||
mapController.driverArrivePassenger();
|
||||
// Send notification to driver to alert him that trip is begin
|
||||
firebasMessagesController
|
||||
.sendNotificationToDriverId(
|
||||
'Ride Begin',
|
||||
box.read(BoxName.name).toString(),
|
||||
mapController
|
||||
.dataCarsLocationByPassenger['message'][0]
|
||||
['token']
|
||||
.toString(),
|
||||
);
|
||||
print(mapController
|
||||
.dataCarsLocationByPassenger['message'][0]
|
||||
['token']
|
||||
.toString());
|
||||
Get.snackbar(
|
||||
'The Ride is Begin'.tr,
|
||||
'',
|
||||
|
||||
@@ -9,10 +9,11 @@ import '../widgets/mycircular.dart';
|
||||
|
||||
class PassengerLocationDirection extends StatelessWidget {
|
||||
PassengerLocationDirection({super.key});
|
||||
final LocationController locationController = Get.put(LocationController());
|
||||
// final LocationController locationController = Get.put(LocationController());
|
||||
// final MapDirection mapDirection = Get.find<MapDirection>();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(LocationController());
|
||||
// mapDirection.getMap();//todo get this argument
|
||||
return MyScafolld(
|
||||
title: 'Map'.tr,
|
||||
@@ -22,7 +23,7 @@ class PassengerLocationDirection extends StatelessWidget {
|
||||
child: GetBuilder<LocationController>(
|
||||
builder: (controller) => GoogleMap(
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: locationController.myLocation,
|
||||
target: controller.myLocation,
|
||||
zoom: 15,
|
||||
),
|
||||
)),
|
||||
|
||||
Reference in New Issue
Block a user