9/20/1
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'package:crypto/crypto.dart';
|
||||||
|
|
||||||
class AppCredintials {
|
class AppCredintials {
|
||||||
static const String basicAuthCredentials = 'hamzaayedphp:malDEV@2101';
|
static const String basicAuthCredentials = 'hamzaayedphp:malDEV@2101';
|
||||||
@@ -14,3 +15,35 @@ class AppCredintials {
|
|||||||
static const String transactionCloude =
|
static const String transactionCloude =
|
||||||
'Authorization:API_EMDJX6BHQ67DBGT6WV:DG2XPU7YEN02M0VJ2F';
|
'Authorization:API_EMDJX6BHQ67DBGT6WV:DG2XPU7YEN02M0VJ2F';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MyClass {
|
||||||
|
static const String mapAPIKEY = 'AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0';
|
||||||
|
static const String additionalText = 'additional text';
|
||||||
|
|
||||||
|
String getBasicAuthCredentials() {
|
||||||
|
return base64Encode(utf8.encode(mapAPIKEY));
|
||||||
|
}
|
||||||
|
|
||||||
|
String removeAddedText(String apiKey, String addedText) {
|
||||||
|
final hashedText = sha256.convert(utf8.encode(addedText)).toString();
|
||||||
|
return apiKey.replaceAll(hashedText, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
String addTextToAPIKey(String apiKey, String textToAdd) {
|
||||||
|
final hashedText = sha256.convert(utf8.encode(textToAdd)).toString();
|
||||||
|
final midIndex = apiKey.length ~/ 2;
|
||||||
|
final firstHalf = apiKey.substring(0, midIndex);
|
||||||
|
final secondHalf = apiKey.substring(midIndex);
|
||||||
|
return '$firstHalf$hashedText$secondHalf';
|
||||||
|
}
|
||||||
|
|
||||||
|
void exampleUsage() {
|
||||||
|
String modifiedAPIKey = addTextToAPIKey(mapAPIKEY, additionalText);
|
||||||
|
print('Modified API Key: $modifiedAPIKey');
|
||||||
|
|
||||||
|
String finalAPIKey = removeAddedText(modifiedAPIKey, additionalText);
|
||||||
|
print('Final API Key: $finalAPIKey');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Modified API Key: AIzaSyCyfwRXTwSTLOFc57cb9e210a21def772cad3cd9ef83247e70bed77da89a64c9a5e91e7f3348dbQSQgN5p7QZgGJVZnEKq0
|
||||||
|
// I/flutter ( 5490): Final API Key: AIzaSyCyfwRXTwSTLOFc57cb9e210a21def772cad3cd9ef83247e70bed77da89a64c9a5e91e7f3348dbQSQgN5p7QZgGJVZnEKq0
|
||||||
@@ -29,23 +29,21 @@ class AppStyle {
|
|||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
||||||
|
|
||||||
static BoxDecoration boxDecoration() {
|
static BoxDecoration boxDecoration = const BoxDecoration(
|
||||||
return const BoxDecoration(
|
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
color: AppColor.secondaryColor,
|
||||||
color: AppColor.secondaryColor,
|
boxShadow: [
|
||||||
boxShadow: [
|
BoxShadow(
|
||||||
BoxShadow(
|
color: AppColor.accentColor,
|
||||||
color: AppColor.accentColor,
|
offset: Offset(-3, -3),
|
||||||
offset: Offset(-3, -3),
|
blurRadius: 0,
|
||||||
blurRadius: 0,
|
spreadRadius: 0,
|
||||||
spreadRadius: 0,
|
blurStyle: BlurStyle.outer),
|
||||||
blurStyle: BlurStyle.outer),
|
BoxShadow(
|
||||||
BoxShadow(
|
color: AppColor.accentColor,
|
||||||
color: AppColor.accentColor,
|
offset: Offset(3, 3),
|
||||||
offset: Offset(3, 3),
|
blurRadius: 0,
|
||||||
blurRadius: 0,
|
spreadRadius: 0,
|
||||||
spreadRadius: 0,
|
blurStyle: BlurStyle.outer)
|
||||||
blurStyle: BlurStyle.outer)
|
]);
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,24 +101,19 @@ class LoginCaptinController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loginByBoxData() async {
|
void loginByBoxData() async {
|
||||||
isloading = true;
|
Get.to(() => const HomeCaptin());
|
||||||
update();
|
|
||||||
Get.offAll(() => const HomeCaptin());
|
|
||||||
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
||||||
'token': box.read(BoxName.tokenDriver).toString(),
|
'token': box.read(BoxName.tokenDriver).toString(),
|
||||||
'captain_id': box.read(BoxName.driverID).toString()
|
'captain_id': box.read(BoxName.driverID).toString()
|
||||||
});
|
});
|
||||||
isloading = false;
|
|
||||||
update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() async {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|
||||||
if (box.read(BoxName.driverID) != null ||
|
// if (box.read(BoxName.driverID).toString() != null) {
|
||||||
box.read(BoxName.driverID) != '') {
|
// loginByBoxData();
|
||||||
loginByBoxData();
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import 'package:get/get.dart';
|
|||||||
import 'package:ride/constant/links.dart';
|
import 'package:ride/constant/links.dart';
|
||||||
import 'package:ride/controller/functions/crud.dart';
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
import 'package:ride/views/auth/login_page.dart';
|
import 'package:ride/views/auth/login_page.dart';
|
||||||
import 'package:ride/views/home/map_page.dart';
|
|
||||||
|
|
||||||
import '../../views/auth/verify_email_page.dart';
|
import '../../views/auth/verify_email_page.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -288,6 +288,12 @@ class FirebasMessagesController extends GetxController {
|
|||||||
var passengerList = message.data['passengerList'];
|
var passengerList = message.data['passengerList'];
|
||||||
print(passengerList);
|
print(passengerList);
|
||||||
print('9999999999999my Apply Ride 999999999999999');
|
print('9999999999999my Apply Ride 999999999999999');
|
||||||
|
MapController mapController = Get.find<MapController>();
|
||||||
|
mapController.rideConfirm = false;
|
||||||
|
update();
|
||||||
|
print('-----------------------------rideConfirm===' +
|
||||||
|
mapController.rideConfirm.toString());
|
||||||
|
|
||||||
var myList = jsonDecode(passengerList) as List<dynamic>;
|
var myList = jsonDecode(passengerList) as List<dynamic>;
|
||||||
driverID = myList[2].toString();
|
driverID = myList[2].toString();
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class ScanIdCard extends GetxController {
|
|||||||
CardDetails? _cardDetails;
|
CardDetails? _cardDetails;
|
||||||
CardScanOptions scanOptions = const CardScanOptions(
|
CardScanOptions scanOptions = const CardScanOptions(
|
||||||
scanCardHolderName: true,
|
scanCardHolderName: true,
|
||||||
// enableDebugLogs: true,
|
enableDebugLogs: true,
|
||||||
validCardsToScanBeforeFinishingScan: 5,
|
validCardsToScanBeforeFinishingScan: 5,
|
||||||
possibleCardHolderNamePositions: [
|
possibleCardHolderNamePositions: [
|
||||||
CardHolderNameScanPosition.aboveCardNumber,
|
CardHolderNameScanPosition.aboveCardNumber,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class TimerController extends GetxController {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
startTimer();
|
// startTimer();//TODO check if it true
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class MapController extends GetxController {
|
|||||||
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
||||||
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
||||||
double height = 150;
|
double height = 150;
|
||||||
|
DateTime currentTime = DateTime.now();
|
||||||
final location = Location();
|
final location = Location();
|
||||||
late LocationData currentLocation;
|
late LocationData currentLocation;
|
||||||
double heightMenu = 0;
|
double heightMenu = 0;
|
||||||
@@ -187,6 +188,7 @@ class MapController extends GetxController {
|
|||||||
delayAndFetchRideStatus(rideId);
|
delayAndFetchRideStatus(rideId);
|
||||||
if (shouldFetch == false) {
|
if (shouldFetch == false) {
|
||||||
startTimer();
|
startTimer();
|
||||||
|
update();
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -204,15 +206,16 @@ class MapController extends GetxController {
|
|||||||
decod['data'].toString() == 'Refused') {
|
decod['data'].toString() == 'Refused') {
|
||||||
shouldFetch = false; // Stop further fetches
|
shouldFetch = false; // Stop further fetches
|
||||||
rideConfirm = false;
|
rideConfirm = false;
|
||||||
|
startTimer();
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
delayAndFetchRideStatus(
|
shouldFetch = true;
|
||||||
rideId); // Repeat the delay and fetch operation
|
update();
|
||||||
|
// delayAndFetchRideStatus(
|
||||||
|
// rideId); // Repeat the delay and fetch operation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
startTimer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void startTimer() async {
|
void startTimer() async {
|
||||||
@@ -240,6 +243,108 @@ class MapController extends GetxController {
|
|||||||
return response['status'];
|
return response['status'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future getCarsLocationByPassenger() async {
|
||||||
|
carsLocationByPassenger = [];
|
||||||
|
LatLngBounds bounds =
|
||||||
|
calculateBounds(mylocation.latitude, mylocation.longitude, 8000);
|
||||||
|
print(
|
||||||
|
'Southwest: ${bounds.southwest.latitude}, ${bounds.southwest.longitude}');
|
||||||
|
print(
|
||||||
|
'Northeast: ${bounds.northeast.latitude}, ${bounds.northeast.longitude}');
|
||||||
|
|
||||||
|
var res =
|
||||||
|
await CRUD().get(link: AppLink.getCarsLocationByPassenger, payload: {
|
||||||
|
'southwestLat': southwest.latitude.toString(),
|
||||||
|
'southwestLon': southwest.longitude.toString(),
|
||||||
|
'northeastLat': northeast.latitude.toString(),
|
||||||
|
'northeastLon': northeast.longitude.toString(),
|
||||||
|
});
|
||||||
|
if (res == 'failure') {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'No Car in your site.Sorry!',
|
||||||
|
middleText: '',
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Back',
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
markerReloadingTimer.cancel();
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
dataCarsLocationByPassenger = jsonDecode(res);
|
||||||
|
// print(dataCarsLocationByPassenger);
|
||||||
|
|
||||||
|
for (var i = 0; i < dataCarsLocationByPassenger['message'].length; i++) {
|
||||||
|
carsLocationByPassenger.add(LatLng(
|
||||||
|
double.parse(dataCarsLocationByPassenger['message'][i]['latitude']),
|
||||||
|
double.parse(
|
||||||
|
dataCarsLocationByPassenger['message'][i]['longitude'])));
|
||||||
|
}
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
update();
|
||||||
|
for (var i = 0; i < driverCarsLocationToPassengerAfterApplied.length; i++) {
|
||||||
|
// }
|
||||||
|
// for (var item in driverCarsLocationToPassengerAfterApplied) {
|
||||||
|
final marker = Marker(
|
||||||
|
infoWindow: InfoWindow(
|
||||||
|
title:
|
||||||
|
'${driverCarsLocationToPassengerAfterApplied[i].latitude} minutes'),
|
||||||
|
markerId: MarkerId(
|
||||||
|
datadriverCarsLocationToPassengerAfterApplied['message'][0]['id']
|
||||||
|
.toString()),
|
||||||
|
position: LatLng(driverCarsLocationToPassengerAfterApplied[i].latitude,
|
||||||
|
driverCarsLocationToPassengerAfterApplied[i].longitude),
|
||||||
|
);
|
||||||
|
markers.add(marker);
|
||||||
|
update();
|
||||||
|
mapController?.animateCamera(CameraUpdate.newLatLng(LatLng(
|
||||||
|
driverCarsLocationToPassengerAfterApplied[i].latitude,
|
||||||
|
driverCarsLocationToPassengerAfterApplied[i].longitude)));
|
||||||
|
update();
|
||||||
|
} // Update the map with the new markers
|
||||||
|
}
|
||||||
|
|
||||||
Future cancelRide() async {
|
Future cancelRide() async {
|
||||||
print(rideConfirm);
|
print(rideConfirm);
|
||||||
|
|
||||||
@@ -398,100 +503,6 @@ class MapController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future getCarsLocationByPassenger() async {
|
|
||||||
carsLocationByPassenger = [];
|
|
||||||
LatLngBounds bounds =
|
|
||||||
calculateBounds(mylocation.latitude, mylocation.longitude, 8000);
|
|
||||||
print(
|
|
||||||
'Southwest: ${bounds.southwest.latitude}, ${bounds.southwest.longitude}');
|
|
||||||
print(
|
|
||||||
'Northeast: ${bounds.northeast.latitude}, ${bounds.northeast.longitude}');
|
|
||||||
|
|
||||||
var res =
|
|
||||||
await CRUD().get(link: AppLink.getCarsLocationByPassenger, payload: {
|
|
||||||
'southwestLat': southwest.latitude.toString(),
|
|
||||||
'southwestLon': southwest.longitude.toString(),
|
|
||||||
'northeastLat': northeast.latitude.toString(),
|
|
||||||
'northeastLon': northeast.longitude.toString(),
|
|
||||||
});
|
|
||||||
if (res == 'failure') {
|
|
||||||
Get.defaultDialog(
|
|
||||||
title: 'No Car in your site.Sorry!',
|
|
||||||
middleText: '',
|
|
||||||
confirm: MyElevatedButton(
|
|
||||||
title: 'Back',
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
markerReloadingTimer.cancel();
|
|
||||||
}));
|
|
||||||
} else {
|
|
||||||
dataCarsLocationByPassenger = jsonDecode(res);
|
|
||||||
// print(dataCarsLocationByPassenger);
|
|
||||||
|
|
||||||
for (var i = 0; i < dataCarsLocationByPassenger['message'].length; i++) {
|
|
||||||
carsLocationByPassenger.add(LatLng(
|
|
||||||
double.parse(dataCarsLocationByPassenger['message'][i]['latitude']),
|
|
||||||
double.parse(
|
|
||||||
dataCarsLocationByPassenger['message'][i]['longitude'])));
|
|
||||||
}
|
|
||||||
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
||||||
@@ -571,7 +582,10 @@ class MapController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String duratioByPassenger = '';
|
String duratioByPassenger = '';
|
||||||
|
late DateTime newTime1 = DateTime.now();
|
||||||
String distanceByPassenger = '';
|
String distanceByPassenger = '';
|
||||||
|
late Duration durationfromDriverToPassenger;
|
||||||
|
|
||||||
void getNearestDriverByPassengerLocation() async {
|
void getNearestDriverByPassengerLocation() async {
|
||||||
if (polylines.isEmpty || data.isEmpty) {
|
if (polylines.isEmpty || data.isEmpty) {
|
||||||
double nearestDistance = double.infinity;
|
double nearestDistance = double.infinity;
|
||||||
@@ -607,6 +621,8 @@ class MapController extends GetxController {
|
|||||||
distanceByPassenger =
|
distanceByPassenger =
|
||||||
data['rows'][0]['elements'][0]['distance']['text'];
|
data['rows'][0]['elements'][0]['distance']['text'];
|
||||||
duration1 = data['rows'][0]['elements'][0]['duration']['value'];
|
duration1 = data['rows'][0]['elements'][0]['duration']['value'];
|
||||||
|
durationfromDriverToPassenger = Duration(seconds: duration1.toInt());
|
||||||
|
newTime1 = currentTime.add(durationfromDriverToPassenger);
|
||||||
duratioByPassenger =
|
duratioByPassenger =
|
||||||
data['rows'][0]['elements'][0]['duration']['text'];
|
data['rows'][0]['elements'][0]['duration']['text'];
|
||||||
|
|
||||||
@@ -771,7 +787,7 @@ class MapController extends GetxController {
|
|||||||
late double cost = 0;
|
late double cost = 0;
|
||||||
late double distance = 0;
|
late double distance = 0;
|
||||||
late double duration = 0;
|
late double duration = 0;
|
||||||
DateTime currentTime = DateTime.now();
|
|
||||||
late Duration durationToAdd;
|
late Duration durationToAdd;
|
||||||
late DateTime newTime = DateTime.now();
|
late DateTime newTime = DateTime.now();
|
||||||
Future bottomSheet() async {
|
Future bottomSheet() async {
|
||||||
|
|||||||
@@ -44,32 +44,33 @@ class CreditCardController extends GetxController {
|
|||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
String? cardNumber = await SecureStorage().readData(BoxName.cardNumber);
|
openPayment();
|
||||||
String? cardHolderName =
|
// String? cardNumber = await SecureStorage().readData(BoxName.cardNumber);
|
||||||
await SecureStorage().readData(BoxName.cardHolderName);
|
// String? cardHolderName =
|
||||||
String? expiryDate = await SecureStorage().readData(BoxName.expiryDate);
|
// await SecureStorage().readData(BoxName.cardHolderName);
|
||||||
String? cvvCode = await SecureStorage().readData(BoxName.cvvCode);
|
// String? expiryDate = await SecureStorage().readData(BoxName.expiryDate);
|
||||||
|
// String? cvvCode = await SecureStorage().readData(BoxName.cvvCode);
|
||||||
|
|
||||||
print('cardNumber: $cardNumber');
|
// print('cardNumber: $cardNumber');
|
||||||
print('cardHolderName: $cardHolderName');
|
// print('cardHolderName: $cardHolderName');
|
||||||
print('expiryDate: $expiryDate');
|
// print('expiryDate: $expiryDate');
|
||||||
print('cvvCode: $cvvCode');
|
// print('cvvCode: $cvvCode');
|
||||||
|
|
||||||
if (cvvCode != null && cvvCode.isNotEmpty) {
|
// if (cvvCode != null && cvvCode.isNotEmpty) {
|
||||||
final maskedCardNumber = DigitObscuringFormatter()
|
// final maskedCardNumber = DigitObscuringFormatter()
|
||||||
.formatEditUpdate(
|
// .formatEditUpdate(
|
||||||
TextEditingValue.empty,
|
// TextEditingValue.empty,
|
||||||
TextEditingValue(text: cardNumber ?? ''),
|
// TextEditingValue(text: cardNumber ?? ''),
|
||||||
)
|
// )
|
||||||
.text;
|
// .text;
|
||||||
|
|
||||||
print('maskedCardNumber: $maskedCardNumber');
|
// print('maskedCardNumber: $maskedCardNumber');
|
||||||
|
|
||||||
cardNumberController.text = maskedCardNumber;
|
// cardNumberController.text = maskedCardNumber;
|
||||||
cardHolderNameController.text = cardHolderName ?? '';
|
// cardHolderNameController.text = cardHolderName ?? '';
|
||||||
expiryDateController.text = expiryDate ?? '';
|
// expiryDateController.text = expiryDate ?? '';
|
||||||
cvvCodeController.text = cvvCode;
|
// cvvCodeController.text = cvvCode;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ class MyApp extends StatelessWidget {
|
|||||||
? const MapPage()
|
? const MapPage()
|
||||||
: box.read(BoxName.emailDriver) == null
|
: box.read(BoxName.emailDriver) == null
|
||||||
? LoginPage()
|
? LoginPage()
|
||||||
: LoginCaptin());
|
: box.read(BoxName.emailDriver) != null
|
||||||
|
? const HomeCaptin()
|
||||||
|
: LoginCaptin());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/constant/credential.dart';
|
||||||
import 'package:ride/constant/style.dart';
|
import 'package:ride/constant/style.dart';
|
||||||
|
|
||||||
import '../../../controller/functions/locaton_controller.dart';
|
import '../../../controller/functions/locaton_controller.dart';
|
||||||
@@ -23,21 +24,33 @@ class HomeCaptin extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
body: [
|
body: [
|
||||||
GetBuilder<LocationController>(
|
GetBuilder<LocationController>(
|
||||||
builder: (locationController) => Padding(
|
builder: (locationController) => Column(
|
||||||
padding: const EdgeInsets.all(8.0),
|
children: [
|
||||||
child: Row(
|
Padding(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
padding: const EdgeInsets.all(8.0),
|
||||||
children: [
|
child: Row(
|
||||||
Text(
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
'${locationController.mylocation}',
|
children: [
|
||||||
style: AppStyle.subtitle,
|
Text(
|
||||||
|
'${locationController.mylocation}',
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${DateTime.now()}',
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Text(
|
),
|
||||||
'${DateTime.now()}',
|
TextButton(
|
||||||
style: AppStyle.subtitle,
|
onPressed: () {
|
||||||
)
|
MyClass().exampleUsage();
|
||||||
],
|
},
|
||||||
),
|
child: Text(
|
||||||
|
"Text Button",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
))
|
))
|
||||||
],
|
],
|
||||||
isleading: false);
|
isleading: false);
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ class MapPage extends StatelessWidget {
|
|||||||
const CashConfirmPageShown(),
|
const CashConfirmPageShown(),
|
||||||
const PaymentMethodPage(),
|
const PaymentMethodPage(),
|
||||||
timerForCancellTripFromPassenger(),
|
timerForCancellTripFromPassenger(),
|
||||||
const DriverTimeArrivePassenger(),
|
const DriverTimeArrivePassengerPage(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
|
||||||
import '../../../constant/style.dart';
|
import '../../../constant/style.dart';
|
||||||
import '../../../controller/home/map_page_controller.dart';
|
import '../../../controller/home/map_page_controller.dart';
|
||||||
import 'hexegone_clipper.dart';
|
import 'hexegone_clipper.dart';
|
||||||
@@ -20,7 +19,7 @@ GetBuilder<MapController> hexagonClipper() {
|
|||||||
duration: const Duration(microseconds: 300),
|
duration: const Duration(microseconds: 300),
|
||||||
height: 250,
|
height: 250,
|
||||||
width: 250,
|
width: 250,
|
||||||
decoration: AppStyle.boxDecoration(),
|
decoration: AppStyle.boxDecoration,
|
||||||
// gradient: const LinearGradient(
|
// gradient: const LinearGradient(
|
||||||
// colors: [AppColor.greenColor, AppColor.secondaryColor],
|
// colors: [AppColor.greenColor, AppColor.secondaryColor],
|
||||||
// begin: Alignment.topLeft,
|
// begin: Alignment.topLeft,
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import 'package:ride/views/home/map_widget.dart/hexegone_clipper.dart';
|
|||||||
import '../../../constant/style.dart';
|
import '../../../constant/style.dart';
|
||||||
import '../../../controller/home/map_page_controller.dart';
|
import '../../../controller/home/map_page_controller.dart';
|
||||||
|
|
||||||
class DriverTimeArrivePassenger extends StatelessWidget {
|
class DriverTimeArrivePassengerPage extends StatelessWidget {
|
||||||
const DriverTimeArrivePassenger({super.key});
|
const DriverTimeArrivePassengerPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -23,15 +23,24 @@ class DriverTimeArrivePassenger extends StatelessWidget {
|
|||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: AppStyle.boxDecoration(),
|
decoration: AppStyle.boxDecoration,
|
||||||
// width: 50,
|
// width: 50,
|
||||||
// height: 50,
|
// height: 50,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.only(
|
padding: const EdgeInsetsDirectional.only(
|
||||||
start: 5, end: 5),
|
start: 5, end: 5),
|
||||||
child: Text(
|
child: Column(
|
||||||
controller.duratioByPassenger.toString(),
|
children: [
|
||||||
style: AppStyle.title,
|
Text(
|
||||||
|
controller.duratioByPassenger.toString() +
|
||||||
|
' to arrive you.'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
controller.newTime1.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
))
|
))
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -32,7 +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: AppStyle.boxDecoration(),
|
decoration: AppStyle.boxDecoration,
|
||||||
transform: Matrix4.translationValues(
|
transform: Matrix4.translationValues(
|
||||||
controller.heightMenu * .1, 1, 1),
|
controller.heightMenu * .1, 1, 1),
|
||||||
curve: Curves.easeOutCubic,
|
curve: Curves.easeOutCubic,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:ride/constant/box_name.dart';
|
import 'package:ride/constant/box_name.dart';
|
||||||
import 'package:ride/controller/functions/secure_storage.dart';
|
import 'package:ride/controller/functions/secure_storage.dart';
|
||||||
import 'package:ride/controller/home/payment/credit_card_Controller.dart';
|
import 'package:ride/controller/home/payment/credit_card_controller.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import '../../../constant/box_name.dart';
|
|||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
import '../../../constant/info.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';
|
||||||
import '../../widgets/elevated_btn.dart';
|
import '../../widgets/elevated_btn.dart';
|
||||||
import '../map_widget.dart/payment_method.page.dart';
|
import '../map_widget.dart/payment_method.page.dart';
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.5"
|
version: "1.0.5"
|
||||||
crypto:
|
crypto:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: crypto
|
name: crypto
|
||||||
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
|
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ dependencies:
|
|||||||
geolocator: ^10.0.0
|
geolocator: ^10.0.0
|
||||||
flutter_paypal: ^0.2.0
|
flutter_paypal: ^0.2.0
|
||||||
flutter_launcher_icons: ^0.13.1
|
flutter_launcher_icons: ^0.13.1
|
||||||
|
crypto: ^3.0.3
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|||||||
Reference in New Issue
Block a user