9/17/1
This commit is contained in:
@@ -4,6 +4,8 @@ class AppColor {
|
|||||||
static const Color primaryColor = Colors.black;
|
static const Color primaryColor = Colors.black;
|
||||||
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(0xFFEA4335); // Google Red
|
||||||
static const Color greenColor = Color.fromARGB(255, 43, 225, 43);
|
static const Color greenColor = Color(0xFF34A853); // Google Green
|
||||||
|
static const Color blueColor = Color(0xFF4285F4); // Google Blue
|
||||||
|
static const Color yellowColor = Color(0xFFFBBC05); // Google Yellow
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Fleek {
|
class AppInfo {
|
||||||
static const String companyName = 'Fleek-tech';
|
static const String companyName = 'Mobile-App';
|
||||||
|
static const String appName = 'SEFER';
|
||||||
static const String phoneNumber = '962798583052';
|
static const String phoneNumber = '962798583052';
|
||||||
static const String linkedInProfile =
|
static const String linkedInProfile =
|
||||||
'https://www.linkedin.com/in/hamza-ayed/';
|
'https://www.linkedin.com/in/hamza-ayed/';
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ class AppLink {
|
|||||||
//==================certifcate==========
|
//==================certifcate==========
|
||||||
static const String location = '$server/ride/location';
|
static const String location = '$server/ride/location';
|
||||||
static const String getCarsLocationByPassenger = "$location/get.php";
|
static const String getCarsLocationByPassenger = "$location/get.php";
|
||||||
|
static const String getDriverCarsLocationToPassengerAfterApplied =
|
||||||
|
"$location/getDriverCarsLocationToPassengerAfterApplied.php";
|
||||||
static const String addCarsLocationByPassenger = "$location/add.php";
|
static const String addCarsLocationByPassenger = "$location/add.php";
|
||||||
static const String deleteCarsLocationByPassenger = "$location/delete.php";
|
static const String deleteCarsLocationByPassenger = "$location/delete.php";
|
||||||
static const String updateCarsLocationByPassenger = "$location/update.php";
|
static const String updateCarsLocationByPassenger = "$location/update.php";
|
||||||
|
|||||||
@@ -28,4 +28,24 @@ class AppStyle {
|
|||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
||||||
|
|
||||||
|
static BoxDecoration boxDecoration() {
|
||||||
|
return const BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: AppColor.accentColor,
|
||||||
|
offset: Offset(-3, -3),
|
||||||
|
blurRadius: 0,
|
||||||
|
spreadRadius: 0,
|
||||||
|
blurStyle: BlurStyle.outer),
|
||||||
|
BoxShadow(
|
||||||
|
color: AppColor.accentColor,
|
||||||
|
offset: Offset(3, 3),
|
||||||
|
blurRadius: 0,
|
||||||
|
spreadRadius: 0,
|
||||||
|
blurStyle: BlurStyle.outer)
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,10 +282,76 @@ class FirebasMessagesController extends GetxController {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
|
}
|
||||||
|
} else if (message.notification!.title!.contains('Apply Ride')) {
|
||||||
|
// MapController().rideConfirm = true;
|
||||||
|
var passengerList = message.data['passengerList'];
|
||||||
|
print(passengerList);
|
||||||
|
print('9999999999999my Apply Ride 999999999999999');
|
||||||
|
var myList = jsonDecode(passengerList) as List<dynamic>;
|
||||||
|
driverID = myList[2].toString();
|
||||||
|
Get.snackbar(
|
||||||
|
'Captin Applied the Ride for You'.tr,
|
||||||
|
'message',
|
||||||
|
colorText: AppColor.greenColor,
|
||||||
|
duration: const Duration(seconds: 11),
|
||||||
|
instantInit: true,
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
titleText: Text(
|
||||||
|
'Applied'.tr,
|
||||||
|
style: const TextStyle(color: AppColor.redColor),
|
||||||
|
),
|
||||||
|
messageText: Text(
|
||||||
|
'Captin Applied the Ride for You'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
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,
|
||||||
|
);
|
||||||
} else if (message.notification!.title!.contains('Promo')) {
|
} else if (message.notification!.title!.contains('Promo')) {
|
||||||
Get.to(const PromosPassengerPage());
|
Get.to(const PromosPassengerPage());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class CRUD {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
// print(jsonData);
|
print(jsonData);
|
||||||
return response.body;
|
return response.body;
|
||||||
}
|
}
|
||||||
return jsonData['status'];
|
return jsonData['status'];
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class MapController extends GetxController {
|
|||||||
LatLng mydestination = const LatLng(32.115295, 36.064773);
|
LatLng mydestination = const LatLng(32.115295, 36.064773);
|
||||||
final List<LatLng> polylineCoordinates = [];
|
final List<LatLng> polylineCoordinates = [];
|
||||||
List<LatLng> carsLocationByPassenger = [];
|
List<LatLng> carsLocationByPassenger = [];
|
||||||
|
List<LatLng> driverCarsLocationToPassengerAfterApplied = [];
|
||||||
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
||||||
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
||||||
double height = 150;
|
double height = 150;
|
||||||
@@ -57,6 +58,7 @@ class MapController extends GetxController {
|
|||||||
late LatLng northeast;
|
late LatLng northeast;
|
||||||
List<CarLocationModel> carLocations = <CarLocationModel>[];
|
List<CarLocationModel> carLocations = <CarLocationModel>[];
|
||||||
var dataCarsLocationByPassenger;
|
var dataCarsLocationByPassenger;
|
||||||
|
var datadriverCarsLocationToPassengerAfterApplied;
|
||||||
CarLocation? nearestCar;
|
CarLocation? nearestCar;
|
||||||
late Timer markerReloadingTimer;
|
late Timer markerReloadingTimer;
|
||||||
bool shouldFetch = true; // Flag to determine if fetch should be executed
|
bool shouldFetch = true; // Flag to determine if fetch should be executed
|
||||||
@@ -226,7 +228,7 @@ class MapController extends GetxController {
|
|||||||
|
|
||||||
void timerEnded() async {
|
void timerEnded() async {
|
||||||
print('Timer ended');
|
print('Timer ended');
|
||||||
// refuseOrder();
|
runEvery50SecondsUntilConditionMet();
|
||||||
isCancelRidePageShown = false;
|
isCancelRidePageShown = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -437,6 +439,59 @@ class MapController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future getDriverCarsLocationToPassengerAfterApplied() async {
|
||||||
|
driverCarsLocationToPassengerAfterApplied = [];
|
||||||
|
|
||||||
|
var res = await CRUD().get(
|
||||||
|
link: AppLink.getDriverCarsLocationToPassengerAfterApplied,
|
||||||
|
payload: {
|
||||||
|
'driver_id': dataCarsLocationByPassenger['message'][0]['driver_id']
|
||||||
|
});
|
||||||
|
|
||||||
|
datadriverCarsLocationToPassengerAfterApplied = jsonDecode(res);
|
||||||
|
|
||||||
|
driverCarsLocationToPassengerAfterApplied.add(LatLng(
|
||||||
|
double.parse(datadriverCarsLocationToPassengerAfterApplied['message'][0]
|
||||||
|
['latitude']),
|
||||||
|
double.parse(datadriverCarsLocationToPassengerAfterApplied['message'][0]
|
||||||
|
['longitude'])));
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future runEvery50SecondsUntilConditionMet() async {
|
||||||
|
// Calculate the duration of the trip in minutes.
|
||||||
|
double tripDurationInMinutes = duration1 / 60;
|
||||||
|
int loopCount = tripDurationInMinutes.ceil();
|
||||||
|
// If the trip duration is less than or equal to 50 minutes, then break the loop.
|
||||||
|
for (var i = 0; i < loopCount; i++) {
|
||||||
|
// Wait for 50 seconds.
|
||||||
|
await Future.delayed(const Duration(
|
||||||
|
seconds:
|
||||||
|
50)); // Run the `getDriverCarsLocationToPassengerAfterApplied()` function.
|
||||||
|
await getDriverCarsLocationToPassengerAfterApplied();
|
||||||
|
reloadMarkerDriverCarsLocationToPassengerAfterApplied();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void reloadMarkerDriverCarsLocationToPassengerAfterApplied() {
|
||||||
|
// Clear existing markers
|
||||||
|
markers.clear();
|
||||||
|
|
||||||
|
for (var item in driverCarsLocationToPassengerAfterApplied) {
|
||||||
|
final marker = Marker(
|
||||||
|
infoWindow: InfoWindow(title: '${item.latitude} minutes'),
|
||||||
|
markerId: MarkerId(item.toString()),
|
||||||
|
position: LatLng(item.latitude, item.longitude),
|
||||||
|
);
|
||||||
|
markers.add(marker);
|
||||||
|
update();
|
||||||
|
mapController?.animateCamera(
|
||||||
|
CameraUpdate.newLatLng(LatLng(item.latitude, item.longitude)));
|
||||||
|
update();
|
||||||
|
} // Update the map with the new markers
|
||||||
|
}
|
||||||
|
|
||||||
LatLngBounds calculateBounds(
|
LatLngBounds calculateBounds(
|
||||||
double centerLat, double centerLng, double radius) {
|
double centerLat, double centerLng, double radius) {
|
||||||
// double radius = 4000; // 10 km in meters
|
// double radius = 4000; // 10 km in meters
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class PaymentController extends GetxController {
|
|||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
final promo = TextEditingController();
|
final promo = TextEditingController();
|
||||||
double totalPassenger = MapController().totalPassenger;
|
double totalPassenger = MapController().totalPassenger;
|
||||||
int? selectedAmount;
|
int? selectedAmount = 0;
|
||||||
List<dynamic> totalPassengerWalletDetails = [];
|
List<dynamic> totalPassengerWalletDetails = [];
|
||||||
String passengerTotalWalletAmount = '';
|
String passengerTotalWalletAmount = '';
|
||||||
void updateSelectedAmount(int value) {
|
void updateSelectedAmount(int value) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:get_storage/get_storage.dart';
|
import 'package:get_storage/get_storage.dart';
|
||||||
|
import 'package:ride/constant/info.dart';
|
||||||
import 'package:ride/views/auth/captin/login_captin.dart';
|
import 'package:ride/views/auth/captin/login_captin.dart';
|
||||||
import 'package:ride/views/auth/login_page.dart';
|
import 'package:ride/views/auth/login_page.dart';
|
||||||
import 'package:ride/views/home/Captin/home_captin.dart';
|
import 'package:ride/views/home/Captin/home_captin.dart';
|
||||||
@@ -42,7 +43,7 @@ void main() async {
|
|||||||
await FirebasMessagesController().requestFirebaseMessagingPermission();
|
await FirebasMessagesController().requestFirebaseMessagingPermission();
|
||||||
// await FirebasMessagesController().getNotificationSettings();
|
// await FirebasMessagesController().getNotificationSettings();
|
||||||
await FirebasMessagesController().getToken();
|
await FirebasMessagesController().getToken();
|
||||||
await FirebasMessagesController().getTokens();
|
// await FirebasMessagesController().getTokens();
|
||||||
LocationPermissions().locationPermissions();
|
LocationPermissions().locationPermissions();
|
||||||
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
||||||
// if (box.read(BoxName.driverID) != null) {
|
// if (box.read(BoxName.driverID) != null) {
|
||||||
@@ -61,7 +62,7 @@ class MyApp extends StatelessWidget {
|
|||||||
LocaleController controller = Get.put(LocaleController());
|
LocaleController controller = Get.put(LocaleController());
|
||||||
|
|
||||||
return GetMaterialApp(
|
return GetMaterialApp(
|
||||||
title: 'Sefer',
|
title: AppInfo.appName,
|
||||||
translations: MyTranslation(),
|
translations: MyTranslation(),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
locale: controller.language,
|
locale: controller.language,
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ 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/driver_card_from_passenger.dart';
|
||||||
|
import 'map_widget.dart/driver_time_arrive_passenger.dart';
|
||||||
import 'map_widget.dart/left_main_menu_icons.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';
|
||||||
@@ -285,6 +286,7 @@ class MapPage extends StatelessWidget {
|
|||||||
const CashConfirmPageShown(),
|
const CashConfirmPageShown(),
|
||||||
const PaymentMethodPage(),
|
const PaymentMethodPage(),
|
||||||
timerForCancellTripFromPassenger(),
|
timerForCancellTripFromPassenger(),
|
||||||
|
const DriverTimeArrivePassenger(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -20,35 +20,15 @@ GetBuilder<MapController> hexagonClipper() {
|
|||||||
duration: const Duration(microseconds: 300),
|
duration: const Duration(microseconds: 300),
|
||||||
height: 250,
|
height: 250,
|
||||||
width: 250,
|
width: 250,
|
||||||
decoration: BoxDecoration(
|
decoration: AppStyle.boxDecoration(),
|
||||||
boxShadow: [
|
// gradient: const LinearGradient(
|
||||||
BoxShadow(
|
// colors: [AppColor.greenColor, AppColor.secondaryColor],
|
||||||
color: AppColor.primaryColor.withOpacity(0.25),
|
// begin: Alignment.topLeft,
|
||||||
blurRadius: 4,
|
// end: Alignment.bottomCenter,
|
||||||
spreadRadius: 2,
|
// ),
|
||||||
offset: const Offset(0, 4),
|
// border: Border.all(),
|
||||||
),
|
// color: AppColor.secondaryColor,
|
||||||
BoxShadow(
|
// borderRadius: BorderRadius.circular(15)),
|
||||||
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(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/views/home/map_widget.dart/hexegone_clipper.dart';
|
||||||
|
|
||||||
|
import '../../../constant/style.dart';
|
||||||
|
import '../../../controller/home/map_page_controller.dart';
|
||||||
|
|
||||||
|
class DriverTimeArrivePassenger extends StatelessWidget {
|
||||||
|
const DriverTimeArrivePassenger({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<MapController>(
|
||||||
|
builder: (controller) {
|
||||||
|
return controller.remainingTime == 0
|
||||||
|
? Positioned.directional(
|
||||||
|
bottom: Get.height * .35,
|
||||||
|
end: Get.width * .05,
|
||||||
|
textDirection: Get.locale!.languageCode == 'ar'
|
||||||
|
? TextDirection.rtl
|
||||||
|
: TextDirection.ltr,
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
decoration: AppStyle.boxDecoration(),
|
||||||
|
// width: 50,
|
||||||
|
// height: 50,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.only(
|
||||||
|
start: 5, end: 5),
|
||||||
|
child: Text(
|
||||||
|
controller.duratioByPassenger.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,3 +34,19 @@ class HexagonClipper extends CustomClipper<Path> {
|
|||||||
@override
|
@override
|
||||||
bool shouldReclip(HexagonClipper oldClipper) => false;
|
bool shouldReclip(HexagonClipper oldClipper) => false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ArrowClipper extends CustomClipper<Path> {
|
||||||
|
@override
|
||||||
|
Path getClip(Size size) {
|
||||||
|
final path = Path();
|
||||||
|
path.moveTo(0, size.height / 2);
|
||||||
|
path.lineTo(size.width / 2, 0);
|
||||||
|
path.lineTo(size.width, size.height / 2);
|
||||||
|
path.lineTo(size.width / 2, size.height);
|
||||||
|
path.close();
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool shouldReclip(ArrowClipper oldClipper) => false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -32,23 +32,7 @@ class MapMenuWidget extends StatelessWidget {
|
|||||||
opacity: 1, // Adjust the opacity value as needed
|
opacity: 1, // Adjust the opacity value as needed
|
||||||
child: AnimatedContainer(
|
child: AnimatedContainer(
|
||||||
width: Get.width * .6,
|
width: Get.width * .6,
|
||||||
decoration: const BoxDecoration(
|
decoration: AppStyle.boxDecoration(),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
|
||||||
color: AppColor.secondaryColor,
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: AppColor.accentColor,
|
|
||||||
offset: Offset(-3, -3),
|
|
||||||
blurRadius: 0,
|
|
||||||
spreadRadius: 0,
|
|
||||||
blurStyle: BlurStyle.outer),
|
|
||||||
BoxShadow(
|
|
||||||
color: AppColor.accentColor,
|
|
||||||
offset: Offset(3, 3),
|
|
||||||
blurRadius: 0,
|
|
||||||
spreadRadius: 0,
|
|
||||||
blurStyle: BlurStyle.outer)
|
|
||||||
]),
|
|
||||||
transform: Matrix4.translationValues(
|
transform: Matrix4.translationValues(
|
||||||
controller.heightMenu * .1, 1, 1),
|
controller.heightMenu * .1, 1, 1),
|
||||||
curve: Curves.easeOutCubic,
|
curve: Curves.easeOutCubic,
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ GetBuilder<MapController> timerForCancellTripFromPassenger() {
|
|||||||
final isNearEnd =
|
final isNearEnd =
|
||||||
controller.remainingTime <= 5; // Define a threshold for "near end"
|
controller.remainingTime <= 5; // Define a threshold for "near end"
|
||||||
|
|
||||||
return controller.shouldFetch == false
|
return controller.remainingTime > 0 && controller.remainingTime != 25
|
||||||
? Positioned(
|
? Positioned(
|
||||||
bottom: Get.height * .3,
|
bottom: Get.height * .35,
|
||||||
left: Get.width * .05,
|
left: Get.width * .05,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
|
|||||||
@@ -4,11 +4,13 @@ import 'package:get/get.dart';
|
|||||||
import 'package:ride/constant/links.dart';
|
import 'package:ride/constant/links.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/toast.dart';
|
||||||
import 'package:ride/controller/payment/payment_controller.dart';
|
import 'package:ride/controller/payment/payment_controller.dart';
|
||||||
import 'package:ride/views/widgets/my_scafold.dart';
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
import 'package:flutter_paypal/flutter_paypal.dart';
|
import 'package:flutter_paypal/flutter_paypal.dart';
|
||||||
import '../../../constant/box_name.dart';
|
import '../../../constant/box_name.dart';
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
|
import '../../../constant/info.dart';
|
||||||
import '../../../controller/functions/secure_storage.dart';
|
import '../../../controller/functions/secure_storage.dart';
|
||||||
import '../../../controller/home/payment/credit_card_Controller.dart';
|
import '../../../controller/home/payment/credit_card_Controller.dart';
|
||||||
import '../../../main.dart';
|
import '../../../main.dart';
|
||||||
@@ -57,8 +59,15 @@ class PassengerWallet extends StatelessWidget {
|
|||||||
]),
|
]),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
child: Text(
|
child:
|
||||||
'You Have ${box.read(BoxName.passengerWalletTotal).toString()} JD in SEFER Wallet',
|
box.read(BoxName.passengerWalletTotal) == null
|
||||||
|
? Text(
|
||||||
|
'You Dont Have Any amount in ${AppInfo.appName} Wallet!'
|
||||||
|
.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
)
|
||||||
|
: Text(
|
||||||
|
'You Have ${box.read(BoxName.passengerWalletTotal).toString()} JD in ${AppInfo.appName} Wallet',
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -306,6 +315,9 @@ class PassengerWallet extends StatelessWidget {
|
|||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title: 'Pay with Your PayPal',
|
title: 'Pay with Your PayPal',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
if (controller.selectedAmount != 0) {
|
||||||
|
print(controller.selectedAmount);
|
||||||
|
controller.changePromoSheetDialogue();
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (BuildContext context) =>
|
builder: (BuildContext context) =>
|
||||||
@@ -342,7 +354,8 @@ class PassengerWallet extends StatelessWidget {
|
|||||||
"item_list": {
|
"item_list": {
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"name": "Sefer Wallet ",
|
"name":
|
||||||
|
"${AppInfo.appName} Wallet ",
|
||||||
"quantity": 1,
|
"quantity": 1,
|
||||||
"price":
|
"price":
|
||||||
'${controller.selectedAmount}',
|
'${controller.selectedAmount}',
|
||||||
@@ -353,7 +366,7 @@ class PassengerWallet extends StatelessWidget {
|
|||||||
// shipping address is not required though
|
// shipping address is not required though
|
||||||
"shipping_address": const {
|
"shipping_address": const {
|
||||||
"recipient_name":
|
"recipient_name":
|
||||||
"SEFER Wallet",
|
"${AppInfo.appName} Wallet",
|
||||||
"line1": "Shafa Badran",
|
"line1": "Shafa Badran",
|
||||||
"line2": "",
|
"line2": "",
|
||||||
"city": "Amman",
|
"city": "Amman",
|
||||||
@@ -374,8 +387,8 @@ class PassengerWallet extends StatelessWidget {
|
|||||||
.addPassengersWallet,
|
.addPassengersWallet,
|
||||||
payload: {
|
payload: {
|
||||||
'passenger_id': box
|
'passenger_id': box
|
||||||
.read(
|
.read(BoxName
|
||||||
BoxName.pasengerID)
|
.pasengerID)
|
||||||
.toString(),
|
.toString(),
|
||||||
'balance': controller
|
'balance': controller
|
||||||
.selectedAmount
|
.selectedAmount
|
||||||
@@ -388,12 +401,26 @@ class PassengerWallet extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
print("onError: $error");
|
print("onError: $error");
|
||||||
|
Toast.show(
|
||||||
|
context,
|
||||||
|
' $error'.tr,
|
||||||
|
AppColor.redColor);
|
||||||
},
|
},
|
||||||
onCancel: (params) {
|
onCancel: (params) {
|
||||||
print('cancelled: $params');
|
print('cancelled: $params');
|
||||||
|
Toast.show(
|
||||||
|
context,
|
||||||
|
'Pyament Cancelled .'.tr,
|
||||||
|
AppColor.yellowColor);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
Toast.show(
|
||||||
|
context,
|
||||||
|
'You will choose one of above !'.tr,
|
||||||
|
AppColor.redColor);
|
||||||
|
}
|
||||||
// controller.changePromoSheetDialogue();
|
// controller.changePromoSheetDialogue();
|
||||||
// Get.to(() {
|
// Get.to(() {
|
||||||
// UsePaypal(
|
// UsePaypal(
|
||||||
|
|||||||
@@ -197,8 +197,21 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title: 'Refuse Order'.tr,
|
title: 'Refuse Order'.tr,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
List<String> bodyToPassenger = [
|
||||||
|
box.read(BoxName.driverID).toString(),
|
||||||
|
box.read(BoxName.nameDriver).toString(),
|
||||||
|
box.read(BoxName.tokenDriver).toString(),
|
||||||
|
];
|
||||||
timerController.refuseOrder(
|
timerController.refuseOrder(
|
||||||
myList[6].toString(), body.toString());
|
myList[6].toString(), body.toString());
|
||||||
|
FirebasMessagesController()
|
||||||
|
.sendNotificanToPassengerToken(
|
||||||
|
'Refused Ride',
|
||||||
|
arguments['DriverList'][9].toString(),
|
||||||
|
arguments['DriverList'][9].toString(),
|
||||||
|
// box.read(BoxName.tokenDriver).toString(),
|
||||||
|
bodyToPassenger,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
kolor: AppColor.redColor,
|
kolor: AppColor.redColor,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user