10/11/1
This commit is contained in:
@@ -54,8 +54,8 @@ android {
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdk = 23
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = 107
|
||||
versionName = '1.5.07'
|
||||
versionCode = 108
|
||||
versionName = '1.5.08'
|
||||
multiDexEnabled =true
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>12.0</string>
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>fetch</string>
|
||||
@@ -33,7 +35,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>66</string>
|
||||
<string>67</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
@@ -48,7 +50,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>4.0.66</string>
|
||||
<string>4.0.67</string>
|
||||
<key>FirebaseAppDelegateProxyEnabled</key>
|
||||
<string>NO</string>
|
||||
<key>GMSApiKey</key>
|
||||
|
||||
@@ -10,7 +10,8 @@ class BoxName {
|
||||
static const String bodyOrder = "bodyOrder";
|
||||
static const String gender = "gender";
|
||||
static const String phoneWallet = "phoneWallet";
|
||||
static const String IsSavedPhones = "IsSavedPhones";
|
||||
static const String isSavedPhones = "IsSavedPhones";
|
||||
static const String isTest = "isTest";
|
||||
static const String carType = "carType";
|
||||
static const String carTypeOfDriver = "carTypeOfDriver";
|
||||
static const String isFirstTime = "isFirstTime";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class AppInformation {
|
||||
static const String companyName = 'SEFER LLC';
|
||||
static const String appName = 'SEFER';
|
||||
static const String appName = 'SEFER DRIVER';
|
||||
static const String appVersion = 'SEFER Captain';
|
||||
static const String phoneNumber = '962798583052';
|
||||
static const String linkedInProfile =
|
||||
|
||||
@@ -148,6 +148,8 @@ class AppLink {
|
||||
static String deleteApiKey = "$ride/apiKey/delete.php";
|
||||
static String checkPhoneNumberISVerfiedDriver =
|
||||
"$auth/checkPhoneNumberISVerfiedDriver.php";
|
||||
static String getTesterApp = "$auth/Tester/getTesterApp.php";
|
||||
static String updateTesterApp = "$auth/Tester/updateTesterApp.php";
|
||||
|
||||
//-----------------healthInsuranceProvider------------------
|
||||
static String addHealthInsuranceProvider = "$server/driver_assurance/add.php";
|
||||
|
||||
@@ -16,6 +16,7 @@ import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/home/Captin/home_captain/home_captin.dart';
|
||||
import 'package:location/location.dart';
|
||||
|
||||
import '../../../constant/info.dart';
|
||||
import '../../../views/auth/captin/cards/egypt_card_a_i.dart';
|
||||
import '../../firebase/firbase_messge.dart';
|
||||
|
||||
@@ -26,6 +27,7 @@ class LoginDriverController extends GetxController {
|
||||
TextEditingController passwordController = TextEditingController();
|
||||
bool isAgreeTerms = false;
|
||||
bool isloading = false;
|
||||
late int isTest = 1;
|
||||
final FlutterSecureStorage _storage = const FlutterSecureStorage();
|
||||
final location = Location();
|
||||
void changeAgreeTerm() {
|
||||
@@ -33,6 +35,35 @@ class LoginDriverController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
box.read(BoxName.isTest) == null ||
|
||||
box.read(BoxName.isTest).toString() == '0'
|
||||
? await getAppTester()
|
||||
: null;
|
||||
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
getAppTester() async {
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getTesterApp,
|
||||
payload: {'appPlatform': AppInformation.appName});
|
||||
if (res != 'failure') {
|
||||
var d = jsonDecode(res);
|
||||
|
||||
isTest = d['message'][0]['isTest'];
|
||||
update();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
updateAppTester(String appPlatform) async {
|
||||
await CRUD().post(
|
||||
link: AppLink.updateTesterApp, payload: {'appPlatform': appPlatform});
|
||||
}
|
||||
|
||||
void saveAgreementTerms() {
|
||||
box.write(BoxName.agreeTerms, 'agreed');
|
||||
update();
|
||||
@@ -75,6 +106,8 @@ class LoginDriverController extends GetxController {
|
||||
if (jsonDecoeded['status'] == 'success' &&
|
||||
jsonDecoeded['data'][0]['is_verified'].toString() == '1') {
|
||||
box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
|
||||
box.write(BoxName.driverID, jsonDecoeded['data'][0]['id']);
|
||||
box.write(BoxName.isTest, '1');
|
||||
box.write(BoxName.gender, jsonDecoeded['data'][0]['gender']);
|
||||
box.write(BoxName.phoneVerified,
|
||||
jsonDecoeded['data'][0]['is_verified'].toString());
|
||||
@@ -110,9 +143,7 @@ class LoginDriverController extends GetxController {
|
||||
2002) {
|
||||
box.write(BoxName.carTypeOfDriver, 'Awfar Car');
|
||||
}
|
||||
|
||||
Log.print(
|
||||
' box.write(BoxName.carTypeOfDriver: ${box.read(BoxName.carTypeOfDriver)}');
|
||||
updateAppTester(AppInformation.appName);
|
||||
|
||||
var token = await CRUD().get(
|
||||
link: AppLink.getDriverToken,
|
||||
|
||||
@@ -178,6 +178,11 @@ class MyTranslation extends Translations {
|
||||
"Enter phone": "أدخل رقم الهاتف",
|
||||
"Send Invite": "إرسال دعوة",
|
||||
"Show Invitations": "عرض الدعوات",
|
||||
'We need access to your location to match you with nearby passengers and ensure accurate navigation.':
|
||||
'نحتاج إلى الوصول إلى موقعك لمطابقتك مع الركاب القريبين وضمان التنقل الدقيق.',
|
||||
|
||||
'Please allow location access at all times to receive ride requests and ensure smooth service.':
|
||||
'يرجى السماح بالوصول إلى الموقع في جميع الأوقات لتلقي طلبات الرحلات وضمان خدمة سلسة.',
|
||||
"No invitation found yet!": "لم يتم العثور على دعوات حتى الآن!",
|
||||
"Trip": "رحلة",
|
||||
"Your Passenger Referral Code": "رمز الإحالة الخاص بالراكب",
|
||||
|
||||
@@ -42,15 +42,13 @@ class InviteScreen extends StatelessWidget {
|
||||
),
|
||||
child: SegmentedButton<int>(
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateProperty.resolveWith<Color>(
|
||||
(states) => states.contains(MaterialState.selected)
|
||||
backgroundColor: WidgetStateProperty.resolveWith<Color>(
|
||||
(states) => states.contains(WidgetState.selected)
|
||||
? CupertinoColors.white
|
||||
: Colors.transparent,
|
||||
),
|
||||
foregroundColor:
|
||||
MaterialStateProperty.resolveWith<Color>(
|
||||
(states) => states.contains(MaterialState.selected)
|
||||
foregroundColor: WidgetStateProperty.resolveWith<Color>(
|
||||
(states) => states.contains(WidgetState.selected)
|
||||
? AppColor.blueColor
|
||||
: CupertinoColors.label,
|
||||
),
|
||||
@@ -175,9 +173,9 @@ class InviteScreen extends StatelessWidget {
|
||||
onPressed: () async {
|
||||
await controller.pickContacts();
|
||||
if (controller.contacts.isNotEmpty) {
|
||||
if (box.read(BoxName.IsSavedPhones) == null) {
|
||||
if (box.read(BoxName.isSavedPhones) == null) {
|
||||
controller.savePhoneToServer();
|
||||
box.write(BoxName.IsSavedPhones, true);
|
||||
box.write(BoxName.isSavedPhones, true);
|
||||
}
|
||||
_showContactsDialog(Get.context!);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:SEFER/views/auth/captin/contact_us_page.dart';
|
||||
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:permission_handler/permission_handler.dart';
|
||||
@@ -21,6 +22,7 @@ import '../../../controller/functions/overlay_permisssion.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import '../../widgets/my_scafold.dart';
|
||||
import '../../widgets/mycircular.dart';
|
||||
import '../country_widget.dart';
|
||||
|
||||
class LoginCaptin extends StatelessWidget {
|
||||
@@ -196,40 +198,202 @@ class LoginCaptin 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<
|
||||
LoginDriverController>(
|
||||
builder: (controller) =>
|
||||
controller.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: MyElevatedButton(
|
||||
onPressed:
|
||||
() async {
|
||||
if (controller
|
||||
.formKey
|
||||
.currentState!
|
||||
.validate()) {
|
||||
await Get.find<
|
||||
LoginDriverController>()
|
||||
.loginUsingCredentials(
|
||||
controller
|
||||
.passwordController
|
||||
.text,
|
||||
controller
|
||||
.emailController
|
||||
.text,
|
||||
);
|
||||
}
|
||||
},
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
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.redColor,
|
||||
),
|
||||
// Platform.isAndroid
|
||||
// ? MyElevatedButton(
|
||||
// title: 'Sign In by Facebook'.tr,
|
||||
// onPressed: () async {
|
||||
// await FacebookSignIn()
|
||||
// .signInWithFacebook();
|
||||
// },
|
||||
// kolor: AppColor.blueColor,
|
||||
// )
|
||||
// : const SizedBox(),
|
||||
!Platform.isAndroid
|
||||
? MyElevatedButton(
|
||||
title: 'Sign In by Apple'.tr,
|
||||
onPressed: () async {
|
||||
? GestureDetector(
|
||||
onTap: () async {
|
||||
User? user = await authController
|
||||
.signInWithApple();
|
||||
if (user != null) {
|
||||
@@ -246,19 +410,38 @@ class LoginCaptin extends StatelessWidget {
|
||||
// Navigate to another screen or perform other actions
|
||||
} else {}
|
||||
},
|
||||
kolor: AppColor.primaryColor,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.apple,
|
||||
color: Colors.white,
|
||||
size: 24,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Sign in with Apple'.tr,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
// MyElevatedButton(
|
||||
// title: 'Sign In by Google'.tr,
|
||||
// onPressed: () async {
|
||||
// },
|
||||
// kolor: AppColor.redColor,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
))),
|
||||
|
||||
GestureDetector(
|
||||
onTap: () => Get.to(() => ContactUsPage()),
|
||||
child: Text(
|
||||
@@ -267,40 +450,6 @@ class LoginCaptin extends StatelessWidget {
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
// AnimatedTextKit(
|
||||
// onTap: () => Get.to(() => const RegisterCaptin()),
|
||||
// animatedTexts: [
|
||||
// TypewriterAnimatedText(
|
||||
// 'Register as Driver'.tr,
|
||||
// textStyle: AppStyle.headTitle2,
|
||||
// speed: const Duration(milliseconds: 200),
|
||||
// ),
|
||||
// ],
|
||||
// totalRepeatCount: 4,
|
||||
// pause: const Duration(milliseconds: 200),
|
||||
// displayFullTextOnTap: true,
|
||||
// stopPauseOnTap: true,
|
||||
// ),
|
||||
// // IconButton(
|
||||
// onPressed: () async {
|
||||
// AC credentials = AC();
|
||||
// String apiKey = AK.payMobApikey;
|
||||
// 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) {
|
||||
// }
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// Icons.close,
|
||||
// color: AppColor.blueColor,
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
)
|
||||
@@ -414,13 +563,13 @@ class LoginCaptin extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'We use location to get accurate and nearest passengers for you'
|
||||
'We need access to your location to match you with nearby passengers and ensure accurate navigation.'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'You will choose allow all the time to be ready receive orders'
|
||||
'Please allow location access at all times to receive ride requests and ensure smooth service.'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title.copyWith(color: AppColor.greenColor),
|
||||
@@ -428,22 +577,31 @@ class LoginCaptin extends StatelessWidget {
|
||||
MyElevatedButton(
|
||||
title: "Allow Location Access".tr,
|
||||
onPressed: () async {
|
||||
// await Get.put(LocationBackgroundController()); //////
|
||||
// Request location permissions
|
||||
PermissionStatus status =
|
||||
await Permission.location.status;
|
||||
|
||||
if (!status.isGranted) {
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// getPermissionLocation();
|
||||
// getPermissionLocation();
|
||||
getLocationPermission();
|
||||
// });
|
||||
getLocationPermission(); // Function to request permission
|
||||
return;
|
||||
}
|
||||
|
||||
// Save permission status to local storage
|
||||
box.write(BoxName.locationPermission, 'true');
|
||||
controller.update();
|
||||
},
|
||||
kolor: AppColor.greenColor,
|
||||
)
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
// Optionally, navigate to app settings for manual permission control
|
||||
openAppSettings();
|
||||
},
|
||||
child: Text(
|
||||
"Open Settings".tr,
|
||||
style: const TextStyle(color: AppColor.blueColor),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user