This commit is contained in:
Hamza-Ayed
2024-07-05 04:51:14 +03:00
parent b48bcfdebb
commit fec02b13ee
40 changed files with 652 additions and 194 deletions

View File

@@ -3,6 +3,7 @@ import 'dart:io';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_font_icons/flutter_font_icons.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/box_name.dart';
@@ -17,6 +18,7 @@ import '../../controller/auth/apple_signin_controller.dart';
import '../../controller/auth/google_sign.dart';
import '../../controller/auth/login_controller.dart';
import '../home/profile/passenger_profile_page.dart';
import '../widgets/mycircular.dart';
class LoginPage extends StatelessWidget {
final controller = Get.put(LoginController());
@@ -58,26 +60,194 @@ class LoginPage extends StatelessWidget {
width: Get.width * .3,
fit: BoxFit.fill,
),
Container(
decoration: AppStyle.boxDecoration1,
height: Get.height * .3,
width: Get.width * .8,
child: Center(
child: Text(
'Sign in with Google for easier email and name entry'
.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
Platform.isIOS && controller.isTest == 0
? Container(
decoration: AppStyle.boxDecoration,
child: Column(
children: [
Form(
key: controller.formKey,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Column(
children: [
TextFormField(
keyboardType: TextInputType
.emailAddress,
controller: controller
.emailController,
decoration: InputDecoration(
focusedBorder:
OutlineInputBorder(
borderSide:
const BorderSide(
color: AppColor
.primaryColor,
width: 2.0,
),
borderRadius:
BorderRadius.circular(
10),
),
fillColor:
AppColor.accentColor,
hoverColor:
AppColor.accentColor,
focusColor:
AppColor.accentColor,
border: const OutlineInputBorder(
borderRadius:
BorderRadius.all(
Radius.circular(
12))),
labelText: 'Email'.tr,
hintText:
'Enter your email address'
.tr,
),
validator: (value) {
if (value!.isEmpty ||
(!value.contains('@') ||
!value.contains(
'.'))) {
return 'Please enter Your Email.'
.tr;
}
return null;
},
),
const SizedBox(
height: 15,
),
TextFormField(
obscureText: true,
keyboardType: TextInputType
.emailAddress,
controller: controller
.passwordController,
decoration: InputDecoration(
focusedBorder:
OutlineInputBorder(
borderSide:
const BorderSide(
color: AppColor
.primaryColor,
width: 2.0,
),
borderRadius:
BorderRadius.circular(
10),
),
fillColor:
AppColor.accentColor,
hoverColor:
AppColor.accentColor,
focusColor:
AppColor.accentColor,
border: const OutlineInputBorder(
borderRadius:
BorderRadius.all(
Radius.circular(
12))),
labelText: 'Password'.tr,
hintText:
'Please enter your phone number.'
.tr,
),
validator: (value) {
if (value!.isEmpty) {
return 'Please enter Your Password.'
.tr;
}
if (value.length < 6) {
return 'Password must br at least 6 character.'
.tr;
}
return null;
},
),
GetBuilder<LoginController>(
builder: (controller) =>
controller.isloading
? const MyCircularProgressIndicator()
: MyElevatedButton(
onPressed: () {
if (controller
.formKey
.currentState!
.validate()) {
controller
.login();
}
},
title:
'Submit'.tr,
),
)
],
),
),
),
),
const SizedBox(
height: 10,
),
],
),
)
: Container(
decoration: AppStyle.boxDecoration1,
height: Get.height * .3,
width: Get.width * .8,
child: Center(
child: Text(
'Sign in with Google for easier email and name entry'
.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
),
),
),
// MyElevatedButton(
// title: 'Sign In by Google'.tr,
// onPressed: () async {
// await GoogleSignInHelper.signInFromLogin();
// },
// kolor: AppColor.blueColor,
// ),
InkWell(
onTap: () async {
await GoogleSignInHelper.signInFromLogin();
},
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 16, vertical: 10),
decoration: BoxDecoration(
color: AppColor.redColor,
borderRadius: BorderRadius.circular(8),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(
FontAwesome.google,
color: AppColor.blueColor,
),
const SizedBox(width: 8),
Text(
'Sign In by Google'.tr,
style: const TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
],
),
),
),
MyElevatedButton(
title: 'Sign In by Google'.tr,
onPressed: () async {
await GoogleSignInHelper.signInFromLogin();
},
kolor: AppColor.blueColor,
),
!Platform.isAndroid
? GestureDetector(
onTap: () async {

View File

@@ -36,7 +36,14 @@ class TripMonitor extends StatelessWidget {
markerId: MarkerId('start'.tr),
position: tripMonitorController.parentLocation,
draggable: true,
icon: tripMonitorController.carIcon,
icon: tripMonitorController.tripData['message'][0]['model']
.contains('دراجة')
? tripMonitorController.motoIcon
: tripMonitorController.tripData['message'][0]['model']
['gender'] ==
'Male'
? tripMonitorController.carIcon
: tripMonitorController.ladyIcon,
rotation: tripMonitorController.rotation,
),
},

View File

@@ -10,6 +10,7 @@ import 'package:get/get.dart';
import '../../../constant/box_name.dart';
import '../../../controller/functions/launch.dart';
import '../../widgets/my_textField.dart';
class ApplyOrderWidget extends StatelessWidget {
const ApplyOrderWidget({super.key});
@@ -184,10 +185,9 @@ class ApplyOrderWidget extends StatelessWidget {
title: 'Select one message'.tr,
titleStyle: AppStyle.title,
content: SizedBox(
width: Get.width * .6,
height: Get.height * .5,
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
child: ListView(
children: [
InkWell(
onTap: () {
@@ -216,11 +216,14 @@ class ApplyOrderWidget extends StatelessWidget {
),
),
),
const SizedBox(
height: 5,
),
InkWell(
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'message From passenger',
'message From passenger'.tr,
'My location is correct. You can search for me using the navigation app'
.tr,
controller.driverToken,
@@ -243,12 +246,16 @@ class ApplyOrderWidget extends StatelessWidget {
),
),
),
const SizedBox(
height: 5,
),
InkWell(
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'message From passenger',
'I\'m waiting for you'.tr,
'My location is correct. You can search for me using the navigation app'
.tr,
controller.driverToken,
'ding.wav',
);
@@ -268,6 +275,84 @@ class ApplyOrderWidget extends StatelessWidget {
),
),
),
const SizedBox(
height: 5,
),
InkWell(
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'message From passenger',
"How much longer will you be?"
.tr,
controller.driverToken,
'ding.wav',
);
Get.back();
},
child: Container(
decoration:
AppStyle.boxDecoration1,
child: Padding(
padding:
const EdgeInsets.all(
10),
child: Text(
"How much longer will you be?"
.tr,
style: AppStyle.title,
),
),
),
),
const SizedBox(
height: 5,
),
SizedBox(
width: Get.width * .5,
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Form(
key: controller
.messagesFormKey,
child: SizedBox(
width: Get.width * .4,
child: MyTextForm(
controller: controller
.messageToDriver,
label:
'Type Any thing'
.tr,
hint:
'Type Any thing'
.tr,
type:
TextInputType
.name),
)),
IconButton(
onPressed: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'message From passenger',
controller
.messageToDriver
.text,
controller
.driverToken,
'ding.wav');
controller
.messageToDriver
.clear();
Get.back();
},
icon: const Icon(
Icons.send))
],
),
)
],
),
));

