10/26/1
This commit is contained in:
@@ -5,7 +5,6 @@ import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:SEFER/views/notification/available_rides_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_overlay_window/flutter_overlay_window.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
@@ -20,7 +19,6 @@ import '../../../../controller/functions/location_controller.dart';
|
||||
import '../../../../controller/functions/overlay_permisssion.dart';
|
||||
import '../../../../controller/functions/package_info.dart';
|
||||
import '../../../../controller/home/captin/home_captain_controller.dart';
|
||||
import '../../../../controller/home/captin/order_request_controller.dart';
|
||||
import '../../../widgets/circle_container.dart';
|
||||
import '../driver_map_page.dart';
|
||||
import 'widget/connect.dart';
|
||||
@@ -37,8 +35,8 @@ class HomeCaptain extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Get.put(OrderRequestController());
|
||||
// Get.put(HomeCaptainController());
|
||||
Get.put(CaptainWalletController());
|
||||
Get.put(HomeCaptainController());
|
||||
// Get.put(CaptainWalletController());
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
closeOverlayIfFound();
|
||||
checkForUpdate(context);
|
||||
@@ -51,25 +49,27 @@ class HomeCaptain extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
// backgroundColor: AppColor.accentColor,
|
||||
elevation: 1,
|
||||
title: Text('Home'.tr),
|
||||
title: Text(
|
||||
'SEFER'.tr,
|
||||
style: AppStyle.title.copyWith(fontSize: 22),
|
||||
),
|
||||
actions: [
|
||||
GetBuilder<HomeCaptainController>(
|
||||
builder: (orderRequestController) => MyCircleContainer(
|
||||
child: Text(
|
||||
orderRequestController.countRefuse.toString(),
|
||||
MyCircleContainer(
|
||||
child: Text(
|
||||
homeCaptainController.countRefuse.toString(),
|
||||
style: AppStyle.title,
|
||||
)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
drawer: CupertinoDrawerCaptain(),
|
||||
body: Stack(
|
||||
children: [
|
||||
GetBuilder<HomeCaptainController>(
|
||||
builder: (controller) => controller.isLoading
|
||||
GetBuilder<HomeCaptainController>(builder: (homeCaptainController) {
|
||||
return homeCaptainController.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: GoogleMap(
|
||||
onMapCreated: controller.onMapCreated,
|
||||
onMapCreated: homeCaptainController.onMapCreated,
|
||||
// cameraTargetBounds: CameraTargetBounds(controller.boundsdata),
|
||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||
|
||||
@@ -82,24 +82,24 @@ class HomeCaptain extends StatelessWidget {
|
||||
markerId: MarkerId('MyLocation'.tr),
|
||||
position: locationController.myLocation,
|
||||
draggable: false,
|
||||
icon: controller.carIcon,
|
||||
icon: homeCaptainController.carIcon,
|
||||
rotation: locationController.heading)
|
||||
},
|
||||
mapType: controller.mapType
|
||||
mapType: homeCaptainController.mapType
|
||||
? MapType.satellite
|
||||
: MapType.terrain,
|
||||
myLocationButtonEnabled: true,
|
||||
// liteModeEnabled: true, tiltGesturesEnabled: false,
|
||||
|
||||
// indoorViewEnabled: true,
|
||||
trafficEnabled: controller.mapTrafficON,
|
||||
trafficEnabled: homeCaptainController.mapTrafficON,
|
||||
buildingsEnabled: true,
|
||||
mapToolbarEnabled: true,
|
||||
|
||||
myLocationEnabled: false,
|
||||
// liteModeEnabled: true,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: Get.width * .1,
|
||||
@@ -109,85 +109,83 @@ class HomeCaptain extends StatelessWidget {
|
||||
top: 5,
|
||||
right: Get.width * .05,
|
||||
left: Get.width * .05,
|
||||
child: GetBuilder<HomeCaptainController>(
|
||||
builder: (homeCaptainController) => Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
width: Get.width * .8,
|
||||
height: 104,
|
||||
child: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.wallet,
|
||||
color: AppColor.greenColor,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
width: Get.width * .8,
|
||||
height: 104,
|
||||
child: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.wallet,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
Text(
|
||||
' You Earn today is '.tr +
|
||||
homeCaptainController.totalMoneyToday,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.wallet,
|
||||
color: AppColor.yellowColor,
|
||||
),
|
||||
Text(
|
||||
'${' You Have in'.tr} ${AppInformation.appName} ${homeCaptainController.totalMoneyInSEFER} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'Total Budget is '.tr +
|
||||
Get.find<CaptainWalletController>().totalPoints,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
color: int.parse(Get.find<HomeCaptainController>()
|
||||
.countRideToday) <
|
||||
5
|
||||
? AppColor.accentColor
|
||||
: int.parse(Get.find<HomeCaptainController>()
|
||||
.countRideToday) >
|
||||
5 &&
|
||||
int.parse(Get.find<
|
||||
HomeCaptainController>()
|
||||
.countRideToday) <
|
||||
10
|
||||
? AppColor.yellowColor
|
||||
: AppColor.greenColor,
|
||||
),
|
||||
Text(
|
||||
' You Earn today is '.tr +
|
||||
homeCaptainController.totalMoneyToday,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.wallet,
|
||||
color: AppColor.yellowColor,
|
||||
),
|
||||
Text(
|
||||
'${' You Have in'.tr} ${AppInformation.appName} ${homeCaptainController.totalMoneyInSEFER} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'Total Budget is '.tr +
|
||||
Get.find<CaptainWalletController>().totalPoints,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
color: int.parse(Get.find<HomeCaptainController>()
|
||||
.countRideToday) <
|
||||
5
|
||||
? AppColor.accentColor
|
||||
: int.parse(Get.find<HomeCaptainController>()
|
||||
.countRideToday) >
|
||||
5 &&
|
||||
int.parse(Get.find<
|
||||
HomeCaptainController>()
|
||||
.countRideToday) <
|
||||
10
|
||||
? AppColor.yellowColor
|
||||
: AppColor.greenColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8, vertical: 2),
|
||||
child: Text(
|
||||
'Ride Today : '.tr +
|
||||
Get.find<HomeCaptainController>()
|
||||
.countRideToday,
|
||||
style: AppStyle.title
|
||||
.copyWith(color: AppColor.secondaryColor),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8, vertical: 2),
|
||||
child: Text(
|
||||
'Ride Today : '.tr +
|
||||
Get.find<HomeCaptainController>()
|
||||
.countRideToday,
|
||||
style: AppStyle.title
|
||||
.copyWith(color: AppColor.secondaryColor),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
))),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
))),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 65,
|
||||
|
||||
@@ -1,28 +1,21 @@
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/controller/firebase/local_notification.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/auth/captin/cards/egypt_card_a_i.dart';
|
||||
import 'package:SEFER/views/auth/captin/cards/sms_signup.dart';
|
||||
import 'package:SEFER/views/auth/captin/login_captin.dart';
|
||||
import 'package:SEFER/views/home/Captin/driver_map_page.dart';
|
||||
import 'package:bubble_head/bubble.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:bubble_head/bubble.dart';
|
||||
import 'package:flutter_overlay_window/flutter_overlay_window.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
import '../../../../../constant/colors.dart';
|
||||
import '../../../../../constant/links.dart';
|
||||
import '../../../../../controller/firebase/firbase_messge.dart';
|
||||
import '../../../../../controller/functions/location_permission.dart';
|
||||
import '../../../../../controller/functions/overlay_permisssion.dart';
|
||||
import '../../../../../print.dart';
|
||||
import '../../../../../controller/functions/audio_controller.dart';
|
||||
import '../../../../Rate/ride_calculate_driver.dart';
|
||||
import '../../../../../controller/functions/location_controller.dart';
|
||||
import '../../driver_map_page.dart';
|
||||
import '../../orderCaptin/order_speed_request.dart';
|
||||
|
||||
GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
return GetBuilder<HomeCaptainController>(
|
||||
@@ -186,32 +179,7 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
height: 5,
|
||||
),
|
||||
// Platform.isAndroid
|
||||
// ? AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// border: Border.all(color: AppColor.blueColor),
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: Builder(builder: (context) {
|
||||
// return IconButton(
|
||||
// onPressed: () async {
|
||||
// bool isOverlayActive =
|
||||
// await FlutterOverlayWindow.isActive();
|
||||
// if (isOverlayActive) {
|
||||
// await FlutterOverlayWindow.closeOverlay();
|
||||
// }
|
||||
// // print(box.read(BoxName.tokenDriver));
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// FontAwesome5.window_close,
|
||||
// size: 29,
|
||||
// color: AppColor.blueColor,
|
||||
// ),
|
||||
// );
|
||||
// }),
|
||||
// )
|
||||
// : const SizedBox(),
|
||||
// ?
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
@@ -222,63 +190,109 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
// child: Builder(builder: (context) {
|
||||
// return IconButton(
|
||||
// onPressed: () async {
|
||||
// Get.to(() => LoginCaptin());
|
||||
// // NotificationController().showNotification(
|
||||
// // ' message.notification!.title.toString()',
|
||||
// // ' message.notification!.body.toString()',
|
||||
// // 'order',
|
||||
// // '');
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// FontAwesome5.window_close,
|
||||
// size: 29,
|
||||
// color: AppColor.blueColor,
|
||||
// ),
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
// : const SizedBox(),
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
// width: controller.widthMapTypeAndTraffic,
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// border: Border.all(color: AppColor.blueColor),
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: Builder(builder: (context) {
|
||||
// return IconButton(
|
||||
// onPressed: () async {
|
||||
// // Get.to(() => LoginCaptin());
|
||||
// // print(box.read(BoxName.myList));
|
||||
// // Bubble().startBubbleHead(sendAppToBackground: true);
|
||||
// List<String> d = [
|
||||
// "30.003028,31.2419628",
|
||||
// "30.0955661,31.2665336",
|
||||
// "160.00",
|
||||
// "25.92",
|
||||
// "1488",
|
||||
// "16.93",
|
||||
// "114243034311436865474",
|
||||
// "113172279072358305645",
|
||||
// "hamza ayed",
|
||||
// "rlMbi4Hc8L1STMPE99iPKqK4Gddwv8r9qZOCadsz9qTEJZ6KLEE9ruTJI6N8dKfK4CXez5pme5WIs14-1QGo29s07fQOniZgIlJV5XFL3yqzPRSUmn3",
|
||||
// "+201023248456",
|
||||
// "1 min",
|
||||
// "1 m",
|
||||
// "false",
|
||||
// "QwUMoyUtZ0J3oR6yXKUavrB_gBl9npUZe-qZtax-Raq4QBbdKv0AmtLKm0BfBd6N_592HBv4CVa41ii4122W3hr-BCUKKzJhzZcK8m0YjbWbtpvgJRD8uD_nuMk9",
|
||||
// "0",
|
||||
// "238",
|
||||
// "false",
|
||||
// "114243034311436865474",
|
||||
// "1488",
|
||||
// "startEnd",
|
||||
// "30.049307749732176,31.274291574954987",
|
||||
// "",
|
||||
// "",
|
||||
// "",
|
||||
// "",
|
||||
// "17.73",
|
||||
// "0",
|
||||
// "hamzaayedflutter@gmail.com",
|
||||
// "الفسطاط، حي مصر القديمة، مصر",
|
||||
// " الزاوية الحمراء، محافظة القاهرة، مصر",
|
||||
// "Speed",
|
||||
// "8",
|
||||
// "5.00"
|
||||
// ];
|
||||
|
||||
// // List<String> d = [
|
||||
// // "30.003028,31.2419628",
|
||||
// // "30.0955661,31.2665336",
|
||||
// // "160.00",
|
||||
// // "25.92",
|
||||
// // "1488",
|
||||
// // "16.93",
|
||||
// // "114243034311436865474",
|
||||
// // "113172279072358305645",
|
||||
// // "hamza ayed",
|
||||
// // "rlMbi4Hc8L1STMPE99iPKqK4Gddwv8r9qZOCadsz9qTEJZ6KLEE9ruTJI6N8dKfK4CXez5pme5WIs14-1QGo29s07fQOniZgIlJV5XFL3yqzPRSUmn3",
|
||||
// // "+201023248456",
|
||||
// // "1 min",
|
||||
// // "1 m",
|
||||
// // "false",
|
||||
// // "QwUMoyUtZ0J3oR6yXKUavrB_gBl9npUZe-qZtax-Raq4QBbdKv0AmtLKm0BfBd6N_592HBv4CVa41ii4122W3hr-BCUKKzJhzZcK8m0YjbWbtpvgJRD8uD_nuMk9",
|
||||
// // "0",
|
||||
// // "238",
|
||||
// // "false",
|
||||
// // "114243034311436865474",
|
||||
// // "1488",
|
||||
// // "startEnd",
|
||||
// // "30.049307749732176,31.274291574954987",
|
||||
// // "",
|
||||
// // "",
|
||||
// // "",
|
||||
// // "",
|
||||
// // "17.73",
|
||||
// // "0",
|
||||
// // "hamzaayedflutter@gmail.com",
|
||||
// // "الفسطاط، حي مصر القديمة، مصر",
|
||||
// // " الزاوية الحمراء، محافظة القاهرة، مصر",
|
||||
// // "Speed",
|
||||
// // "8",
|
||||
// // "5.00"
|
||||
// // ];
|
||||
// // FirebaseMessagesController().sendNotificationToDriverMAP(
|
||||
// // 'Order'.tr,
|
||||
// // 'from: ',
|
||||
// // // jsonDecode(value)['message'].toString(),
|
||||
// // 'fKBBB4_1R0q18-byySHUeG:APA91bHk2RmjjMt6eKr7KQnqh4CK02yW3H5E8g_beVcQFgiCG50j9KCtSU1O8PtvS_gA5xuJLhaorDV9AeslcyLFJFf302tICKMiKgsDP5pWkF5WXNw0-4NsoD-BnJxf0-Do9Vs1Zbpq',
|
||||
// // d,
|
||||
// // 'order.wav');
|
||||
// // NotificationController()
|
||||
// // .showNotification('VIP Order'.tr, '', 'order', '');
|
||||
// // try {} catch (e) {
|
||||
// // print('Error showing overlay: $e');
|
||||
// // }
|
||||
// // final Bubble _bubble = Bubble(showCloseButton: true);
|
||||
// // try {
|
||||
// // await _bubble.startBubbleHead(sendAppToBackground: false);
|
||||
// // } on PlatformException {
|
||||
// // print('Failed to call startBubbleHead');
|
||||
// // }
|
||||
// box.write(BoxName.rideArguments, {
|
||||
// 'passengerLocation': d[0].toString(),
|
||||
// 'passengerDestination': d[1].toString(),
|
||||
// 'Duration': d[4].toString(),
|
||||
// 'totalCost': d[26].toString(),
|
||||
// 'Distance': d[5].toString(),
|
||||
// 'name': d[8].toString(),
|
||||
// 'phone': d[10].toString(),
|
||||
// 'email': d[28].toString(),
|
||||
// 'WalletChecked': d[13].toString(),
|
||||
// 'tokenPassenger': d[9].toString(),
|
||||
// 'direction':
|
||||
// 'https://www.google.com/maps/dir/${d[0]}/${d[1]}/',
|
||||
// 'DurationToPassenger': d[15].toString(),
|
||||
// 'rideId': d[16].toString(),
|
||||
// 'passengerId': d[7].toString(),
|
||||
// 'driverId': d[18].toString(),
|
||||
// 'durationOfRideValue': d[19].toString(),
|
||||
// 'paymentAmount': d[2].toString(),
|
||||
// 'paymentMethod':
|
||||
// d[13].toString() == 'true' ? 'visa' : 'cash',
|
||||
// 'isHaveSteps': d[20].toString(),
|
||||
// 'step0': d[21].toString(),
|
||||
// 'step1': d[22].toString(),
|
||||
// 'step2': d[23].toString(),
|
||||
// 'step3': d[24].toString(),
|
||||
// 'step4': d[25].toString(),
|
||||
// 'passengerWalletBurc': d[26].toString(),
|
||||
// 'timeOfOrder': DateTime.now().toString(),
|
||||
// 'totalPassenger': d[2].toString(),
|
||||
// 'carType': d[31].toString(),
|
||||
// 'kazan': d[32].toString(),
|
||||
// 'startNameLocation': d[29].toString(),
|
||||
// 'endNameLocation': d[30].toString(),
|
||||
// });
|
||||
// Get.to(() => PassengerLocationMapPage(),
|
||||
// arguments: box.read(BoxName.rideArguments));
|
||||
// // Get.offAll(() => HomeCaptainController());
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// FontAwesome5.grin_tears,
|
||||
@@ -288,6 +302,7 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
// ,
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user