2/9/1
This commit is contained in:
@@ -55,8 +55,8 @@ android {
|
|||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdkVersion 26
|
minSdkVersion 26
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode 16
|
versionCode 17
|
||||||
versionName '1.4.0'
|
versionName '1.4.1'
|
||||||
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,11 +37,11 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>14</string>
|
<string>16</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.34</string>
|
<string>1.36</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class BoxName {
|
|||||||
static const String accountIdStripeConnect = "accountIdStripeConnect";
|
static const String accountIdStripeConnect = "accountIdStripeConnect";
|
||||||
static const String faceDetectTimes = "faceDetectTimes";
|
static const String faceDetectTimes = "faceDetectTimes";
|
||||||
static const String sosPhonePassenger = "sosPhonePassenger";
|
static const String sosPhonePassenger = "sosPhonePassenger";
|
||||||
|
static const String sosPhoneDriver = "sosPhoneDriver";
|
||||||
static const String passengerID = "pasengerID";
|
static const String passengerID = "pasengerID";
|
||||||
static const String phone = "phone";
|
static const String phone = "phone";
|
||||||
static const String phoneDriver = "phoneDriver";
|
static const String phoneDriver = "phoneDriver";
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class AppLink {
|
|||||||
static String getDriverPaymentPoints = "$ride/driverWallet/get.php";
|
static String getDriverPaymentPoints = "$ride/driverWallet/get.php";
|
||||||
static String getDriverpaymentToday = "$ride/payment/get.php";
|
static String getDriverpaymentToday = "$ride/payment/get.php";
|
||||||
static String getAllPaymentFromRide = "$ride/payment/getAllPayment.php";
|
static String getAllPaymentFromRide = "$ride/payment/getAllPayment.php";
|
||||||
|
static String getAllPaymentVisa = "$ride/payment/getAllPaymentVisa.php";
|
||||||
|
|
||||||
//-----------------Passenger NotificationCaptain------------------
|
//-----------------Passenger NotificationCaptain------------------
|
||||||
static String addNotificationPassenger =
|
static String addNotificationPassenger =
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import '../../views/home/Captin/home_captain/home_captin.dart';
|
|||||||
import '../../views/home/profile/promos_passenger_page.dart';
|
import '../../views/home/profile/promos_passenger_page.dart';
|
||||||
import '../../views/home/Captin/orderCaptin/order_request_page.dart';
|
import '../../views/home/Captin/orderCaptin/order_request_page.dart';
|
||||||
import '../home/map_passenger_controller.dart';
|
import '../home/map_passenger_controller.dart';
|
||||||
|
import '../home/payment/captain_wallet_controller.dart';
|
||||||
|
|
||||||
class FirebaseMessagesController extends GetxController {
|
class FirebaseMessagesController extends GetxController {
|
||||||
final fcmToken = FirebaseMessaging.instance;
|
final fcmToken = FirebaseMessaging.instance;
|
||||||
@@ -102,15 +103,15 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
||||||
if (message.notification != null && message.data.isNotEmpty) {
|
// if (message.notification != null && message.data.isNotEmpty) {
|
||||||
fireBaseTitles(message);
|
// fireBaseTitles(message);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// If the app is in the background or terminated, show a system tray message
|
// If the app is in the background or terminated, show a system tray message
|
||||||
RemoteNotification? notification = message.notification;
|
RemoteNotification? notification = message.notification;
|
||||||
AndroidNotification? android = notification?.android;
|
AndroidNotification? android = notification?.android;
|
||||||
// if (notification != null && android != null) {
|
// if (notification != null && android != null) {
|
||||||
if (message.data.isNotEmpty) {
|
if (message.data.isNotEmpty && message.notification != null) {
|
||||||
fireBaseTitles(message);
|
fireBaseTitles(message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -221,6 +222,14 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
'passenger_id': box.read(BoxName.passengerID).toString(),
|
'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||||
'balance': ((-1) * tip).toString()
|
'balance': ((-1) * tip).toString()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await CRUD().post(link: AppLink.addDriversWallet, payload: {
|
||||||
|
'driverID': driverList[0].toString(),
|
||||||
|
'paymentID': '${Get.find<MapPassengerController>().rideId}tip',
|
||||||
|
'amount': (tip * 100).toString(),
|
||||||
|
'paymentMethod': 'visa-tip',
|
||||||
|
});
|
||||||
|
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||||
'You Have Tips',
|
'You Have Tips',
|
||||||
@@ -238,8 +247,10 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
cancel: MyElevatedButton(
|
cancel: MyElevatedButton(
|
||||||
title: 'No,I want'.tr,
|
title: 'No,I want'.tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back();
|
Get.to(() => RateCaptainFromPassenger(), arguments: {
|
||||||
Get.off(() => RateCaptainFromPassenger());
|
'driverId': driverList[0].toString(),
|
||||||
|
'rideId': driverList[1].toString(),
|
||||||
|
});
|
||||||
},
|
},
|
||||||
kolor: AppColor.redColor,
|
kolor: AppColor.redColor,
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class LocationController extends GetxController {
|
|||||||
|
|
||||||
// if (isActive) {
|
// if (isActive) {
|
||||||
if (double.parse(totalPoints) > -100) {
|
if (double.parse(totalPoints) > -100) {
|
||||||
print('total point is ll$totalPoints');
|
print('total point is $totalPoints');
|
||||||
await getLocation();
|
await getLocation();
|
||||||
|
|
||||||
await CRUD().post(link: AppLink.addCarsLocationByPassenger, payload: {
|
await CRUD().post(link: AppLink.addCarsLocationByPassenger, payload: {
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import '../../functions/location_controller.dart';
|
|||||||
|
|
||||||
class MapDriverController extends GetxController {
|
class MapDriverController extends GetxController {
|
||||||
bool isLoading = true;
|
bool isLoading = true;
|
||||||
|
final formKey1 = GlobalKey<FormState>();
|
||||||
|
final sosEmergincyNumberCotroller = TextEditingController();
|
||||||
List data = [];
|
List data = [];
|
||||||
List dataDestination = [];
|
List dataDestination = [];
|
||||||
LatLngBounds? boundsData;
|
LatLngBounds? boundsData;
|
||||||
@@ -478,6 +480,20 @@ class MapDriverController extends GetxController {
|
|||||||
|
|
||||||
polyLines.add(polyline);
|
polyLines.add(polyline);
|
||||||
// rideConfirm = false;
|
// rideConfirm = false;
|
||||||
|
// Define the northeast and southwest coordinates
|
||||||
|
final bounds = response["routes"][0]["bounds"];
|
||||||
|
LatLng northeast =
|
||||||
|
LatLng(bounds['northeast']['lat'], bounds['northeast']['lng']);
|
||||||
|
LatLng southwest =
|
||||||
|
LatLng(bounds['southwest']['lat'], bounds['southwest']['lng']);
|
||||||
|
|
||||||
|
// Create the LatLngBounds object
|
||||||
|
LatLngBounds boundsData =
|
||||||
|
LatLngBounds(northeast: northeast, southwest: southwest);
|
||||||
|
|
||||||
|
// Fit the camera to the bounds
|
||||||
|
var cameraUpdate = CameraUpdate.newLatLngBounds(boundsData, 130);
|
||||||
|
mapController!.animateCamera(cameraUpdate);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -519,6 +535,8 @@ class MapDriverController extends GetxController {
|
|||||||
// updateCameraFromBoundsAfterGetMap(dataBounds);
|
// updateCameraFromBoundsAfterGetMap(dataBounds);
|
||||||
// polyLinesDestination.add(polyline);
|
// polyLinesDestination.add(polyline);
|
||||||
// rideConfirm = false;
|
// rideConfirm = false;
|
||||||
|
// Define the northeast and southwest coordinates
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,10 +10,29 @@ import 'package:ride/main.dart';
|
|||||||
class CaptainWalletController extends GetxController {
|
class CaptainWalletController extends GetxController {
|
||||||
bool isLoading = false;
|
bool isLoading = false;
|
||||||
Map walletDate = {};
|
Map walletDate = {};
|
||||||
|
Map walletDateVisa = {};
|
||||||
Map walletDriverPointsDate = {};
|
Map walletDriverPointsDate = {};
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
String totalAmount = '0';
|
String totalAmount = '0';
|
||||||
|
String totalAmountVisa = '0';
|
||||||
String totalPoints = '0';
|
String totalPoints = '0';
|
||||||
|
final amountFromBudgetController = TextEditingController();
|
||||||
|
|
||||||
|
payFromBudget() async {
|
||||||
|
if (formKey.currentState!.validate()) {
|
||||||
|
var pointFromBudget = int.parse((amountFromBudgetController.text)) * 100;
|
||||||
|
|
||||||
|
await addDriverPayment('fromBudgetToPoints',
|
||||||
|
int.parse((amountFromBudgetController.text)) * -1);
|
||||||
|
Future.delayed(const Duration(seconds: 2));
|
||||||
|
await addDriverWallet('fromBudget', pointFromBudget.toString());
|
||||||
|
update();
|
||||||
|
Get.back();
|
||||||
|
getCaptainWalletFromRide();
|
||||||
|
getCaptainWalletFromBuyPoints();
|
||||||
|
checkAccountCaptainBank();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future getCaptainWalletFromRide() async {
|
Future getCaptainWalletFromRide() async {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
@@ -26,6 +45,16 @@ class CaptainWalletController extends GetxController {
|
|||||||
totalAmount = walletDate['message'][0]['total_amount'].toString() == null
|
totalAmount = walletDate['message'][0]['total_amount'].toString() == null
|
||||||
? '0'
|
? '0'
|
||||||
: walletDate['message'][0]['total_amount'];
|
: walletDate['message'][0]['total_amount'];
|
||||||
|
print(totalAmount);
|
||||||
|
|
||||||
|
var res1 = await CRUD().get(
|
||||||
|
link: AppLink.getAllPaymentVisa,
|
||||||
|
payload: {'driverID': box.read(BoxName.driverID)});
|
||||||
|
walletDateVisa = jsonDecode(res1);
|
||||||
|
totalAmountVisa = walletDateVisa['message'][0]['diff'].toString() == null
|
||||||
|
? '0'
|
||||||
|
: walletDateVisa['message'][0]['diff'];
|
||||||
|
print(totalAmountVisa);
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -60,7 +89,7 @@ class CaptainWalletController extends GetxController {
|
|||||||
});
|
});
|
||||||
var d = jsonDecode(res);
|
var d = jsonDecode(res);
|
||||||
paymentID = d['message'].toString();
|
paymentID = d['message'].toString();
|
||||||
// print(paymentID);
|
print('paymentID $paymentID');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future addDriverWallet(String paymentMethod, point) async {
|
Future addDriverWallet(String paymentMethod, point) async {
|
||||||
|
|||||||
@@ -125,8 +125,8 @@ class PaymentController extends GetxController {
|
|||||||
late String clientSecret;
|
late String clientSecret;
|
||||||
|
|
||||||
Future<void> makePaymentStripe(
|
Future<void> makePaymentStripe(
|
||||||
int amount, String currency, Function method) async {
|
double amount, String currency, Function method) async {
|
||||||
var newAmount = amount * 100;
|
var newAmount = (amount * 100).toInt();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Check if local authentication is available
|
// Check if local authentication is available
|
||||||
@@ -427,7 +427,7 @@ class PaymentController extends GetxController {
|
|||||||
|
|
||||||
final body = {
|
final body = {
|
||||||
'amount': amount, //amount
|
'amount': amount, //amount
|
||||||
'currency': 'aed',
|
'currency': 'usd',
|
||||||
'destination': account //'acct_1OKIjQRgcWrsdyDT' //account id
|
'destination': account //'acct_1OKIjQRgcWrsdyDT' //account id
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class GoogleDriverMap extends StatelessWidget {
|
|||||||
builder: (controller) => GoogleMap(
|
builder: (controller) => GoogleMap(
|
||||||
onMapCreated: controller.onMapCreated,
|
onMapCreated: controller.onMapCreated,
|
||||||
initialCameraPosition: CameraPosition(
|
initialCameraPosition: CameraPosition(
|
||||||
|
// bearing: 45,
|
||||||
target: locationController.myLocation,
|
target: locationController.myLocation,
|
||||||
zoom: 15,
|
zoom: 15,
|
||||||
tilt: 40,
|
tilt: 40,
|
||||||
@@ -31,8 +32,15 @@ class GoogleDriverMap extends StatelessWidget {
|
|||||||
print(position);
|
print(position);
|
||||||
},
|
},
|
||||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||||
|
myLocationEnabled: true,
|
||||||
|
compassEnabled: true,
|
||||||
|
mapType: MapType.normal,
|
||||||
|
trafficEnabled: true,
|
||||||
buildingsEnabled: true,
|
buildingsEnabled: true,
|
||||||
mapToolbarEnabled: true,
|
mapToolbarEnabled: true,
|
||||||
|
zoomControlsEnabled: true,
|
||||||
|
fortyFiveDegreeImageryEnabled: true,
|
||||||
|
zoomGesturesEnabled: true,
|
||||||
polylines: {
|
polylines: {
|
||||||
Polyline(
|
Polyline(
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
@@ -44,7 +52,7 @@ class GoogleDriverMap extends StatelessWidget {
|
|||||||
polylineId: const PolylineId('route1'),
|
polylineId: const PolylineId('route1'),
|
||||||
points: controller.polylineCoordinates,
|
points: controller.polylineCoordinates,
|
||||||
color: AppColor.greenColor,
|
color: AppColor.greenColor,
|
||||||
width: 5,
|
width: 3,
|
||||||
),
|
),
|
||||||
Polyline(
|
Polyline(
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
@@ -55,8 +63,8 @@ class GoogleDriverMap extends StatelessWidget {
|
|||||||
visible: true,
|
visible: true,
|
||||||
polylineId: const PolylineId('route'),
|
polylineId: const PolylineId('route'),
|
||||||
points: controller.polylineCoordinatesDestination,
|
points: controller.polylineCoordinatesDestination,
|
||||||
color: AppColor.redColor,
|
color: AppColor.primaryColor,
|
||||||
width: 5,
|
width: 2,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
markers: {
|
markers: {
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/constant/info.dart';
|
||||||
|
import 'package:ride/controller/functions/location_controller.dart';
|
||||||
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
import 'package:ride/views/widgets/my_textField.dart';
|
||||||
|
|
||||||
import '../../../../constant/box_name.dart';
|
import '../../../../constant/box_name.dart';
|
||||||
import '../../../../constant/colors.dart';
|
import '../../../../constant/colors.dart';
|
||||||
@@ -20,17 +24,44 @@ class SosConnect extends StatelessWidget {
|
|||||||
builder: (mapDriverController) => mapDriverController.isRideStarted
|
builder: (mapDriverController) => mapDriverController.isRideStarted
|
||||||
? Positioned(
|
? Positioned(
|
||||||
left: 5,
|
left: 5,
|
||||||
top: Get.height * .3,
|
bottom: 20,
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: AppStyle.boxDecoration,
|
decoration: AppStyle.boxDecoration,
|
||||||
height: 100,
|
height: 60,
|
||||||
width: 70,
|
width: 100,
|
||||||
child: Column(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
launchCommunication('phone', '911', '');
|
if (box.read(BoxName.sosPhoneDriver) == null) {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Insert Emergincy Number'.tr,
|
||||||
|
content: Form(
|
||||||
|
key: mapDriverController.formKey1,
|
||||||
|
child: MyTextForm(
|
||||||
|
controller: mapDriverController
|
||||||
|
.sosEmergincyNumberCotroller,
|
||||||
|
label: 'Insert Emergincy Number'.tr,
|
||||||
|
hint: 'Insert Emergincy Number'.tr,
|
||||||
|
type: TextInputType.phone),
|
||||||
|
),
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Insert'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
if (mapDriverController
|
||||||
|
.formKey1.currentState!
|
||||||
|
.validate()) {
|
||||||
|
box.write(
|
||||||
|
BoxName.sosPhoneDriver,
|
||||||
|
mapDriverController
|
||||||
|
.sosEmergincyNumberCotroller
|
||||||
|
.text);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
launchCommunication(
|
||||||
|
'phone', box.read(BoxName.sosPhoneDriver), '');
|
||||||
},
|
},
|
||||||
child: const Icon(
|
child: const Icon(
|
||||||
Icons.sos_sharp,
|
Icons.sos_sharp,
|
||||||
@@ -39,10 +70,36 @@ class SosConnect extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
if (box.read(BoxName.sosPhoneDriver) == null) {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Insert Emergincy Number'.tr,
|
||||||
|
content: Form(
|
||||||
|
key: mapDriverController.formKey1,
|
||||||
|
child: MyTextForm(
|
||||||
|
controller: mapDriverController
|
||||||
|
.sosEmergincyNumberCotroller,
|
||||||
|
label: 'Insert Emergincy Number'.tr,
|
||||||
|
hint: 'Insert Emergincy Number'.tr,
|
||||||
|
type: TextInputType.phone),
|
||||||
|
),
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Insert'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
if (mapDriverController
|
||||||
|
.formKey1.currentState!
|
||||||
|
.validate()) {
|
||||||
|
box.write(
|
||||||
|
BoxName.sosPhoneDriver,
|
||||||
|
mapDriverController
|
||||||
|
.sosEmergincyNumberCotroller
|
||||||
|
.text);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
launchCommunication(
|
launchCommunication(
|
||||||
'whatsapp',
|
'whatsapp',
|
||||||
'+962${box.read(BoxName.phoneDriver)}', //todo add number from driver
|
'+962${box.read(BoxName.sosPhoneDriver)}', //todo add number from driver
|
||||||
'${'Hello this is Captain'.tr} ${box.read(BoxName.nameDriver)}');
|
"Hello this is Driver ${box.read(BoxName.nameDriver)}. My current location is: https://www.google.com/maps/place/${Get.find<LocationController>().myLocation.latitude},${Get.find<LocationController>().myLocation.longitude} \nand I have a trip on ${AppInformation.appName} App \nwith Passenger ${mapDriverController.name}");
|
||||||
},
|
},
|
||||||
child: const Icon(
|
child: const Icon(
|
||||||
FontAwesome.whatsapp,
|
FontAwesome.whatsapp,
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ class PassengerWalletDialoge extends StatelessWidget {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (controller.selectedAmount != 0) {
|
if (controller.selectedAmount != 0) {
|
||||||
controller.makePaymentStripe(
|
controller.makePaymentStripe(
|
||||||
controller.selectedAmount as int, 'USD',
|
controller.selectedAmount as double, 'USD',
|
||||||
() {
|
() {
|
||||||
controller.addPassengerWallet();
|
controller.addPassengerWallet();
|
||||||
controller.changePromoSheetDialogue();
|
controller.changePromoSheetDialogue();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class PointsCaptain extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
final Color kolor;
|
final Color kolor;
|
||||||
final String countPoint;
|
final String countPoint;
|
||||||
int pricePoint;
|
double pricePoint;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -31,8 +31,8 @@ class PointsCaptain extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: Get.width * .2,
|
width: Get.width * .22,
|
||||||
height: Get.width * .2,
|
height: Get.width * .15,
|
||||||
margin: const EdgeInsets.all(4),
|
margin: const EdgeInsets.all(4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: kolor,
|
color: kolor,
|
||||||
|
|||||||
@@ -2,12 +2,14 @@ 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/colors.dart';
|
import 'package:ride/constant/colors.dart';
|
||||||
|
import 'package:ride/constant/info.dart';
|
||||||
import 'package:ride/constant/style.dart';
|
import 'package:ride/constant/style.dart';
|
||||||
import 'package:ride/controller/home/map_passenger_controller.dart';
|
import 'package:ride/controller/home/map_passenger_controller.dart';
|
||||||
import 'package:ride/controller/home/payment/captain_wallet_controller.dart';
|
import 'package:ride/controller/home/payment/captain_wallet_controller.dart';
|
||||||
import 'package:ride/controller/payment/payment_controller.dart';
|
import 'package:ride/controller/payment/payment_controller.dart';
|
||||||
import 'package:ride/main.dart';
|
import 'package:ride/main.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
import 'package:ride/views/widgets/my_textField.dart';
|
||||||
import 'package:ride/views/widgets/mycircular.dart';
|
import 'package:ride/views/widgets/mycircular.dart';
|
||||||
|
|
||||||
import '../../widgets/my_scafold.dart';
|
import '../../widgets/my_scafold.dart';
|
||||||
@@ -28,9 +30,9 @@ class WaletCaptain extends StatelessWidget {
|
|||||||
.isLoading
|
.isLoading
|
||||||
? const MyCircularProgressIndicator()
|
? const MyCircularProgressIndicator()
|
||||||
: Padding(
|
: Padding(
|
||||||
padding: const EdgeInsets.all(20),
|
padding: const EdgeInsets.all(10),
|
||||||
child: Column(
|
child: ListView(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(),
|
const SizedBox(),
|
||||||
Container(
|
Container(
|
||||||
@@ -58,19 +60,135 @@ class WaletCaptain extends StatelessWidget {
|
|||||||
? MyElevatedButton(
|
? MyElevatedButton(
|
||||||
title: 'Charge your Account', onPressed: () {})
|
title: 'Charge your Account', onPressed: () {})
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
CardSeferWalletDriver(),
|
||||||
Card(
|
Card(
|
||||||
elevation: 4,
|
elevation: 4,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||||
child: Text(
|
child: Column(
|
||||||
'Total Budget from trips is ${captainWalletController.totalAmount}\$',
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Total Budget from trips is ',
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
width: 2,
|
||||||
|
color: AppColor.redColor)),
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.snackbar(
|
||||||
|
'Total Amount: ${captainWalletController.totalAmount}\$',
|
||||||
|
'This amount for all trip I get from Passengers',
|
||||||
|
duration:
|
||||||
|
const Duration(seconds: 6),
|
||||||
|
backgroundColor:
|
||||||
|
AppColor.deepPurpleAccent,
|
||||||
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(2),
|
||||||
|
child: Text(
|
||||||
|
'${captainWalletController.totalAmount}\$'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Total Budget from trips by\nCredit card is ',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
width: 2,
|
||||||
|
color: AppColor.greenColor)),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(2),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Get.snackbar(
|
||||||
|
'Total Amount: ${captainWalletController.totalAmountVisa}\$',
|
||||||
|
'This amount for all trip I get from Passengers and Collected For me in ${AppInformation.appName} Wallet'
|
||||||
|
.tr,
|
||||||
|
duration:
|
||||||
|
const Duration(seconds: 6),
|
||||||
|
backgroundColor:
|
||||||
|
AppColor.deepPurpleAccent,
|
||||||
|
snackPosition:
|
||||||
|
SnackPosition.BOTTOM,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
'${captainWalletController.totalAmountVisa}\$'),
|
||||||
|
),
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title:
|
||||||
|
'You can buy points from your budget'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Pay from my budget'.tr,
|
||||||
|
content: Form(
|
||||||
|
key: captainWalletController.formKey,
|
||||||
|
child: MyTextForm(
|
||||||
|
controller: captainWalletController
|
||||||
|
.amountFromBudgetController,
|
||||||
|
label: 'insert amount'.tr,
|
||||||
|
hint: 'insert amount'.tr,
|
||||||
|
type: TextInputType.number,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Pay',
|
||||||
|
onPressed: () async {
|
||||||
|
await captainWalletController
|
||||||
|
.payFromBudget();
|
||||||
|
}),
|
||||||
|
cancel: MyElevatedButton(
|
||||||
|
title: 'Cancel'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
decoration: AppStyle.boxDecoration,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'You can buy Points to let you online\nby this list below'
|
'You can buy Points to let you online\nby this list below'
|
||||||
.tr,
|
.tr,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
const Divider(
|
const Divider(
|
||||||
@@ -79,33 +197,40 @@ class WaletCaptain extends StatelessWidget {
|
|||||||
color: AppColor.accentColor,
|
color: AppColor.accentColor,
|
||||||
thickness: 3,
|
thickness: 3,
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
Container(
|
Container(
|
||||||
decoration: AppStyle.boxDecoration,
|
decoration: AppStyle.boxDecoration,
|
||||||
height: Get.height * .120,
|
height: Get.height * .1,
|
||||||
child: Row(
|
child: ListView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
children: [
|
children: [
|
||||||
PointsCaptain(
|
PointsCaptain(
|
||||||
kolor: AppColor.blueColor,
|
kolor: AppColor.blueColor,
|
||||||
pricePoint: 5,
|
pricePoint: 5.6,
|
||||||
countPoint: '500',
|
countPoint: '500',
|
||||||
),
|
),
|
||||||
PointsCaptain(
|
PointsCaptain(
|
||||||
kolor: Colors.green,
|
kolor: Colors.green,
|
||||||
pricePoint: 10,
|
pricePoint: 11.2,
|
||||||
countPoint: '1040',
|
countPoint: '1040',
|
||||||
),
|
),
|
||||||
PointsCaptain(
|
PointsCaptain(
|
||||||
kolor: Colors.amberAccent,
|
kolor: Colors.amberAccent,
|
||||||
pricePoint: 20,
|
pricePoint: 22.4,
|
||||||
countPoint: '2100',
|
countPoint: '2100',
|
||||||
),
|
),
|
||||||
PointsCaptain(
|
PointsCaptain(
|
||||||
kolor: AppColor.yellowColor,
|
kolor: AppColor.yellowColor,
|
||||||
pricePoint: 50,
|
pricePoint: 56,
|
||||||
countPoint: '50400',
|
countPoint: '52000',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
),
|
),
|
||||||
@@ -130,6 +255,23 @@ class WaletCaptain extends StatelessWidget {
|
|||||||
: const SizedBox(
|
: const SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
),
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
MyElevatedButton(
|
||||||
|
kolor: AppColor.blueColor,
|
||||||
|
title: 'Payment History'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
// Get.to(
|
||||||
|
// () => const PaymentHistoryPassengerPage(),
|
||||||
|
// transition: Transition.size);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
// TextButton(
|
// TextButton(
|
||||||
// onPressed: () async {
|
// onPressed: () async {
|
||||||
// PaymentController paymentController =
|
// PaymentController paymentController =
|
||||||
@@ -155,3 +297,61 @@ class WaletCaptain extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CardSeferWalletDriver extends StatelessWidget {
|
||||||
|
const CardSeferWalletDriver({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: Get.width * .85,
|
||||||
|
height: Get.height * .25,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.deepPurpleAccent,
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
colors: [AppColor.blueColor, AppColor.primaryColor]),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${AppInformation.appName} Wallet',
|
||||||
|
style: AppStyle.headTitle
|
||||||
|
.copyWith(color: AppColor.primaryColor),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${Get.find<CaptainWalletController>().totalAmountVisa}\$' ??
|
||||||
|
'0.0 \$',
|
||||||
|
style: AppStyle.headTitle2,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
box.read(BoxName.nameDriver),
|
||||||
|
style: AppStyle.title,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class MyElevatedButton extends StatelessWidget {
|
|||||||
onPressed: onPressed,
|
onPressed: onPressed,
|
||||||
child: Text(
|
child: Text(
|
||||||
title,
|
title,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
style: AppStyle.title.copyWith(color: AppColor.secondaryColor),
|
style: AppStyle.title.copyWith(color: AppColor.secondaryColor),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user