This commit is contained in:
Hamza Aleghwairyeen
2024-04-16 10:22:01 +03:00
parent a2d4cd845c
commit 24b3804045
18 changed files with 457 additions and 226 deletions

View File

@@ -1,15 +1,15 @@
import 'dart:io';
import 'package:SEFER/controller/payment/payment_controller.dart';
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';
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/main.dart';
import 'package:paymob_payment/paymob_payment.dart';
import '../../../constant/colors.dart';
import '../../../controller/functions/tts.dart';
import '../../../controller/home/map_passenger_controller.dart';
import '../Captin/home_captain/driver_call_page.dart';
GetBuilder<MapPassengerController> leftMainMenuIcons() {
final textToSpeechController = Get.put(TextToSpeechController());
@@ -17,121 +17,146 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
builder: (controller) => Positioned(
top: 85,
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: () {
controller.changeMapType();
// Toast.show(context, 'This is a toast message!');
},
icon: const Icon(
Icons.satellite_alt,
size: 29,
child: Builder(builder: (context) {
return 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: () {
controller.changeMapType();
// Toast.show(context, 'This is a toast message!');
},
icon: const Icon(
Icons.satellite_alt,
size: 29,
),
),
),
),
const SizedBox(
height: 5,
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
controller.changeMapTraffic();
// Toast.show(context, 'This is a toast message!');
},
icon: const Icon(
Icons.streetview_sharp,
size: 29,
const SizedBox(
height: 5,
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
controller.changeMapTraffic();
// Toast.show(context, 'This is a toast message!');
},
icon: const Icon(
Icons.streetview_sharp,
size: 29,
),
),
),
),
const SizedBox(
height: 5,
),
// if (Platform.isIOS)
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
controller.mapController?.animateCamera(
CameraUpdate.newLatLng(LatLng(
controller.passengerLocation.latitude,
controller.passengerLocation.longitude)));
},
icon: const Icon(
Icons.location_on,
size: 29,
const SizedBox(
height: 5,
),
// if (Platform.isIOS)
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
controller.mapController?.animateCamera(
CameraUpdate.newLatLng(LatLng(
controller.passengerLocation.latitude,
controller.passengerLocation.longitude)));
},
icon: const Icon(
Icons.location_on,
size: 29,
),
),
),
),
const SizedBox(
height: 5,
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
textToSpeechController.speakText(
'''hello this is ${box.read(BoxName.name)}''');
},
icon: const Icon(
Icons.voice_chat,
size: 29,
const SizedBox(
height: 5,
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
textToSpeechController.speakText(
'''hello this is ${box.read(BoxName.name)}''');
},
icon: const Icon(
Icons.voice_chat,
size: 29,
),
),
),
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
// NotificationController()
// .showNotification('Order', 'hi this is', 'tone1');
// Get.to(() => DriverCallPage());
// print(controller.carLocationsModels);
// controller.getKazanPercent();
// PassengerCallPage(
// channelName: '',
// token: '',
// remoteID: '',
// )
// Get.to(() => const CallPage());
// print(box.read(BoxName.lang));
},
icon: const Icon(
Icons.call,
size: 29,
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () async {
// await PaymobManager().payWithPayMob(100, 'EGP');
await Get.find<PaymentController>()
.payWithPayMob(context, '11', 'EGP');
// Initiates a payment with a card using the FlutterPaymob instance
// NotificationController()
// .showNotification('Order', 'hi this is', 'tone1');
// Get.to(() => DriverCallPage());
// print(controller.carLocationsModels);
// controller.getKazanPercent();
// PassengerCallPage(
// channelName: '',
// token: '',
// remoteID: '',
// )
// Get.to(() => const CallPage());
// print(box.read(BoxName.lang));
},
icon: const Icon(
Icons.call,
size: 29,
),
),
),
),
],
)),
],
);
})),
);
}
class PaymobPackage extends StatelessWidget {
const PaymobPackage({super.key});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () async {
await Get.find<PaymentController>()
.payWithPayMob(context, '11', 'EGP');
},
child: Container(
width: 50,
height: 50,
child: Text('pay'),
));
}
}