9/13/1
This commit is contained in:
@@ -5,4 +5,5 @@ class AppColor {
|
|||||||
static const Color secondaryColor = Colors.white;
|
static const Color secondaryColor = Colors.white;
|
||||||
static const Color accentColor = Colors.grey;
|
static const Color accentColor = Colors.grey;
|
||||||
static const Color redColor = Color.fromARGB(255, 199, 56, 46);
|
static const Color redColor = Color.fromARGB(255, 199, 56, 46);
|
||||||
|
static const Color greenColor = Color.fromARGB(255, 43, 225, 43);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class AppLink {
|
|||||||
//-----------------ridessss------------------
|
//-----------------ridessss------------------
|
||||||
static const String addRides = "$ride/rides/add.php";
|
static const String addRides = "$ride/rides/add.php";
|
||||||
static const String getRides = "$ride/rides/get.php";
|
static const String getRides = "$ride/rides/get.php";
|
||||||
|
static const String getRideStatus = "$ride/rides/getRideStatus.php";
|
||||||
static const String updateRides = "$ride/rides/update.php";
|
static const String updateRides = "$ride/rides/update.php";
|
||||||
static const String deleteRides = "$ride/rides/delete.php";
|
static const String deleteRides = "$ride/rides/delete.php";
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:ride/constant/colors.dart';
|
|||||||
import 'package:ride/constant/style.dart';
|
import 'package:ride/constant/style.dart';
|
||||||
import 'package:ride/controller/functions/crud.dart';
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
import 'package:ride/controller/functions/launch.dart';
|
import 'package:ride/controller/functions/launch.dart';
|
||||||
|
import 'package:ride/controller/home/map_page_controller.dart';
|
||||||
import 'package:ride/views/home/profile/promos_passenger_page.dart';
|
import 'package:ride/views/home/profile/promos_passenger_page.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
@@ -206,19 +207,84 @@ class FirebasMessagesController extends GetxController {
|
|||||||
print(passengerList);
|
print(passengerList);
|
||||||
print('9999999999999my Apply Ride 999999999999999');
|
print('9999999999999my Apply Ride 999999999999999');
|
||||||
var myList = jsonDecode(passengerList) as List<dynamic>;
|
var myList = jsonDecode(passengerList) as List<dynamic>;
|
||||||
|
Get.snackbar(
|
||||||
Get.defaultDialog(
|
'Captin Applied the Ride for You'.tr,
|
||||||
barrierDismissible: false,
|
'message',
|
||||||
title: message.notification!.title.toString(),
|
colorText: AppColor.greenColor,
|
||||||
content: Row(
|
duration: const Duration(seconds: 11),
|
||||||
children: [Text(myList[1].toString())],
|
instantInit: true,
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
titleText: Text(
|
||||||
|
'Applied'.tr,
|
||||||
|
style: const TextStyle(color: AppColor.redColor),
|
||||||
),
|
),
|
||||||
confirm: MyElevatedButton(
|
messageText: Text(
|
||||||
title: 'Ok',
|
'Captin Applied the Ride for You'.tr,
|
||||||
onPressed: () {
|
style: AppStyle.title,
|
||||||
// MapController().rideConfirm = true;
|
),
|
||||||
|
icon: const Icon(Icons.approval),
|
||||||
|
shouldIconPulse: true,
|
||||||
|
maxWidth: double.infinity,
|
||||||
|
margin: const EdgeInsets.all(16),
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
borderRadius: 8,
|
||||||
|
borderColor: AppColor.primaryColor,
|
||||||
|
borderWidth: 2,
|
||||||
|
backgroundColor: AppColor.secondaryColor,
|
||||||
|
leftBarIndicatorColor: AppColor.greenColor,
|
||||||
|
boxShadows: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withOpacity(0.25),
|
||||||
|
blurRadius: 4,
|
||||||
|
spreadRadius: 2,
|
||||||
|
offset: const Offset(0, 4),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
backgroundGradient: const LinearGradient(
|
||||||
|
colors: [AppColor.greenColor, AppColor.accentColor],
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
),
|
||||||
|
onTap: (GetSnackBar snackBar) {
|
||||||
|
// Do something when the snackbar is tapped.
|
||||||
|
// MapController().rideConfirm = false;
|
||||||
|
// update();
|
||||||
},
|
},
|
||||||
));
|
isDismissible: true,
|
||||||
|
showProgressIndicator: false,
|
||||||
|
dismissDirection: DismissDirection.up,
|
||||||
|
progressIndicatorController: null,
|
||||||
|
progressIndicatorBackgroundColor: Colors.transparent,
|
||||||
|
progressIndicatorValueColor: null,
|
||||||
|
snackStyle: SnackStyle.GROUNDED,
|
||||||
|
forwardAnimationCurve: Curves.easeInToLinear,
|
||||||
|
reverseAnimationCurve: Curves.easeInOut,
|
||||||
|
animationDuration: const Duration(milliseconds: 4000),
|
||||||
|
barBlur: 8,
|
||||||
|
overlayBlur: 0,
|
||||||
|
snackbarStatus: null,
|
||||||
|
overlayColor: AppColor.primaryColor.withOpacity(0.5),
|
||||||
|
userInputForm: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Get.defaultDialog(
|
||||||
|
// barrierDismissible: false,
|
||||||
|
// title: message.notification!.title.toString(),
|
||||||
|
// content: Row(
|
||||||
|
// children: [Text(myList[1].toString())],
|
||||||
|
// ),
|
||||||
|
// confirm: MyElevatedButton(
|
||||||
|
// title: 'Ok',
|
||||||
|
// onPressed: () {
|
||||||
|
// // MapController().rideConfirm = true;
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// cancel: MyElevatedButton(
|
||||||
|
// title: 'Cancel',
|
||||||
|
// onPressed: () {
|
||||||
|
// Get.back();
|
||||||
|
// },
|
||||||
|
// ));
|
||||||
} else if (message.notification!.title!.contains('Promo')) {
|
} else if (message.notification!.title!.contains('Promo')) {
|
||||||
Get.to(const PromosPassengerPage());
|
Get.to(const PromosPassengerPage());
|
||||||
}
|
}
|
||||||
@@ -370,9 +436,6 @@ class FirebasMessagesController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// void sendNotificationToManager(String title, body) async {
|
|
||||||
// // tokens = box.read(BoxName.tokenManager);
|
|
||||||
|
|
||||||
// for (var i = 0; i < tokens.length; i++) {
|
// for (var i = 0; i < tokens.length; i++) {
|
||||||
// http
|
// http
|
||||||
// .post(Uri.parse('https://fcm.googleapis.com/fcm/send'),
|
// .post(Uri.parse('https://fcm.googleapis.com/fcm/send'),
|
||||||
|
|||||||
@@ -59,8 +59,12 @@ class MapController extends GetxController {
|
|||||||
var dataCarsLocationByPassenger;
|
var dataCarsLocationByPassenger;
|
||||||
CarLocation? nearestCar;
|
CarLocation? nearestCar;
|
||||||
late Timer markerReloadingTimer;
|
late Timer markerReloadingTimer;
|
||||||
|
bool shouldFetch = true; // Flag to determine if fetch should be executed
|
||||||
int selectedPassengerCount = 1;
|
int selectedPassengerCount = 1;
|
||||||
|
double progress = 0;
|
||||||
|
int durationTimer = 25;
|
||||||
|
int remainingTime = 0;
|
||||||
|
|
||||||
void onChangedPassengerCount(int newValue) {
|
void onChangedPassengerCount(int newValue) {
|
||||||
selectedPassengerCount = newValue;
|
selectedPassengerCount = newValue;
|
||||||
update();
|
update();
|
||||||
@@ -126,9 +130,11 @@ class MapController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
changeConfirmRide() async {
|
changeConfirmRide() async {
|
||||||
// rideConfirm = true;
|
rideConfirm = true;
|
||||||
// update();
|
shouldFetch = true;
|
||||||
|
update();
|
||||||
// print('rideConfirm= $rideConfirm');
|
// print('rideConfirm= $rideConfirm');
|
||||||
|
var rideId;
|
||||||
await getCarsLocationByPassenger();
|
await getCarsLocationByPassenger();
|
||||||
await CRUD().post(link: AppLink.addRides, payload: {
|
await CRUD().post(link: AppLink.addRides, payload: {
|
||||||
"start_location": '${data[0]['start_address']}',
|
"start_location": '${data[0]['start_address']}',
|
||||||
@@ -148,6 +154,7 @@ class MapController extends GetxController {
|
|||||||
}).then((value) {
|
}).then((value) {
|
||||||
// print(jsonDecode(value)['message']);
|
// print(jsonDecode(value)['message']);
|
||||||
// List<String> body = [
|
// List<String> body = [
|
||||||
|
rideId = jsonDecode(value)['message'];
|
||||||
List<String> body = [
|
List<String> body = [
|
||||||
// '${data[0]['start_address']}',
|
// '${data[0]['start_address']}',
|
||||||
// '${data[0]['end_address']}',
|
// '${data[0]['end_address']}',
|
||||||
@@ -171,27 +178,61 @@ class MapController extends GetxController {
|
|||||||
dataCarsLocationByPassenger['message'][0]['token'].toString(),
|
dataCarsLocationByPassenger['message'][0]['token'].toString(),
|
||||||
body,
|
body,
|
||||||
);
|
);
|
||||||
// FirebasMessagesController().sendNotificationToDriverId(
|
// print(dataCarsLocationByPassenger);
|
||||||
// 'Order',
|
// print(dataCarsLocationByPassenger['message'][0]['token'].toString());
|
||||||
// jsonDecode(value)['message'].toString(),
|
|
||||||
// body[0],
|
|
||||||
// body[1],
|
|
||||||
// body[2],
|
|
||||||
// body[3],
|
|
||||||
// body[4],
|
|
||||||
// body[5],
|
|
||||||
// body[6],
|
|
||||||
// body[7],
|
|
||||||
// body[8],
|
|
||||||
// body[9],
|
|
||||||
// body[10],
|
|
||||||
// dataCarsLocationByPassenger['message'][0]['token'].toString(),
|
|
||||||
// );
|
|
||||||
print(dataCarsLocationByPassenger);
|
|
||||||
print(dataCarsLocationByPassenger['message'][0]['token'].toString());
|
|
||||||
});
|
});
|
||||||
|
delayAndFetchRideStatus(rideId);
|
||||||
|
if (shouldFetch == false) {
|
||||||
|
startTimer();
|
||||||
|
}
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void delayAndFetchRideStatus(String rideId) {
|
||||||
|
Timer(const Duration(seconds: 3), () async {
|
||||||
|
if (shouldFetch) {
|
||||||
|
// print('shouldFetch is =$shouldFetch');
|
||||||
|
var res = await CRUD()
|
||||||
|
.get(link: AppLink.getRideStatus, payload: {'order_id': rideId});
|
||||||
|
var decod = jsonDecode(res);
|
||||||
|
// print(' 0000000000000000000000000000000000000000000000000');
|
||||||
|
// print(decod['data']);
|
||||||
|
if (decod['data'].toString() == 'Apply' ||
|
||||||
|
decod['data'].toString() == 'Refused') {
|
||||||
|
shouldFetch = false; // Stop further fetches
|
||||||
|
rideConfirm = false;
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
} else {
|
||||||
|
delayAndFetchRideStatus(
|
||||||
|
rideId); // Repeat the delay and fetch operation
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
startTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
void startTimer() async {
|
||||||
|
for (int i = 0; i <= durationTimer; i++) {
|
||||||
|
await Future.delayed(const Duration(seconds: 1));
|
||||||
|
progress = i / durationTimer;
|
||||||
|
remainingTime = durationTimer - i;
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
timerEnded();
|
||||||
|
}
|
||||||
|
|
||||||
|
void timerEnded() async {
|
||||||
|
print('Timer ended');
|
||||||
|
// refuseOrder();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> getRideStatus(int rideId) async {
|
||||||
|
final response = await CRUD()
|
||||||
|
.get(link: AppLink.getRideStatus, payload: {'order_id': rideId});
|
||||||
|
|
||||||
|
return response['status'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Future cancelRide() async {
|
Future cancelRide() async {
|
||||||
@@ -202,11 +243,13 @@ class MapController extends GetxController {
|
|||||||
clearpolyline();
|
clearpolyline();
|
||||||
data = [];
|
data = [];
|
||||||
changeCancelRidePageShow();
|
changeCancelRidePageShow();
|
||||||
|
rideConfirm = false;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
clearPlaces();
|
clearPlaces();
|
||||||
clearpolyline();
|
clearpolyline();
|
||||||
data = [];
|
data = [];
|
||||||
|
rideConfirm = false;
|
||||||
changeCancelRidePageShow();
|
changeCancelRidePageShow();
|
||||||
|
|
||||||
await CRUD().post(link: AppLink.addCancelRide, payload: {
|
await CRUD().post(link: AppLink.addCancelRide, payload: {
|
||||||
@@ -349,7 +392,7 @@ class MapController extends GetxController {
|
|||||||
Future getCarsLocationByPassenger() async {
|
Future getCarsLocationByPassenger() async {
|
||||||
carsLocationByPassenger = [];
|
carsLocationByPassenger = [];
|
||||||
LatLngBounds bounds =
|
LatLngBounds bounds =
|
||||||
calculateBounds(mylocation.latitude, mylocation.longitude, 10);
|
calculateBounds(mylocation.latitude, mylocation.longitude, 8000);
|
||||||
print(
|
print(
|
||||||
'Southwest: ${bounds.southwest.latitude}, ${bounds.southwest.longitude}');
|
'Southwest: ${bounds.southwest.latitude}, ${bounds.southwest.longitude}');
|
||||||
print(
|
print(
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
@@ -11,10 +13,13 @@ import 'package:ride/views/widgets/mycircular.dart';
|
|||||||
import '../../controller/home/menu_controller.dart';
|
import '../../controller/home/menu_controller.dart';
|
||||||
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
||||||
import 'map_widget.dart/cash_confirm_bottom_page.dart';
|
import 'map_widget.dart/cash_confirm_bottom_page.dart';
|
||||||
|
import 'map_widget.dart/driver_card_from_passenger.dart';
|
||||||
|
import 'map_widget.dart/left_main_menu_icons.dart';
|
||||||
import 'map_widget.dart/main_bottom_Menu_map.dart';
|
import 'map_widget.dart/main_bottom_Menu_map.dart';
|
||||||
import 'map_widget.dart/map_menu_widget.dart';
|
import 'map_widget.dart/map_menu_widget.dart';
|
||||||
import 'map_widget.dart/menu_map_page.dart';
|
import 'map_widget.dart/menu_map_page.dart';
|
||||||
import 'map_widget.dart/payment_method.page.dart';
|
import 'map_widget.dart/payment_method.page.dart';
|
||||||
|
import 'map_widget.dart/timer_for_cancell_trip_from_passenger.dart';
|
||||||
|
|
||||||
class MapPage extends StatelessWidget {
|
class MapPage extends StatelessWidget {
|
||||||
const MapPage({super.key});
|
const MapPage({super.key});
|
||||||
@@ -266,88 +271,34 @@ class MapPage extends StatelessWidget {
|
|||||||
// liteModeEnabled: true,
|
// liteModeEnabled: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
GetBuilder<MapController>(
|
leftMainMenuIcons(),
|
||||||
builder: (controller) => Positioned(
|
|
||||||
top: 85,
|
|
||||||
left: 6,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
AnimatedContainer(
|
|
||||||
duration: const Duration(microseconds: 200),
|
|
||||||
width: controller.widthMapTypeAndTrafic,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(),
|
|
||||||
color: AppColor.secondaryColor,
|
|
||||||
borderRadius: BorderRadius.circular(15)),
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
controller.changeMapType();
|
|
||||||
// Toast.show(context, 'This is a toast message!');
|
|
||||||
},
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.satellite_alt,
|
|
||||||
size: 29,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 5,
|
|
||||||
),
|
|
||||||
AnimatedContainer(
|
|
||||||
duration: const Duration(microseconds: 200),
|
|
||||||
width: controller.widthMapTypeAndTrafic,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColor.secondaryColor,
|
|
||||||
border: Border.all(),
|
|
||||||
borderRadius: BorderRadius.circular(15)),
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
controller.changeMapTraffic();
|
|
||||||
// Toast.show(context, 'This is a toast message!');
|
|
||||||
},
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.streetview_sharp,
|
|
||||||
size: 29,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
const PickerIconOnMap(),
|
const PickerIconOnMap(),
|
||||||
// PickerAnimtionContainerFormPlaces(),
|
// PickerAnimtionContainerFormPlaces(),
|
||||||
const MainBottomMenuMap(),
|
const MainBottomMenuMap(),
|
||||||
const MapMenuWidget(),
|
const MapMenuWidget(),
|
||||||
const MenuIconMapPageWidget(),
|
const MenuIconMapPageWidget(),
|
||||||
buttomSheetMapPage(),
|
buttomSheetMapPage(),
|
||||||
GetBuilder<MapController>(
|
hexagonClipper(),
|
||||||
builder: ((controller) => controller.rideConfirm
|
cancelRidePage(),
|
||||||
? Positioned(
|
const CancelRidePageShow(),
|
||||||
top: Get.height * .2,
|
const CashConfirmPageShown(),
|
||||||
left: Get.width * .2,
|
const PaymentMethodPage(),
|
||||||
right: Get.width * .2,
|
timerForCancellTripFromPassenger(),
|
||||||
child: AnimatedContainer(
|
|
||||||
duration: const Duration(microseconds: 300),
|
|
||||||
height: 350,
|
|
||||||
width: 200,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(),
|
|
||||||
color: AppColor.secondaryColor,
|
|
||||||
borderRadius: BorderRadius.circular(15)),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'Waiting for Captin ...'.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
);
|
||||||
: const SizedBox())),
|
}
|
||||||
cancelRidePage(),
|
}
|
||||||
GetBuilder<MapController>(
|
|
||||||
|
class CancelRidePageShow extends StatelessWidget {
|
||||||
|
const CancelRidePageShow({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<MapController>(
|
||||||
builder: (controller) => controller.data.isNotEmpty
|
builder: (controller) => controller.data.isNotEmpty
|
||||||
? Positioned(
|
? Positioned(
|
||||||
right: 5,
|
right: 5,
|
||||||
@@ -361,13 +312,7 @@ class MapPage extends StatelessWidget {
|
|||||||
size: 30,
|
size: 30,
|
||||||
),
|
),
|
||||||
))
|
))
|
||||||
: const SizedBox()),
|
: const SizedBox());
|
||||||
const CashConfirmPageShown(),
|
|
||||||
const PaymentMethodPage()
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
131
lib/views/home/map_widget.dart/driver_card_from_passenger.dart
Normal file
131
lib/views/home/map_widget.dart/driver_card_from_passenger.dart
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
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';
|
||||||
|
import 'hexegone_clipper.dart';
|
||||||
|
|
||||||
|
GetBuilder<MapController> hexagonClipper() {
|
||||||
|
return GetBuilder<MapController>(
|
||||||
|
builder: ((controller) => controller.rideConfirm
|
||||||
|
? Positioned(
|
||||||
|
top: Get.height * .2,
|
||||||
|
left: Get.width * .2,
|
||||||
|
right: Get.width * .2,
|
||||||
|
child: ClipPath(
|
||||||
|
clipper:
|
||||||
|
HexagonClipper(), // CustomClipper to create a hexagon shape
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: const Duration(microseconds: 300),
|
||||||
|
height: 250,
|
||||||
|
width: 250,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: AppColor.primaryColor.withOpacity(0.25),
|
||||||
|
blurRadius: 4,
|
||||||
|
spreadRadius: 2,
|
||||||
|
offset: const Offset(0, 4),
|
||||||
|
),
|
||||||
|
BoxShadow(
|
||||||
|
color: AppColor.accentColor.withOpacity(0.5),
|
||||||
|
offset: const Offset(-5, -5),
|
||||||
|
blurRadius: 5,
|
||||||
|
spreadRadius: 2,
|
||||||
|
),
|
||||||
|
BoxShadow(
|
||||||
|
color: AppColor.secondaryColor.withOpacity(0.2),
|
||||||
|
offset: const Offset(5, 5),
|
||||||
|
blurRadius: 5,
|
||||||
|
spreadRadius: 2,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
colors: [AppColor.greenColor, AppColor.secondaryColor],
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
border: Border.all(),
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Waiting for Captin ...'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
// IconButton(
|
||||||
|
// onPressed: () {
|
||||||
|
// print(controller.dataCarsLocationByPassenger);
|
||||||
|
// },
|
||||||
|
// icon: const Icon(Icons.add),
|
||||||
|
// ),
|
||||||
|
Text(
|
||||||
|
controller.dataCarsLocationByPassenger['message'][0]
|
||||||
|
['phone']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
controller.dataCarsLocationByPassenger['message'][0]
|
||||||
|
['first_name']
|
||||||
|
.toString() +
|
||||||
|
' ' +
|
||||||
|
controller
|
||||||
|
.dataCarsLocationByPassenger['message'][0]
|
||||||
|
['last_name']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Age is '.tr +
|
||||||
|
controller
|
||||||
|
.dataCarsLocationByPassenger['message'][0]
|
||||||
|
['age']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
controller.dataCarsLocationByPassenger['message'][0]
|
||||||
|
['make']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
controller.dataCarsLocationByPassenger['message'][0]
|
||||||
|
['model']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
controller.dataCarsLocationByPassenger['message'][0]
|
||||||
|
['seats']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
controller.dataCarsLocationByPassenger['message'][0]
|
||||||
|
['model']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox()));
|
||||||
|
}
|
||||||
36
lib/views/home/map_widget.dart/hexegone_clipper.dart
Normal file
36
lib/views/home/map_widget.dart/hexegone_clipper.dart
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import 'dart:math';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class HexagonClipper extends CustomClipper<Path> {
|
||||||
|
@override
|
||||||
|
Path getClip(Size size) {
|
||||||
|
final path = Path();
|
||||||
|
final height = size.height;
|
||||||
|
final width = size.width;
|
||||||
|
final centerX = width / 2;
|
||||||
|
final centerY = height / 2;
|
||||||
|
final radius = width / 2;
|
||||||
|
|
||||||
|
const angle = 2 * pi / 10; // Angle between each side of the hexagon
|
||||||
|
|
||||||
|
// Start at the top right vertex of the hexagon
|
||||||
|
final startX = centerX + radius * cos(0);
|
||||||
|
final startY = centerY + radius * sin(0);
|
||||||
|
path.moveTo(startX, startY);
|
||||||
|
|
||||||
|
// Draw the remaining sides of the hexagon
|
||||||
|
for (int i = 1; i < 10; i++) {
|
||||||
|
final x = centerX + radius * cos(angle * i);
|
||||||
|
final y = centerY + radius * sin(angle * i);
|
||||||
|
path.lineTo(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
path.close();
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool shouldReclip(HexagonClipper oldClipper) => false;
|
||||||
|
}
|
||||||
56
lib/views/home/map_widget.dart/left_main_menu_icons.dart
Normal file
56
lib/views/home/map_widget.dart/left_main_menu_icons.dart
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../constant/colors.dart';
|
||||||
|
import '../../../controller/home/map_page_controller.dart';
|
||||||
|
|
||||||
|
GetBuilder<MapController> leftMainMenuIcons() {
|
||||||
|
return GetBuilder<MapController>(
|
||||||
|
builder: (controller) => Positioned(
|
||||||
|
top: 85,
|
||||||
|
left: 6,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
AnimatedContainer(
|
||||||
|
duration: const Duration(microseconds: 200),
|
||||||
|
width: controller.widthMapTypeAndTrafic,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(),
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
controller.changeMapType();
|
||||||
|
// Toast.show(context, 'This is a toast message!');
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.satellite_alt,
|
||||||
|
size: 29,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
AnimatedContainer(
|
||||||
|
duration: const Duration(microseconds: 200),
|
||||||
|
width: controller.widthMapTypeAndTrafic,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
border: Border.all(),
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
controller.changeMapTraffic();
|
||||||
|
// Toast.show(context, 'This is a toast message!');
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.streetview_sharp,
|
||||||
|
size: 29,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../constant/style.dart';
|
||||||
|
import '../../../controller/home/map_page_controller.dart';
|
||||||
|
|
||||||
|
GetBuilder<MapController> timerForCancellTripFromPassenger() {
|
||||||
|
return GetBuilder<MapController>(
|
||||||
|
builder: (controller) {
|
||||||
|
final isNearEnd =
|
||||||
|
controller.remainingTime <= 5; // Define a threshold for "near end"
|
||||||
|
|
||||||
|
return controller.shouldFetch == false
|
||||||
|
? Positioned(
|
||||||
|
bottom: Get.height * .3,
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${controller.remainingTime}',
|
||||||
|
style: AppStyle.number,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -170,6 +170,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
// box.read(BoxName.tokenDriver).toString(),
|
// box.read(BoxName.tokenDriver).toString(),
|
||||||
bodyToPassenger,
|
bodyToPassenger,
|
||||||
);
|
);
|
||||||
|
Get.back();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
GetBuilder<TimerController>(
|
GetBuilder<TimerController>(
|
||||||
|
|||||||
24
pubspec.lock
24
pubspec.lock
@@ -5,10 +5,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: _flutterfire_internals
|
name: _flutterfire_internals
|
||||||
sha256: "5dce45a06d386358334eb1689108db6455d90ceb0d75848d5f4819283d4ee2b8"
|
sha256: "1a5e13736d59235ce0139621b4bbe29bc89839e202409081bc667eb3cd20674c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.4"
|
version: "1.3.5"
|
||||||
animated_text_kit:
|
animated_text_kit:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -165,10 +165,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: firebase_core
|
name: firebase_core
|
||||||
sha256: "2e9324f719e90200dc7d3c4f5d2abc26052f9f2b995d3b6626c47a0dfe1c8192"
|
sha256: c78132175edda4bc532a71e01a32964e4b4fcf53de7853a422d96dac3725f389
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.15.0"
|
version: "2.15.1"
|
||||||
firebase_core_platform_interface:
|
firebase_core_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -181,34 +181,34 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_core_web
|
name: firebase_core_web
|
||||||
sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa"
|
sha256: "4cf4d2161530332ddc3c562f19823fb897ff37a9a774090d28df99f47370e973"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.6.0"
|
version: "2.7.0"
|
||||||
firebase_messaging:
|
firebase_messaging:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: firebase_messaging
|
name: firebase_messaging
|
||||||
sha256: "8ac91d83a028eef050de770f1dc98421e215714d245f34de7b154d436676fbd0"
|
sha256: "6c1a2a047d6f165b7c5f947467ac5138731a2af82c7af1c12d691dbb834f6b73"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "14.6.5"
|
version: "14.6.7"
|
||||||
firebase_messaging_platform_interface:
|
firebase_messaging_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_messaging_platform_interface
|
name: firebase_messaging_platform_interface
|
||||||
sha256: b2995e3640efb646e9ebf0e2fa50dea84895f0746a31d7e3af0e5e009a533a1a
|
sha256: bcba58d28f8cda607a323240c6d314c2c62b62ebfbb0f2d704ebefef07b52b5f
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.5.4"
|
version: "4.5.6"
|
||||||
firebase_messaging_web:
|
firebase_messaging_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_messaging_web
|
name: firebase_messaging_web
|
||||||
sha256: "5d8446a28339124a2cb4f57a6ca454a3aca7d0c5c0cdfa5707afb192f7c830a7"
|
sha256: "962d09ec9dfa486cbbc218258ad41e8ec7997a2eba46919049496e1cafd960c5"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.5.4"
|
version: "3.5.6"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ dependencies:
|
|||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
firebase_messaging: ^14.6.5
|
firebase_messaging: ^14.6.7
|
||||||
firebase_core: ^2.15.0
|
firebase_core: ^2.15.0
|
||||||
flutter_local_notifications: ^15.1.0+1
|
flutter_local_notifications: ^15.1.0+1
|
||||||
google_maps_flutter: ^2.4.0
|
google_maps_flutter: ^2.4.0
|
||||||
|
|||||||
Reference in New Issue
Block a user