View File

@@ -595,7 +595,7 @@ class HeaderDestination extends StatelessWidget {
right: 5,
child: Container(
decoration: AppStyle.boxDecoration1,
height: Get.height * .1,
height: Get.height * .15,
width: Get.width * .8,
child: InkWell(
onTap: () {
@@ -618,7 +618,7 @@ class HeaderDestination extends StatelessWidget {
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 2),
child: SizedBox(
height: Get.height * .06,
height: Get.height * .08,
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
//

View File

@@ -1,10 +1,9 @@
import 'package:SEFER/main.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import '../../../constant/box_name.dart';
import '../../../constant/char_map.dart';
import '../../../constant/colors.dart';
import '../../../controller/functions/launch.dart';
import '../../../constant/credential.dart';
import '../../../controller/functions/tts.dart';
import '../../../controller/home/map_passenger_controller.dart';
@@ -83,23 +82,23 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
const SizedBox(
width: 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: () async {
makePhoneCall('+201023248456');
},
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: () async {
// makePhoneCall('+201023248456');
// },
// icon: const Icon(
// Icons.voice_chat,
// size: 29,
// ),
// ),
// ),
// AnimatedContainer(
// duration: const Duration(microseconds: 200),
// width: controller.widthMapTypeAndTraffic,
@@ -120,59 +119,50 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
// ),
// ),
// ),
// 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 CRUD().allMethodForAI(
// 'name,fullName,address,idNumber,cardId,dob',
// AppLink.uploadEgypt,
// 'idFront');
//
// // await ImageController().choosImage(
// // 'https://api.sefer.live/sefer/uploadEgypt.php',
// // 'FrontId');
// // AC credentials = AC();
// // String apiKey = AK.payPalSecret;
// // String convertedStringN = credentials.c(
// // credentials.c(credentials.c(apiKey, cs), cC), cn);
//
// // String retrievedStringS = credentials.r(
// // credentials.r(credentials.r(convertedStringN, cn), cC),
// // cs);
// // //
// // if (retrievedStringS == apiKey) {
// // }
//
// // await Get.find<PaymentController>()
// // .payWithPayMob(context, '1100', 'EGP');
// // Initiates a payment with a card using the FlutterPaymob instance
//
// // NotificationController()
// // .showNotification('Order', 'hi this is', 'tone1');
// // Get.to(() => DriverCallPage());
// // controller.getKazanPercent();
// // PassengerCallPage(
// // channelName: '',
// // token: '',
// // remoteID: '',
// // )
// // Get.to(() => const CallPage());
// await Get.find<AudioRecorderController>().startRecording();
// },
// icon: Icon(
// Get.put(AudioRecorderController()).isRecording
// ? Icons.stop
// : Icons.start,
// 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 CRUD().allMethodForAI(
// 'name,fullName,address,idNumber,cardId,dob',
// AppLink.uploadEgypt,
// 'idFront');
//
// // await ImageController().choosImage(
// // 'https://api.sefer.live/sefer/uploadEgypt.php',
// // 'FrontId');
AC credentials = AC();
String apiKey = 'zjujl_qvo_fwjfgjlXrXlBl';
String convertedStringN = credentials.c(
credentials.c(credentials.c(apiKey, cs), cC), cn);
String retrievedStringS = credentials.r(
credentials.r(credentials.r(convertedStringN, cn), cC),
cs);
//
if (retrievedStringS == apiKey) {
print('convertedStringN --- $convertedStringN');
print('retrievedStringS ---$retrievedStringS');
print('same');
}
//
// // await Get.find<PaymentController>()
// // .payWithPayMob(context, '1100', 'EGP');
// // Initiates a payment with a card using the FlutterPaymob instance
//
},
icon: const Icon(
// Get.put(AudioRecorderController()).isRecording
Icons.start,
size: 29,
),
),
),
],
);
})),