5/29/3
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/colors.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
@@ -20,14 +21,17 @@ class HelpCaptain extends StatelessWidget {
|
||||
body: [
|
||||
Column(
|
||||
children: [
|
||||
Card(
|
||||
color: AppColor.yellowColor,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'If you need any help or have question this is right site to do that and your welcome'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'If you need any help or have question this is right site to do that and your welcome'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -80,70 +84,84 @@ class HelpCaptain extends StatelessWidget {
|
||||
),
|
||||
)),
|
||||
GetBuilder<HelpController>(
|
||||
builder: (helpController) => Container(
|
||||
height: 400,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: ListView.builder(
|
||||
itemCount: helpController.helpQuestionDate['message'] !=
|
||||
null
|
||||
? helpController.helpQuestionDate['message'].length
|
||||
: 0,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
// if (helpController.helpQuestionDate['message'] ==
|
||||
// null) {
|
||||
// return const CircularProgressIndicator();
|
||||
// }
|
||||
var list =
|
||||
helpController.helpQuestionDate['message'][index];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(3),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor.greenColor,
|
||||
width: 3,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(11)),
|
||||
// elevation: 3,
|
||||
// color: AppColor.greenColor,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
print(list['id']);
|
||||
helpController.getindex(
|
||||
list['id'], list['helpQuestion']);
|
||||
helpController
|
||||
.getHelpRepley(list['id'].toString());
|
||||
Get.to(
|
||||
() => const HelpDetailsReplayPage(),
|
||||
builder: (helpController) => Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Container(
|
||||
height: Get.height * .45,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: ListView.builder(
|
||||
itemCount:
|
||||
helpController.helpQuestionDate['message'] != null
|
||||
? helpController
|
||||
.helpQuestionDate['message'].length
|
||||
: 0,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
// if (helpController.helpQuestionDate['message'] ==
|
||||
// null) {
|
||||
// return const CircularProgressIndicator();
|
||||
// }
|
||||
var list = helpController
|
||||
.helpQuestionDate['message'][index];
|
||||
return helpController
|
||||
.helpQuestionDate['message'].length ==
|
||||
0
|
||||
? Center(
|
||||
child: Text(
|
||||
'text',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.all(3),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor.greenColor,
|
||||
width: 3,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(11)),
|
||||
// elevation: 3,
|
||||
// color: AppColor.greenColor,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
print(list['id']);
|
||||
helpController.getindex(
|
||||
list['id'], list['helpQuestion']);
|
||||
helpController.getHelpRepley(
|
||||
list['id'].toString());
|
||||
Get.to(
|
||||
() => const HelpDetailsReplayPage(),
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .6,
|
||||
child: Text(
|
||||
list['helpQuestion'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .3,
|
||||
child: Text(
|
||||
list['datecreated'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .6,
|
||||
child: Text(
|
||||
list['helpQuestion'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .3,
|
||||
child: Text(
|
||||
list['datecreated'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
},
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:SEFER/controller/payment/paymob.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
@@ -13,6 +12,7 @@ import '../../../../constant/table_names.dart';
|
||||
import '../../../../controller/functions/location_controller.dart';
|
||||
import '../../../../controller/home/captin/home_captain_controller.dart';
|
||||
import '../../../../controller/home/captin/order_request_controller.dart';
|
||||
import '../../../widgets/circle_container.dart';
|
||||
import 'widget/connect.dart';
|
||||
import 'widget/left_menu_map_captain.dart';
|
||||
import '../../../../controller/home/payment/captain_wallet_controller.dart';
|
||||
@@ -30,37 +30,26 @@ class HomeCaptain extends StatelessWidget {
|
||||
Get.put(HomeCaptainController());
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColor.greenColor,
|
||||
elevation: 0,
|
||||
// backgroundColor: AppColor.accentColor,
|
||||
elevation: 1,
|
||||
title: Text('Home'.tr),
|
||||
actions: [
|
||||
GetBuilder<LocationController>(
|
||||
builder: (locationController) => locationController.isLoading
|
||||
? const SizedBox(
|
||||
height: 1,
|
||||
width: 1,
|
||||
child: CircularProgressIndicator.adaptive())
|
||||
: const SizedBox(),
|
||||
),
|
||||
GetBuilder<OrderRequestController>(
|
||||
builder: (orderRequestController) => MyCircleContainer(
|
||||
child: Text(
|
||||
orderRequestController.countRefuse.toString(),
|
||||
style: AppStyle.title,
|
||||
))),
|
||||
IconButton(
|
||||
// onPressed: () => box.remove(BoxName.periods),
|
||||
onPressed: () => sql.deleteAllData(TableName.driverOrdersRefuse),
|
||||
icon: const Icon(Icons.remove)),
|
||||
GetBuilder<OrderRequestController>(
|
||||
builder: (orderRequestController) => IconButton(
|
||||
onPressed: () =>
|
||||
orderRequestController.getRefusedOrderByCaptain(),
|
||||
icon: const Icon(Icons.get_app)),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
PaymobManager().getPaymentKey(100, 'EGP');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.call,
|
||||
size: 29,
|
||||
),
|
||||
),
|
||||
// GetBuilder<OrderRequestController>(
|
||||
// builder: (orderRequestController) => IconButton(
|
||||
// onPressed: () =>
|
||||
// orderRequestController.getRefusedOrderByCaptain(),
|
||||
// icon: const Icon(Icons.get_app)),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
drawer: DrawerCaptain(),
|
||||
@@ -134,7 +123,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
color: AppColor.yellowColor,
|
||||
),
|
||||
Text(
|
||||
'${' You Have in'.tr} ${AppInformation.appName} is ${homeCaptainController.totalMoneyInSEFER} ',
|
||||
'${' You Have in'.tr} ${AppInformation.appName} ${homeCaptainController.totalMoneyInSEFER} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
@@ -143,7 +132,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'Total points is '.tr +
|
||||
'Total Budget is '.tr +
|
||||
Get.find<CaptainWalletController>().totalPoints,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -13,43 +15,43 @@ import '../../../../../controller/functions/location_controller.dart';
|
||||
GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
return GetBuilder<HomeCaptainController>(
|
||||
builder: (controller) => Positioned(
|
||||
bottom: Get.height * .17,
|
||||
bottom: Get.height * .2,
|
||||
left: 6,
|
||||
child: Column(
|
||||
children: [
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
AC credentials = AC();
|
||||
String apiKey = '21010e54b50f41a4904708c526e102df';
|
||||
String convertedStringN = credentials.c(
|
||||
credentials.c(credentials.c(apiKey, cs), cC), cn);
|
||||
print('Converted v: $convertedStringN');
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
// decoration: BoxDecoration(
|
||||
// border: Border.all(),
|
||||
// color: AppColor.secondaryColor,
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: IconButton(
|
||||
// onPressed: () {
|
||||
// AC credentials = AC();
|
||||
// String apiKey = '21010e54b50f41a4904708c526e102df';
|
||||
// String convertedStringN = credentials.c(
|
||||
// credentials.c(credentials.c(apiKey, cs), cC), cn);
|
||||
// print('Converted v: $convertedStringN');
|
||||
|
||||
String retrievedStringS = credentials.r(
|
||||
credentials.r(credentials.r(convertedStringN, cn), cC),
|
||||
cs);
|
||||
print('Retrieved String: $retrievedStringS');
|
||||
//
|
||||
if (retrievedStringS == apiKey) {
|
||||
print('same');
|
||||
}
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome.map_signs,
|
||||
size: 24,
|
||||
color: Colors.black,
|
||||
)),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
// String retrievedStringS = credentials.r(
|
||||
// credentials.r(credentials.r(convertedStringN, cn), cC),
|
||||
// cs);
|
||||
// print('Retrieved String: $retrievedStringS');
|
||||
// //
|
||||
// if (retrievedStringS == apiKey) {
|
||||
// print('same');
|
||||
// }
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// FontAwesome.map_signs,
|
||||
// size: 24,
|
||||
// color: Colors.black,
|
||||
// )),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: 5,
|
||||
// ),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
@@ -113,6 +115,9 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
@@ -122,7 +127,25 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
Get.to(() => RideCalculateDriver());
|
||||
final now = DateTime.now();
|
||||
DateTime? lastRequestTime =
|
||||
box.read(BoxName.lastTimeStaticThrottle);
|
||||
|
||||
if (lastRequestTime == null ||
|
||||
now.difference(lastRequestTime).inMinutes >= 15) {
|
||||
// Update the last request time to now
|
||||
lastRequestTime = now;
|
||||
box.write(BoxName.lastTimeStaticThrottle, lastRequestTime);
|
||||
// Navigate to the RideCalculateDriver page
|
||||
Get.to(() => RideCalculateDriver());
|
||||
} else {
|
||||
// Optionally show a message or handle the throttling case
|
||||
final minutesLeft =
|
||||
15 - now.difference(lastRequestTime).inMinutes;
|
||||
Get.snackbar(
|
||||
'Please wait $minutesLeft minutes before trying again.',
|
||||
'');
|
||||
}
|
||||
},
|
||||
icon: const Icon(FontAwesome5.chart_bar),
|
||||
),
|
||||
|
||||
@@ -47,8 +47,8 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
const Icon(Icons.timelapse),
|
||||
Text(
|
||||
mapDriverController.hours > 1
|
||||
? '${'${'Your Ride Duration is '.tr}${mapDriverController.hours}${' H and'.tr}'} ${mapDriverController.minutes} m'
|
||||
: '${'Your Ride Duration is '.tr} ${mapDriverController.minutes} ${'m'.tr}',
|
||||
? '${'${mapDriverController.hours}${' H and'.tr}'} ${mapDriverController.minutes} m'
|
||||
: '${mapDriverController.minutes} ${'m'.tr}',
|
||||
style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
@@ -148,18 +148,20 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
)
|
||||
],
|
||||
)
|
||||
: const SizedBox(),
|
||||
mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
? Row(
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
title: 'End Ride'.tr,
|
||||
onPressed: () {
|
||||
mapDriverController.finishRideFromDriver();
|
||||
},
|
||||
kolor: AppColor.redColor,
|
||||
),
|
||||
mapDriverController.remainingTimeTimerRideBegin <
|
||||
60
|
||||
? MyElevatedButton(
|
||||
title: 'End Ride'.tr,
|
||||
onPressed: () {
|
||||
mapDriverController
|
||||
.finishRideFromDriver();
|
||||
},
|
||||
kolor: AppColor.redColor,
|
||||
)
|
||||
: const SizedBox(),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Text(
|
||||
@@ -168,8 +170,7 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
mapDriverController.carType != 'Comfort' &&
|
||||
mapDriverController.carType != 'Mashwari'
|
||||
? Stack(
|
||||
|
||||
@@ -92,7 +92,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
// SizedBox(height: 200, child: Text(pointsList.toString())),
|
||||
// Text(message.notification!.body.toString()),
|
||||
SizedBox(
|
||||
height: Get.height * .2,
|
||||
height: Get.height * .3,
|
||||
child: GoogleMap(
|
||||
initialCameraPosition: CameraPosition(
|
||||
zoom: 12,
|
||||
@@ -357,11 +357,13 @@ class OrderRequestPage extends StatelessWidget {
|
||||
'step2': myList[23].toString(),
|
||||
'step3': myList[24].toString(),
|
||||
'step4': myList[25].toString(),
|
||||
'passengerWalletBurc': myList[26].toString(),
|
||||
'passengerWalletBurc': myList[27].toString(),
|
||||
'timeOfOrder': DateTime.now().toString(),
|
||||
'totalPassenger': myList[2].toString(),
|
||||
'carType': myList[31].toString(),
|
||||
'kazan': myList[32].toString(),
|
||||
'startNameLocation': myList[29].toString(),
|
||||
'endNameLocation': myList[30].toString(),
|
||||
});
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user