9/3/1
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
|
|
||||||
|
|
||||||
<application android:label="ride" android:name="${applicationName}" android:icon="@mipmap/ic_launcher">
|
<application android:label="SEFER" android:name="${applicationName}" android:icon="@mipmap/ic_launcher">
|
||||||
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
|
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
|
||||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||||
the Android process has started. This theme is visible to the user
|
the Android process has started. This theme is visible to the user
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>Ride</string>
|
<string>Sefer</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>ride</string>
|
<string>Sefer</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
|
|||||||
@@ -16,4 +16,5 @@ class BoxName {
|
|||||||
static const String cvvCode = "cvvCode";
|
static const String cvvCode = "cvvCode";
|
||||||
static const String passengerWalletDetails = "passengerWalletDetails";
|
static const String passengerWalletDetails = "passengerWalletDetails";
|
||||||
static const String passengerWalletTotal = "passengerWalletTotal";
|
static const String passengerWalletTotal = "passengerWalletTotal";
|
||||||
|
static const String passengerWalletFound = "passengerWalletFound";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:ride/constant/colors.dart';
|
import 'package:ride/constant/colors.dart';
|
||||||
|
import 'package:ride/constant/style.dart';
|
||||||
|
import 'package:ride/controller/functions/launch.dart';
|
||||||
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
import '../../constant/box_name.dart';
|
import '../../constant/box_name.dart';
|
||||||
import '../../constant/credential.dart';
|
import '../../constant/credential.dart';
|
||||||
@@ -84,31 +87,89 @@ class FirebasMessagesController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void getToken() async {
|
Future getToken() async {
|
||||||
await fcmToken.getToken().then((token) {
|
fcmToken.getToken().then((token) {
|
||||||
box.write(BoxName.tokenFCM, token);
|
box.write(BoxName.tokenFCM, token);
|
||||||
print(token);
|
print(token);
|
||||||
});
|
});
|
||||||
|
|
||||||
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
||||||
print(
|
if (message.data.isNotEmpty) {
|
||||||
'onMessage: ${message.notification!.title} ${message.notification!.body}');
|
if (message.notification!.title!.contains('Order')) {
|
||||||
if (Get.currentRoute == '/') {
|
var myListString = message.data['myList'];
|
||||||
// If the app is in the foreground, show a dialog to the user
|
var myList = jsonDecode(myListString) as List<dynamic>;
|
||||||
if (message.notification!.title!.contains('ride')) {
|
Get.defaultDialog(
|
||||||
Get.snackbar('ride', 'message', backgroundColor: AppColor.redColor);
|
title: message.notification!.title.toString(),
|
||||||
}
|
content: Column(
|
||||||
} else {
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
// If the app is in the background or terminated, show a system tray message
|
children: [
|
||||||
RemoteNotification? notification = message.notification;
|
// Text(message.notification!.body.toString()),
|
||||||
AndroidNotification? android = message.notification?.android;
|
Padding(
|
||||||
if (notification != null && android != null) {
|
padding: const EdgeInsets.all(8.0),
|
||||||
print(
|
child: TextButton.icon(
|
||||||
'onMessageOpenedApp: ${notification.title} ${notification.body}');
|
onPressed: () {
|
||||||
if (message.notification!.title!.contains('ride')) {
|
String mapUrl =
|
||||||
Get.snackbar('ride', 'message', backgroundColor: AppColor.redColor);
|
'https://www.google.com/maps/dir/${myList[0]}/${myList[0]}/';
|
||||||
// SendGpsNow().getSiteNotification();
|
print(mapUrl);
|
||||||
}
|
launchUrl1(mapUrl);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.map),
|
||||||
|
label: Text('Rouats of Trip'.tr)),
|
||||||
|
),
|
||||||
|
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
'Tatal From Passenger is '.tr +
|
||||||
|
double.parse(myList[2]).toStringAsFixed(2),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
'Tatal For You is '.tr +
|
||||||
|
double.parse(myList[3]).toStringAsFixed(2),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
'Distance is '.tr + myList[4].toString() + ' Minutes'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
'Duration of Trip is '.tr + myList[5].toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Apply Order'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
//TODO save and request to passenger
|
||||||
|
},
|
||||||
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Refuse Order'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
//TODO save and request to passenger and driver log upto 3 per 1 day
|
||||||
|
},
|
||||||
|
kolor: AppColor.redColor,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -119,8 +180,8 @@ class FirebasMessagesController extends GetxController {
|
|||||||
RemoteNotification? notification = message.notification;
|
RemoteNotification? notification = message.notification;
|
||||||
if (notification != null) {
|
if (notification != null) {
|
||||||
print('onMessageOpenedApp: ${notification.title} ${notification.body}');
|
print('onMessageOpenedApp: ${notification.title} ${notification.body}');
|
||||||
if (message.notification!.title!.contains('ride')) {
|
if (message.notification!.title!.contains('SEFER')) {
|
||||||
Get.snackbar('ride', 'message', backgroundColor: AppColor.redColor);
|
Get.snackbar('SEFER', 'message', backgroundColor: AppColor.redColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -222,4 +283,31 @@ class FirebasMessagesController extends GetxController {
|
|||||||
// print('sendNotification() error: $e');
|
// print('sendNotification() error: $e');
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
void sendNotificationDriverId(String title, body, Strin1, Strin2, Strin3,
|
||||||
|
Strin4, Strin5, Strin6, token) async {
|
||||||
|
http
|
||||||
|
.post(Uri.parse('https://fcm.googleapis.com/fcm/send'),
|
||||||
|
headers: <String, String>{
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': 'key=${AppCredintials.serverAPI}'
|
||||||
|
},
|
||||||
|
body: jsonEncode({
|
||||||
|
'notification': <String, dynamic>{
|
||||||
|
'title': title,
|
||||||
|
'body': body,
|
||||||
|
'sound': 'true'
|
||||||
|
},
|
||||||
|
'data': {
|
||||||
|
'myList': jsonEncode(
|
||||||
|
[Strin1, Strin2, Strin3, Strin4, Strin5, Strin6]),
|
||||||
|
},
|
||||||
|
'priority': 'high',
|
||||||
|
'to': token,
|
||||||
|
}))
|
||||||
|
.whenComplete(() {})
|
||||||
|
.catchError((e) {
|
||||||
|
print('sendNotification() error: $e');
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ class CRUD {
|
|||||||
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// print("--------------" + response.request.toString());
|
print("--------------" + response.request.toString());
|
||||||
// print("--------------" + payload.toString());
|
print("--------------" + payload.toString());
|
||||||
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') {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import 'dart:async';
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:math' show sqrt, pi, cos, sin;
|
import 'dart:math' show sqrt, pi, cos, sin;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:geolocator/geolocator.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';
|
||||||
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
||||||
@@ -10,6 +9,7 @@ import 'package:location/location.dart';
|
|||||||
import 'package:ride/constant/box_name.dart';
|
import 'package:ride/constant/box_name.dart';
|
||||||
import 'package:ride/constant/credential.dart';
|
import 'package:ride/constant/credential.dart';
|
||||||
import 'package:ride/constant/links.dart';
|
import 'package:ride/constant/links.dart';
|
||||||
|
import 'package:ride/controller/firebase/firbase_messge.dart';
|
||||||
import 'package:ride/controller/functions/crud.dart';
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
import 'package:ride/controller/functions/secure_storage.dart';
|
import 'package:ride/controller/functions/secure_storage.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
@@ -115,11 +115,48 @@ class MapController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
changeConfirmRide() {
|
changeConfirmRide() async {
|
||||||
rideConfirm = true;
|
rideConfirm = true;
|
||||||
print('rideConfirm= $rideConfirm');
|
print('rideConfirm= $rideConfirm');
|
||||||
|
|
||||||
//TODO add ride and get ride id and details
|
await CRUD().post(link: AppLink.addRides, payload: {
|
||||||
|
"start_location":
|
||||||
|
'${data[0]["start_location"]['lat']},${data[0]["start_location"]['lng']}',
|
||||||
|
"end_location":
|
||||||
|
'${data[0]["end_location"]['lat']},${data[0]["end_location"]['lng']}',
|
||||||
|
"date": DateTime.now().toString(),
|
||||||
|
"time": DateTime.now().toString(),
|
||||||
|
"endtime": durationToAdd.toString(),
|
||||||
|
"price": totalPassenger.toString(),
|
||||||
|
"passenger_id": box.read(BoxName.pasengerID).toString(),
|
||||||
|
"driver_id": dataCarsLocationByPassenger['message'][0]['id'].toString(),
|
||||||
|
"status": "active",
|
||||||
|
"price_for_driver": totalDriver.toString(),
|
||||||
|
"price_for_passenger": totaME.toString(),
|
||||||
|
"distance": distance.toString()
|
||||||
|
}).then((value) {
|
||||||
|
print(value);
|
||||||
|
List<String> body = [
|
||||||
|
'${data[0]["start_location"]['lat']},${data[0]["start_location"]['lng']}',
|
||||||
|
'${data[0]["end_location"]['lat']},${data[0]["end_location"]['lng']}',
|
||||||
|
totalPassenger.toString(),
|
||||||
|
totalDriver.toString(),
|
||||||
|
duration.toString(),
|
||||||
|
distance.toString(),
|
||||||
|
];
|
||||||
|
FirebasMessagesController().sendNotificationDriverId(
|
||||||
|
'Order',
|
||||||
|
'body',
|
||||||
|
body[0],
|
||||||
|
body[1],
|
||||||
|
body[2],
|
||||||
|
body[3],
|
||||||
|
body[4],
|
||||||
|
body[5],
|
||||||
|
box.read(BoxName.tokenFCM).toString(), //TODO change to Driver
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,7 +406,8 @@ class MapController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void reloadMarkers() async {
|
void reloadMarkers() async {
|
||||||
await getCarsLocationByPassenger();
|
//TODO await getCarsLocationByPassenger();
|
||||||
|
|
||||||
// Clear existing markers
|
// Clear existing markers
|
||||||
markers.clear();
|
markers.clear();
|
||||||
getNearestDriverByPassengerLocation();
|
getNearestDriverByPassengerLocation();
|
||||||
@@ -392,6 +430,7 @@ class MapController extends GetxController {
|
|||||||
|
|
||||||
String duratioByPassenger = '';
|
String duratioByPassenger = '';
|
||||||
void getNearestDriverByPassengerLocation() async {
|
void getNearestDriverByPassengerLocation() async {
|
||||||
|
if (polylines.isEmpty) {
|
||||||
double nearestDistance = double.infinity;
|
double nearestDistance = double.infinity;
|
||||||
for (var i = 0; i < dataCarsLocationByPassenger['message'].length; i++) {
|
for (var i = 0; i < dataCarsLocationByPassenger['message'].length; i++) {
|
||||||
var carLocation = dataCarsLocationByPassenger['message'][i];
|
var carLocation = dataCarsLocationByPassenger['message'][i];
|
||||||
@@ -423,7 +462,8 @@ class MapController extends GetxController {
|
|||||||
// Extract distance and duration from the response and handle accordingly
|
// Extract distance and duration from the response and handle accordingly
|
||||||
int distance1 = data['rows'][0]['elements'][0]['distance']['value'];
|
int distance1 = data['rows'][0]['elements'][0]['distance']['value'];
|
||||||
duration1 = data['rows'][0]['elements'][0]['duration']['value'];
|
duration1 = data['rows'][0]['elements'][0]['duration']['value'];
|
||||||
duratioByPassenger = data['rows'][0]['elements'][0]['duration']['text'];
|
duratioByPassenger =
|
||||||
|
data['rows'][0]['elements'][0]['duration']['text'];
|
||||||
|
|
||||||
if (distance1 < nearestDistance) {
|
if (distance1 < nearestDistance) {
|
||||||
nearestDistance = distance1.toDouble();
|
nearestDistance = distance1.toDouble();
|
||||||
@@ -447,6 +487,7 @@ class MapController extends GetxController {
|
|||||||
// Handle the failure case
|
// Handle the failure case
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
print(nearestCar!.distance);
|
print(nearestCar!.distance);
|
||||||
print(nearestCar!.duration);
|
print(nearestCar!.duration);
|
||||||
print(nearestCar!.latitude);
|
print(nearestCar!.latitude);
|
||||||
@@ -534,6 +575,7 @@ class MapController extends GetxController {
|
|||||||
bool promoTaken = false;
|
bool promoTaken = false;
|
||||||
void applyPromoCodetoPassenger() async {
|
void applyPromoCodetoPassenger() async {
|
||||||
//TAWJIHI
|
//TAWJIHI
|
||||||
|
|
||||||
CRUD().get(link: AppLink.getPassengersPromo, payload: {
|
CRUD().get(link: AppLink.getPassengersPromo, payload: {
|
||||||
'promo_code': promo.text,
|
'promo_code': promo.text,
|
||||||
}).then((value) {
|
}).then((value) {
|
||||||
@@ -736,8 +778,8 @@ class MapController extends GetxController {
|
|||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
await getLocation();
|
await getLocation();
|
||||||
await getCarsLocationByPassenger();
|
// await getCarsLocationByPassenger();
|
||||||
getNearestDriverByPassengerLocation();
|
// getNearestDriverByPassengerLocation();
|
||||||
addCustomPicker();
|
addCustomPicker();
|
||||||
addCustomCarIcon();
|
addCustomCarIcon();
|
||||||
startMarkerReloading();
|
startMarkerReloading();
|
||||||
|
|||||||
@@ -13,30 +13,34 @@ class PaymentController extends GetxController {
|
|||||||
bool isloading = false;
|
bool isloading = false;
|
||||||
bool isWalletCheced = false;
|
bool isWalletCheced = false;
|
||||||
bool isCashCheced = false;
|
bool isCashCheced = false;
|
||||||
|
bool isWalletFound = false;
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
final promo = TextEditingController();
|
final promo = TextEditingController();
|
||||||
double totalPassenger = MapController().totalPassenger;
|
double totalPassenger = MapController().totalPassenger;
|
||||||
|
List<dynamic> totalPassengerWalletDetails = [];
|
||||||
|
String passengerTotalWalletAmount = '';
|
||||||
|
|
||||||
getPassengerWallet() async {
|
getPassengerWallet() async {
|
||||||
isloading = true;
|
isloading = true;
|
||||||
update();
|
update();
|
||||||
if (box.read(BoxName.passengerWalletDetails) == null) {
|
box.write(BoxName.passengerWalletFound, isWalletFound);
|
||||||
|
// totalPassengerWalletDetails = box.read(BoxName.passengerWalletDetails);
|
||||||
|
|
||||||
|
if (totalPassengerWalletDetails == null ||
|
||||||
|
totalPassengerWalletDetails.isEmpty) {
|
||||||
await CRUD().get(link: AppLink.getWalletByPassenger, payload: {
|
await CRUD().get(link: AppLink.getWalletByPassenger, payload: {
|
||||||
'passenger_id': box.read(BoxName.pasengerID)
|
'passenger_id': box.read(BoxName.pasengerID)
|
||||||
}).then((value) {
|
}).then((value) {
|
||||||
final total = jsonDecode(value)['message'];
|
print(value);
|
||||||
|
totalPassengerWalletDetails = jsonDecode(value)['message'];
|
||||||
box.write(BoxName.passengerWalletDetails, total);
|
passengerTotalWalletAmount = totalPassengerWalletDetails[0]['total'];
|
||||||
|
box.write(BoxName.passengerWalletDetails, totalPassengerWalletDetails);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
print('from empty');
|
print(totalPassengerWalletDetails);
|
||||||
print(box.read(BoxName.passengerWalletDetails));
|
|
||||||
} else {
|
|
||||||
box.read(BoxName.passengerWalletDetails);
|
|
||||||
update();
|
|
||||||
print('from full');
|
|
||||||
print(box.read(BoxName.passengerWalletDetails));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onChangedPymentethodWallet(bool? value) {
|
void onChangedPymentethodWallet(bool? value) {
|
||||||
@@ -63,6 +67,7 @@ class PaymentController extends GetxController {
|
|||||||
var firstElement = decod["message"][0];
|
var firstElement = decod["message"][0];
|
||||||
totalPassenger = totalPassenger -
|
totalPassenger = totalPassenger -
|
||||||
(totalPassenger * int.parse(firstElement['amount']));
|
(totalPassenger * int.parse(firstElement['amount']));
|
||||||
|
MapController().promoTaken = true;
|
||||||
update();
|
update();
|
||||||
print(totalPassenger);
|
print(totalPassenger);
|
||||||
}
|
}
|
||||||
@@ -70,8 +75,8 @@ class PaymentController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() async {
|
||||||
getPassengerWallet();
|
await getPassengerWallet();
|
||||||
|
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ void main() async {
|
|||||||
|
|
||||||
await FirebasMessagesController().requestFirebaseMessagingPermission();
|
await FirebasMessagesController().requestFirebaseMessagingPermission();
|
||||||
// await FirebasMessagesController().getNotificationSettings();
|
// await FirebasMessagesController().getNotificationSettings();
|
||||||
FirebasMessagesController().getToken();
|
await FirebasMessagesController().getToken();
|
||||||
await FirebasMessagesController().getTokens();
|
await FirebasMessagesController().getTokens();
|
||||||
LocationPermissions().locationPermissions();
|
LocationPermissions().locationPermissions();
|
||||||
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
||||||
|
|||||||
@@ -129,7 +129,8 @@ class MapPage extends StatelessWidget {
|
|||||||
// Circle(
|
// Circle(
|
||||||
// circleId: const CircleId('kk'),
|
// circleId: const CircleId('kk'),
|
||||||
// center: controller.mylocation,
|
// center: controller.mylocation,
|
||||||
// radius: 2000)
|
// radius: 60,
|
||||||
|
// fillColor: AppColor.primaryColor,)
|
||||||
// },
|
// },
|
||||||
mapType:
|
mapType:
|
||||||
controller.mapType ? MapType.satellite : MapType.normal,
|
controller.mapType ? MapType.satellite : MapType.normal,
|
||||||
|
|||||||
@@ -233,19 +233,18 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
|||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.defaultDialog(
|
Get
|
||||||
title: 'Add Promo'.tr,
|
.defaultDialog(
|
||||||
content: Column(
|
title: 'Add Promo'
|
||||||
|
.tr,
|
||||||
|
content:
|
||||||
|
Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width:
|
width: Get.width * .7,
|
||||||
Get.width * .7,
|
child: TextFormField(
|
||||||
child:
|
controller: controller.promo,
|
||||||
TextFormField(
|
decoration: InputDecoration(
|
||||||
controller:
|
|
||||||
controller.promo,
|
|
||||||
decoration:
|
|
||||||
InputDecoration(
|
|
||||||
labelText: 'Promo Code'.tr,
|
labelText: 'Promo Code'.tr,
|
||||||
hintText: 'Enter promo code'.tr,
|
hintText: 'Enter promo code'.tr,
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
@@ -278,12 +277,14 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title:
|
title: 'Add Promo'.tr,
|
||||||
'Add Promo'.tr,
|
onPressed: () async {
|
||||||
onPressed:
|
if (controller.promoTaken == false) {
|
||||||
() async {
|
|
||||||
controller.applyPromoCodetoPassenger();
|
controller.applyPromoCodetoPassenger();
|
||||||
Get.back();
|
Get.back();
|
||||||
|
} else {
|
||||||
|
Get.defaultDialog(title: 'You have Promo ?.'.tr);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -2,11 +2,8 @@ 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/constant/style.dart';
|
import 'package:ride/constant/style.dart';
|
||||||
import 'package:ride/controller/functions/secure_storage.dart';
|
|
||||||
import 'package:ride/controller/home/payment/payment_controller.dart';
|
import 'package:ride/controller/home/payment/payment_controller.dart';
|
||||||
import 'package:ride/views/widgets/circle_container.dart';
|
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
import 'package:ride/views/widgets/mycircular.dart';
|
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
import '../../../controller/home/map_page_controller.dart';
|
import '../../../controller/home/map_page_controller.dart';
|
||||||
@@ -72,7 +69,7 @@ class CashConfirmPageShown extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
// '${'Your Wallet balance is '.tr}JD ',
|
// '${'Your Wallet balance is '.tr}JD ',
|
||||||
'${'Your Wallet balance is '.tr}JD ${box.read(BoxName.passengerWalletDetails)[0]['total'].toString()}',
|
'${'Your Wallet balance is '.tr}JD ${controller.passengerTotalWalletAmount.toString()}',
|
||||||
style: AppStyle.subtitle,
|
style: AppStyle.subtitle,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -6,18 +6,19 @@ import '../../constant/colors.dart';
|
|||||||
class MyElevatedButton extends StatelessWidget {
|
class MyElevatedButton extends StatelessWidget {
|
||||||
final String title;
|
final String title;
|
||||||
final VoidCallback onPressed;
|
final VoidCallback onPressed;
|
||||||
|
final Color kolor;
|
||||||
const MyElevatedButton({
|
const MyElevatedButton({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.title,
|
required this.title,
|
||||||
required this.onPressed,
|
required this.onPressed,
|
||||||
|
this.kolor = AppColor.primaryColor,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ElevatedButton(
|
return ElevatedButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor: MaterialStateProperty.all(AppColor.primaryColor),
|
backgroundColor: MaterialStateProperty.all(kolor),
|
||||||
),
|
),
|
||||||
onPressed: onPressed,
|
onPressed: onPressed,
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
Reference in New Issue
Block a user