5/2/4
This commit is contained in:
@@ -26,6 +26,7 @@ class BoxName {
|
|||||||
static const String lastNameDriver = "lastNameDriver";
|
static const String lastNameDriver = "lastNameDriver";
|
||||||
static const String name = "name";
|
static const String name = "name";
|
||||||
static const String nameDriver = "nameDriver";
|
static const String nameDriver = "nameDriver";
|
||||||
|
static const String driverPhotoUrl = "driverPhotoUrl";
|
||||||
static const String email = "email";
|
static const String email = "email";
|
||||||
static const String emailDriver = "emailDriver";
|
static const String emailDriver = "emailDriver";
|
||||||
static const String tokens = "tokens";
|
static const String tokens = "tokens";
|
||||||
|
|||||||
49
lib/controller/auth/google_sign.dart
Normal file
49
lib/controller/auth/google_sign.dart
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
|
import 'package:SEFER/main.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:google_sign_in/google_sign_in.dart';
|
||||||
|
|
||||||
|
import '../../views/auth/captin/ai_page.dart';
|
||||||
|
|
||||||
|
class GoogleSignInHelper {
|
||||||
|
static final GoogleSignIn _googleSignIn = GoogleSignIn(
|
||||||
|
scopes: [
|
||||||
|
'email',
|
||||||
|
'profile',
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
static Future<GoogleSignInAccount?> signIn() async {
|
||||||
|
try {
|
||||||
|
final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
|
||||||
|
getDriverInfo();
|
||||||
|
Get.to(() => AiPage());
|
||||||
|
return googleUser;
|
||||||
|
} catch (error) {
|
||||||
|
print('Google Sign-In error: $error');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<void> signOut() async {
|
||||||
|
try {
|
||||||
|
await _googleSignIn.signOut();
|
||||||
|
} catch (error) {
|
||||||
|
print('Google Sign-Out error: $error');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static GoogleSignInAccount? getCurrentUser() {
|
||||||
|
return _googleSignIn.currentUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
static String? getDriverInfo() {
|
||||||
|
final GoogleSignInAccount? user = _googleSignIn.currentUser;
|
||||||
|
box.write(BoxName.driverID, user!.id);
|
||||||
|
box.write(BoxName.emailDriver, user.email);
|
||||||
|
box.write(BoxName.nameDriver, user.displayName);
|
||||||
|
box.write(BoxName.driverPhotoUrl, user.photoUrl);
|
||||||
|
print('emailDriver =${box.read(BoxName.emailDriver)}');
|
||||||
|
return user.displayName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1225,6 +1225,7 @@ class MapPassengerController extends GetxController {
|
|||||||
dataCarsLocationByPassenger = res;
|
dataCarsLocationByPassenger = res;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
|
// Get.snackbar('no car', 'message');
|
||||||
noCarString = false;
|
noCarString = false;
|
||||||
dataCarsLocationByPassenger = jsonDecode(res);
|
dataCarsLocationByPassenger = jsonDecode(res);
|
||||||
//print(dataCarsLocationByPassenger);
|
//print(dataCarsLocationByPassenger);
|
||||||
@@ -1234,22 +1235,38 @@ class MapPassengerController extends GetxController {
|
|||||||
.toString();
|
.toString();
|
||||||
gender = dataCarsLocationByPassenger['message'][carsOrder]['gender']
|
gender = dataCarsLocationByPassenger['message'][carsOrder]['gender']
|
||||||
.toString();
|
.toString();
|
||||||
}
|
// }
|
||||||
|
|
||||||
// //print('driverId==============$driverId');
|
// //print('driverId==============$driverId');
|
||||||
|
|
||||||
carsLocationByPassenger.clear(); // Clear existing markers
|
carsLocationByPassenger.clear(); // Clear existing markers
|
||||||
|
|
||||||
// late LatLng lastDriverLocation; // Initialize a variable for last location
|
// late LatLng lastDriverLocation; // Initialize a variable for last location
|
||||||
|
|
||||||
for (var i = 0; i < dataCarsLocationByPassenger['message'].length; i++) {
|
for (var i = 0;
|
||||||
var json = dataCarsLocationByPassenger['message'][i];
|
i < dataCarsLocationByPassenger['message'].length;
|
||||||
print(json);
|
i++) {
|
||||||
CarLocationModel model = CarLocationModel.fromJson(json);
|
var json = dataCarsLocationByPassenger['message'][i];
|
||||||
if (carLocationsModels.length < i + 1) {
|
print(json);
|
||||||
carLocationsModels.add(model);
|
CarLocationModel model = CarLocationModel.fromJson(json);
|
||||||
markers.add(
|
if (carLocationsModels.length < i + 1) {
|
||||||
Marker(
|
carLocationsModels.add(model);
|
||||||
|
markers.add(
|
||||||
|
Marker(
|
||||||
|
markerId: MarkerId(json['latitude']),
|
||||||
|
position: LatLng(
|
||||||
|
double.parse(json['latitude']),
|
||||||
|
double.parse(json['longitude']),
|
||||||
|
),
|
||||||
|
rotation: double.parse(json['heading']),
|
||||||
|
icon: carIcon,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
driversToken.add(json['token']);
|
||||||
|
// driversToken = json['token'];
|
||||||
|
} else {
|
||||||
|
carLocationsModels[i] = model;
|
||||||
|
markers[i] = Marker(
|
||||||
markerId: MarkerId(json['latitude']),
|
markerId: MarkerId(json['latitude']),
|
||||||
position: LatLng(
|
position: LatLng(
|
||||||
double.parse(json['latitude']),
|
double.parse(json['latitude']),
|
||||||
@@ -1257,23 +1274,10 @@ class MapPassengerController extends GetxController {
|
|||||||
),
|
),
|
||||||
rotation: double.parse(json['heading']),
|
rotation: double.parse(json['heading']),
|
||||||
icon: carIcon,
|
icon: carIcon,
|
||||||
),
|
);
|
||||||
);
|
// driversToken = json['token'];
|
||||||
driversToken.add(json['token']);
|
driversToken.add(json['token']);
|
||||||
// driversToken = json['token'];
|
}
|
||||||
} else {
|
|
||||||
carLocationsModels[i] = model;
|
|
||||||
markers[i] = Marker(
|
|
||||||
markerId: MarkerId(json['latitude']),
|
|
||||||
position: LatLng(
|
|
||||||
double.parse(json['latitude']),
|
|
||||||
double.parse(json['longitude']),
|
|
||||||
),
|
|
||||||
rotation: double.parse(json['heading']),
|
|
||||||
icon: carIcon,
|
|
||||||
);
|
|
||||||
// driversToken = json['token'];
|
|
||||||
driversToken.add(json['token']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -570,14 +570,19 @@ class MyTranslation extends Translations {
|
|||||||
'Pick your ride location on the map - Tap to confirm':
|
'Pick your ride location on the map - Tap to confirm':
|
||||||
'حدد موقع الالتقاء على الخريطة - اضغط للتأكيد',
|
'حدد موقع الالتقاء على الخريطة - اضغط للتأكيد',
|
||||||
"To Work": "إلى العمل",
|
"To Work": "إلى العمل",
|
||||||
|
'Are you want to go this site': 'هل تريد الذهاب إلى هذا المكان',
|
||||||
'Closest & Cheapest': ' الأقرب ',
|
'Closest & Cheapest': ' الأقرب ',
|
||||||
"Work Saved": "تم حفظ العمل",
|
"Work Saved": "تم حفظ العمل",
|
||||||
|
'Sefer is the ride-hailing app that is safe, reliable, and accessible.':
|
||||||
|
'"سفر: تطبيق طلب السيارة الآمن والموثوق والمعتمد"',
|
||||||
|
'With Sefer, you can get a ride to your destination in minutes.':
|
||||||
|
'مع سفر، يمكنك الحصول على رحلة إلى وجهتك في دقائق.',
|
||||||
|
'Sefer is committed to safety, and all of our captains are carefully screened and background checked.':
|
||||||
|
'تلتزم سفر بالسلامة، ويتم فحص جميع سائقينا وفحص سجلاتهم الشخصية بعناية.',
|
||||||
"To Home": "إلى المنزل",
|
"To Home": "إلى المنزل",
|
||||||
"Home Saved": "تم حفظ المنزل",
|
"Home Saved": "تم حفظ المنزل",
|
||||||
"Destination Selected":
|
"Destination selected": "تم تحديد الوجهة:",
|
||||||
"تم تحديد الوجهة:", // "Tam تحديد al-waṣʿah:", (literally "The destination has been determined:")
|
"Now select start pick": "حدد موقع الانطلاق الآن:",
|
||||||
"Now select start pick":
|
|
||||||
"حدد موقع الانطلاق الآن:", // "Ḥaddid mowāqiʿ al-inṭilāq al-ʾān:", (literally "Specify the starting location now:")
|
|
||||||
"Pick from map": "اختيار من الخريطة",
|
"Pick from map": "اختيار من الخريطة",
|
||||||
"Click here point": "حدد هذا المكان",
|
"Click here point": "حدد هذا المكان",
|
||||||
"No Car in your site. Sorry!": "لا توجد سيارة في موقعك. آسف!",
|
"No Car in your site. Sorry!": "لا توجد سيارة في موقعك. آسف!",
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class ProfileController extends GetxController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (res.toString() == 'failure') {
|
if (res.toString() == 'failure') {
|
||||||
Get.snackbar('failure', 'message');
|
// Get.snackbar('failure', 'message');
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
|
import 'package:SEFER/controller/functions/crud.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/colors.dart';
|
import 'package:SEFER/constant/colors.dart';
|
||||||
@@ -11,6 +12,7 @@ import 'package:SEFER/views/widgets/elevated_btn.dart';
|
|||||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||||
|
|
||||||
|
import '../../../constant/links.dart';
|
||||||
import '../../../controller/functions/gemeni.dart';
|
import '../../../controller/functions/gemeni.dart';
|
||||||
|
|
||||||
class AiPage extends StatelessWidget {
|
class AiPage extends StatelessWidget {
|
||||||
@@ -21,46 +23,20 @@ class AiPage extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'AI Page'.tr,
|
title: 'Documents check'.tr,
|
||||||
body: [
|
body: [
|
||||||
box.read(BoxName.countryCode) == 'USA'
|
// box.read(BoxName.countryCode) == 'USA'
|
||||||
? Positioned(
|
// ? UsaAiDocuments(scanDocumentsByApi: scanDocumentsByApi)
|
||||||
top: 3,
|
// : box.read(BoxName.countryCode) == 'Jordan'
|
||||||
left: Get.width * .2,
|
// ? JordanDocumants(contentController: contentController)
|
||||||
right: Get.width * .2,
|
// :
|
||||||
child: MyElevatedButton(
|
// EgyptDocuments(contentController: contentController),
|
||||||
title: 'Take Picture Of ID Card'.tr,
|
// box.read(BoxName.countryCode) == 'USA'
|
||||||
onPressed: () {
|
// ? usaDriverLicensWidget()
|
||||||
scanDocumentsByApi.scanDocumentsByApi();
|
// : box.read(BoxName.countryCode) == 'Jordan'
|
||||||
},
|
// ? jordanDriverLicenseWidget()
|
||||||
))
|
// :
|
||||||
: box.read(BoxName.countryCode) == 'Jordan'
|
egyptDriverLicenseWidget()
|
||||||
? Positioned(
|
|
||||||
top: 3,
|
|
||||||
left: Get.width * .1,
|
|
||||||
right: Get.width * .1,
|
|
||||||
child: MyElevatedButton(
|
|
||||||
title: 'Take Picture Of Driver License Card'.tr,
|
|
||||||
onPressed: () {
|
|
||||||
contentController.getDriverLicenseJordanContent();
|
|
||||||
},
|
|
||||||
))
|
|
||||||
: Positioned(
|
|
||||||
top: 3,
|
|
||||||
left: Get.width * .1,
|
|
||||||
right: Get.width * .1,
|
|
||||||
child: MyElevatedButton(
|
|
||||||
title: 'Take Picture Of Driver License Card'.tr, //egypt
|
|
||||||
onPressed: () {
|
|
||||||
contentController
|
|
||||||
.getDriverLicenseJordanContent(); //egypt
|
|
||||||
},
|
|
||||||
)),
|
|
||||||
box.read(BoxName.countryCode) == 'USA'
|
|
||||||
? usaDriverLicensWidget()
|
|
||||||
: box.read(BoxName.countryCode) == 'Jordan'
|
|
||||||
? jordanDriverLicenseWidget()
|
|
||||||
: egyptDriverLicenseWidget()
|
|
||||||
],
|
],
|
||||||
isleading: true);
|
isleading: true);
|
||||||
}
|
}
|
||||||
@@ -87,14 +63,14 @@ class AiPage extends StatelessWidget {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: AppStyle.boxDecoration,
|
decoration: AppStyle.boxDecoration1,
|
||||||
// height: Get.height * .4,
|
// height: Get.height * .4,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(5),
|
padding: const EdgeInsets.all(5),
|
||||||
child: contentController.responseMap.isEmpty
|
child: contentController.responseMap.isEmpty
|
||||||
? Center(
|
? Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'There is no data yet.'.tr,
|
'Take Picture Of ID Card'.tr,
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -318,45 +294,6 @@ class AiPage extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
]))
|
]))
|
||||||
: const SizedBox()
|
: const SizedBox()
|
||||||
// MyElevatedButton(
|
|
||||||
// title: 'Detect Your Face '.tr,
|
|
||||||
// onPressed: () => scanDocumentsByApi
|
|
||||||
// .checkMatchFaceApi(),
|
|
||||||
// ),
|
|
||||||
// scanDocumentsByApi.res.isEmpty
|
|
||||||
// ? const SizedBox()
|
|
||||||
// : scanDocumentsByApi.res['data']
|
|
||||||
// ['result']
|
|
||||||
// .toString() ==
|
|
||||||
// 'Same'
|
|
||||||
// ? MyElevatedButton(
|
|
||||||
// onPressed: () async {
|
|
||||||
// await registerCaptainController
|
|
||||||
// .register();
|
|
||||||
// await registerCaptainController
|
|
||||||
// .addLisence();
|
|
||||||
// // await scanDocumentsByApi
|
|
||||||
// // .uploadImagePortrate();
|
|
||||||
// },
|
|
||||||
// title:
|
|
||||||
// 'Go to next step\nscan Car License.'
|
|
||||||
// .tr,
|
|
||||||
// kolor: AppColor.greenColor,
|
|
||||||
// )
|
|
||||||
// : const SizedBox(),
|
|
||||||
// MyElevatedButton(
|
|
||||||
// title: 'get sql data',
|
|
||||||
// kolor: AppColor.yellowColor,
|
|
||||||
// onPressed: () {
|
|
||||||
// sql.deleteAllData(
|
|
||||||
// TableName.faceDetectTimes);
|
|
||||||
// sql
|
|
||||||
// .getAllData(
|
|
||||||
// TableName.faceDetectTimes)
|
|
||||||
// .then((value) => print(
|
|
||||||
// value[0]['faceDetectTimes']));
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -378,14 +315,22 @@ class AiPage extends StatelessWidget {
|
|||||||
: Column(
|
: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: AppStyle.boxDecoration,
|
decoration: AppStyle.boxDecoration1,
|
||||||
height: Get.height * .35,
|
height: Get.height * .35,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(5),
|
padding: const EdgeInsets.all(5),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: InkWell(
|
||||||
'There is no data yet.'.tr,
|
onTap: () async {
|
||||||
style: AppStyle.title,
|
await CRUD().allMethodForAI(
|
||||||
|
'name,address,dob,nationalNo,',
|
||||||
|
AppLink.uploadEgypt,
|
||||||
|
'idFront'); //egypt
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
'Take Picture Of ID Card'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
@@ -962,3 +907,73 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class EgyptDocuments extends StatelessWidget {
|
||||||
|
const EgyptDocuments({
|
||||||
|
super.key,
|
||||||
|
required this.contentController,
|
||||||
|
});
|
||||||
|
|
||||||
|
final AI contentController;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Positioned(
|
||||||
|
top: 3,
|
||||||
|
left: Get.width * .1,
|
||||||
|
right: Get.width * .1,
|
||||||
|
child: MyElevatedButton(
|
||||||
|
title: 'Take Picture Of ID Card'.tr, //egypt
|
||||||
|
onPressed: () async {
|
||||||
|
await CRUD().allMethodForAI('name,address,dob,nationalNo,',
|
||||||
|
AppLink.uploadEgypt, 'idFront'); //egypt
|
||||||
|
},
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class JordanDocumants extends StatelessWidget {
|
||||||
|
const JordanDocumants({
|
||||||
|
super.key,
|
||||||
|
required this.contentController,
|
||||||
|
});
|
||||||
|
|
||||||
|
final AI contentController;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Positioned(
|
||||||
|
top: 3,
|
||||||
|
left: Get.width * .1,
|
||||||
|
right: Get.width * .1,
|
||||||
|
child: MyElevatedButton(
|
||||||
|
title: 'Take Picture Of Driver License Card'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
contentController.getDriverLicenseJordanContent();
|
||||||
|
},
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class UsaAiDocuments extends StatelessWidget {
|
||||||
|
const UsaAiDocuments({
|
||||||
|
super.key,
|
||||||
|
required this.scanDocumentsByApi,
|
||||||
|
});
|
||||||
|
|
||||||
|
final ScanDocumentsByApi scanDocumentsByApi;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Positioned(
|
||||||
|
top: 3,
|
||||||
|
left: Get.width * .2,
|
||||||
|
right: Get.width * .2,
|
||||||
|
child: MyElevatedButton(
|
||||||
|
title: 'Take Picture Of ID Card'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
scanDocumentsByApi.scanDocumentsByApi();
|
||||||
|
},
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import 'package:SEFER/constant/box_name.dart';
|
|
||||||
import 'package:SEFER/main.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/controller/auth/captin/register_captin_controller.dart';
|
import 'package:SEFER/controller/auth/captin/register_captin_controller.dart';
|
||||||
@@ -7,6 +5,7 @@ import 'package:SEFER/views/widgets/elevated_btn.dart';
|
|||||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
|
import '../../../controller/auth/google_sign.dart';
|
||||||
|
|
||||||
class RegisterCaptin extends StatelessWidget {
|
class RegisterCaptin extends StatelessWidget {
|
||||||
const RegisterCaptin({super.key});
|
const RegisterCaptin({super.key});
|
||||||
@@ -17,150 +16,151 @@ class RegisterCaptin extends StatelessWidget {
|
|||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'Register Driver'.tr,
|
title: 'Register Driver'.tr,
|
||||||
body: [
|
body: [
|
||||||
GetBuilder<RegisterCaptainController>(
|
// GetBuilder<RegisterCaptainController>(
|
||||||
builder: (controller) => Form(
|
// builder: (controller) => Form(
|
||||||
key: controller.formKey,
|
// key: controller.formKey,
|
||||||
child: Padding(
|
// child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
// padding: const EdgeInsets.all(16.0),
|
||||||
child: SingleChildScrollView(
|
// child: SingleChildScrollView(
|
||||||
child: Container(
|
// child: Container(
|
||||||
decoration: const BoxDecoration(
|
// decoration: const BoxDecoration(
|
||||||
boxShadow: [
|
// boxShadow: [
|
||||||
BoxShadow(
|
// BoxShadow(
|
||||||
offset: Offset(3, 3),
|
// offset: Offset(3, 3),
|
||||||
color: AppColor.accentColor,
|
// color: AppColor.accentColor,
|
||||||
blurRadius: 3)
|
// blurRadius: 3)
|
||||||
],
|
// ],
|
||||||
color: AppColor.secondaryColor,
|
// color: AppColor.secondaryColor,
|
||||||
),
|
// ),
|
||||||
child: Padding(
|
// child: Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
// padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
// child: Column(
|
||||||
children: [
|
// children: [
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
width: Get.width * .8,
|
// width: Get.width * .8,
|
||||||
child: TextFormField(
|
// child: TextFormField(
|
||||||
keyboardType: TextInputType.emailAddress,
|
// keyboardType: TextInputType.emailAddress,
|
||||||
controller: controller.emailController,
|
// controller: controller.emailController,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
focusedBorder: OutlineInputBorder(
|
// focusedBorder: OutlineInputBorder(
|
||||||
borderSide: const BorderSide(
|
// borderSide: const BorderSide(
|
||||||
color: AppColor.primaryColor,
|
// color: AppColor.primaryColor,
|
||||||
width: 2.0,
|
// width: 2.0,
|
||||||
),
|
// ),
|
||||||
borderRadius: BorderRadius.circular(10),
|
// borderRadius: BorderRadius.circular(10),
|
||||||
),
|
// ),
|
||||||
fillColor: AppColor.accentColor,
|
// fillColor: AppColor.accentColor,
|
||||||
hoverColor: AppColor.accentColor,
|
// hoverColor: AppColor.accentColor,
|
||||||
focusColor: AppColor.accentColor,
|
// focusColor: AppColor.accentColor,
|
||||||
border: const OutlineInputBorder(
|
// border: const OutlineInputBorder(
|
||||||
borderRadius:
|
// borderRadius:
|
||||||
BorderRadius.all(Radius.circular(12))),
|
// BorderRadius.all(Radius.circular(12))),
|
||||||
labelText: 'Email'.tr,
|
// labelText: 'Email'.tr,
|
||||||
hintText: 'Enter your email address'.tr,
|
// hintText: 'Enter your email address'.tr,
|
||||||
),
|
// ),
|
||||||
validator: (value) {
|
// validator: (value) {
|
||||||
if (value!.isEmpty ||
|
// if (value!.isEmpty ||
|
||||||
(!value.contains('@') ||
|
// (!value.contains('@') ||
|
||||||
!value.contains('.'))) {
|
// !value.contains('.'))) {
|
||||||
return 'Please enter Your Email.'.tr;
|
// return 'Please enter Your Email.'.tr;
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
const SizedBox(
|
// const SizedBox(
|
||||||
height: 15,
|
// height: 15,
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
width: Get.width * .8,
|
// width: Get.width * .8,
|
||||||
child: TextFormField(
|
// child: TextFormField(
|
||||||
obscureText: true,
|
// obscureText: true,
|
||||||
keyboardType: TextInputType.emailAddress,
|
// keyboardType: TextInputType.emailAddress,
|
||||||
controller: controller.passwordController,
|
// controller: controller.passwordController,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
focusedBorder: OutlineInputBorder(
|
// focusedBorder: OutlineInputBorder(
|
||||||
borderSide: const BorderSide(
|
// borderSide: const BorderSide(
|
||||||
color: AppColor.primaryColor,
|
// color: AppColor.primaryColor,
|
||||||
width: 2.0,
|
// width: 2.0,
|
||||||
),
|
// ),
|
||||||
borderRadius: BorderRadius.circular(10),
|
// borderRadius: BorderRadius.circular(10),
|
||||||
),
|
// ),
|
||||||
fillColor: AppColor.accentColor,
|
// fillColor: AppColor.accentColor,
|
||||||
hoverColor: AppColor.accentColor,
|
// hoverColor: AppColor.accentColor,
|
||||||
focusColor: AppColor.accentColor,
|
// focusColor: AppColor.accentColor,
|
||||||
border: const OutlineInputBorder(
|
// border: const OutlineInputBorder(
|
||||||
borderRadius:
|
// borderRadius:
|
||||||
BorderRadius.all(Radius.circular(12))),
|
// BorderRadius.all(Radius.circular(12))),
|
||||||
labelText: 'Password'.tr,
|
// labelText: 'Password'.tr,
|
||||||
hintText: 'Enter your Password'.tr,
|
// hintText: 'Enter your Password'.tr,
|
||||||
),
|
// ),
|
||||||
validator: (value) {
|
// validator: (value) {
|
||||||
if (value!.isEmpty) {
|
// if (value!.isEmpty) {
|
||||||
return 'Please enter Your Password.'.tr;
|
// return 'Please enter Your Password.'.tr;
|
||||||
}
|
// }
|
||||||
if (value.length < 6) {
|
// if (value.length < 6) {
|
||||||
return 'Password must br at least 6 character.'
|
// return 'Password must br at least 6 character.'
|
||||||
.tr;
|
// .tr;
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
const SizedBox(
|
// const SizedBox(
|
||||||
height: 15,
|
// height: 15,
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
width: Get.width * .8,
|
// width: Get.width * .8,
|
||||||
child: TextFormField(
|
// child: TextFormField(
|
||||||
keyboardType: TextInputType.phone,
|
// keyboardType: TextInputType.phone,
|
||||||
cursorColor: AppColor.accentColor,
|
// cursorColor: AppColor.accentColor,
|
||||||
controller: controller.phoneController,
|
// controller: controller.phoneController,
|
||||||
decoration: InputDecoration(
|
// decoration: InputDecoration(
|
||||||
focusedBorder: OutlineInputBorder(
|
// focusedBorder: OutlineInputBorder(
|
||||||
borderSide: const BorderSide(
|
// borderSide: const BorderSide(
|
||||||
color: AppColor.primaryColor,
|
// color: AppColor.primaryColor,
|
||||||
width: 2.0,
|
// width: 2.0,
|
||||||
),
|
// ),
|
||||||
borderRadius: BorderRadius.circular(10),
|
// borderRadius: BorderRadius.circular(10),
|
||||||
),
|
// ),
|
||||||
focusColor: AppColor.accentColor,
|
// focusColor: AppColor.accentColor,
|
||||||
fillColor: AppColor.accentColor,
|
// fillColor: AppColor.accentColor,
|
||||||
border: const OutlineInputBorder(
|
// border: const OutlineInputBorder(
|
||||||
borderRadius:
|
// borderRadius:
|
||||||
BorderRadius.all(Radius.circular(12))),
|
// BorderRadius.all(Radius.circular(12))),
|
||||||
labelText: 'Phone'.tr,
|
// labelText: 'Phone'.tr,
|
||||||
hintText: 'Enter your phone number'.tr,
|
// hintText: 'Enter your phone number'.tr,
|
||||||
),
|
// ),
|
||||||
validator: (value) {
|
// validator: (value) {
|
||||||
if (value!.isEmpty || value.length != 10) {
|
// if (value!.isEmpty || value.length != 10) {
|
||||||
return 'Please enter your phone number.'.tr;
|
// return 'Please enter your phone number.'.tr;
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
const SizedBox(
|
// const SizedBox(
|
||||||
height: 15,
|
// height: 15,
|
||||||
),
|
// ),
|
||||||
MyElevatedButton(
|
// MyElevatedButton(
|
||||||
title: 'Next'.tr,
|
// title: 'Next'.tr,
|
||||||
onPressed: () => controller.nextToAIDetection()),
|
// onPressed: () => controller.nextToAIDetection()),
|
||||||
IconButton(
|
// ],
|
||||||
onPressed: () {
|
// ),
|
||||||
print(box.write(BoxName.countryCode, 'Jordan'));
|
// ),
|
||||||
print(box.read(BoxName.countryCode));
|
// ),
|
||||||
},
|
// ),
|
||||||
icon: const Icon(Icons.add),
|
// ),
|
||||||
)
|
// ),
|
||||||
],
|
// )
|
||||||
),
|
Center(
|
||||||
),
|
child: MyElevatedButton(
|
||||||
),
|
title: 'Sign In by Google'.tr,
|
||||||
),
|
onPressed: () async {
|
||||||
),
|
await GoogleSignInHelper.signIn();
|
||||||
),
|
},
|
||||||
)
|
kolor: AppColor.blueColor,
|
||||||
|
))
|
||||||
],
|
],
|
||||||
isleading: true);
|
isleading: true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ GetBuilder<MapPassengerController> cancelRidePage() {
|
|||||||
return GetBuilder<MapPassengerController>(
|
return GetBuilder<MapPassengerController>(
|
||||||
builder: (controller) => controller.isCancelRidePageShown
|
builder: (controller) => controller.isCancelRidePageShown
|
||||||
? Positioned(
|
? Positioned(
|
||||||
left: 60,
|
left: Get.width * .1,
|
||||||
top: 40,
|
top: Get.width * .2,
|
||||||
right: 60,
|
right: Get.width * .1,
|
||||||
// bottom: 100,
|
bottom: Get.width * .15,
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.secondaryColor,
|
color: AppColor.secondaryColor,
|
||||||
|
|||||||
@@ -219,10 +219,11 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
|
|||||||
|
|
||||||
controller.passengerLocation = controller.newMyLocation;
|
controller.passengerLocation = controller.newMyLocation;
|
||||||
controller.myDestination = LatLng(
|
controller.myDestination = LatLng(
|
||||||
double.parse(
|
double.parse(
|
||||||
res['geometry']['location']['lat'].toString()),
|
res['geometry']['location']['lat'].toString()),
|
||||||
double.parse(
|
double.parse(
|
||||||
res['geometry']['location']['lng'].toString()));
|
res['geometry']['location']['lng'].toString()),
|
||||||
|
);
|
||||||
controller.convertHintTextDestinationNewPlaces(index);
|
controller.convertHintTextDestinationNewPlaces(index);
|
||||||
|
|
||||||
controller.placesDestination = [];
|
controller.placesDestination = [];
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import '../../../constant/colors.dart';
|
|||||||
import '../../../constant/table_names.dart';
|
import '../../../constant/table_names.dart';
|
||||||
import '../../../controller/functions/toast.dart';
|
import '../../../controller/functions/toast.dart';
|
||||||
import '../../../controller/functions/tts.dart';
|
import '../../../controller/functions/tts.dart';
|
||||||
import 'form_search_start.dart';
|
|
||||||
|
|
||||||
class MainBottomMenuMap extends StatelessWidget {
|
class MainBottomMenuMap extends StatelessWidget {
|
||||||
const MainBottomMenuMap({super.key});
|
const MainBottomMenuMap({super.key});
|
||||||
@@ -103,26 +102,26 @@ class MainBottomMenuMap extends StatelessWidget {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
MyElevatedButton(
|
// MyElevatedButton(
|
||||||
title: 'Get Details of Trip'.tr,
|
// title: 'Get Details of Trip'.tr,
|
||||||
onPressed: () async {
|
// onPressed: () async {
|
||||||
controller.changeMainBottomMenuMap();
|
// controller.changeMainBottomMenuMap();
|
||||||
|
//
|
||||||
await controller.getMap(
|
// await controller.getMap(
|
||||||
'${controller.newStartPointLocation.latitude},${controller.newStartPointLocation.longitude}',
|
// '${controller.newStartPointLocation.latitude},${controller.newStartPointLocation.longitude}',
|
||||||
'${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
// '${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
||||||
);
|
// );
|
||||||
controller.currentLocationToFormPlaces =
|
// controller.currentLocationToFormPlaces =
|
||||||
false;
|
// false;
|
||||||
controller.placesDestination = [];
|
// controller.placesDestination = [];
|
||||||
// controller.isCancelRidePageShown = true;
|
// // controller.isCancelRidePageShown = true;
|
||||||
controller.clearPlacesStart();
|
// controller.clearPlacesStart();
|
||||||
controller.clearPlacesDestination();
|
// controller.clearPlacesDestination();
|
||||||
|
//
|
||||||
controller.showBottomSheet1();
|
// controller.showBottomSheet1();
|
||||||
Get.back();
|
// Get.back();
|
||||||
controller.showBottomSheet1();
|
// controller.showBottomSheet1();
|
||||||
}),
|
// }),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
controller.changeMainBottomMenuMap();
|
controller.changeMainBottomMenuMap();
|
||||||
@@ -303,7 +302,8 @@ class MainBottomMenuMap extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
controller.passengerStartLocationFromMap
|
controller.passengerStartLocationFromMap
|
||||||
? 'Pick your ride location on the map - Tap to confirm'.tr
|
? 'Pick or Tap to confirm'.tr
|
||||||
|
// ? 'Pick your ride location on the map - Tap to confirm'.tr
|
||||||
: "Click here point".tr,
|
: "Click here point".tr,
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
@@ -346,15 +346,16 @@ class MainBottomMenuMap extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
color: AppColor.redColor,
|
color: AppColor.redColor,
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: null
|
||||||
padding: const EdgeInsets.all(6),
|
// Padding(
|
||||||
child: Text(
|
// padding: const EdgeInsets.all(6),
|
||||||
'No Car in your site. Sorry!'.tr,
|
// child: Text(
|
||||||
style: AppStyle.title
|
// 'No Car in your site. Sorry!'.tr,
|
||||||
.copyWith(color: AppColor.secondaryColor),
|
// style: AppStyle.title
|
||||||
),
|
// .copyWith(color: AppColor.secondaryColor),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
controller.noCarString == false
|
controller.noCarString == false
|
||||||
? Container(
|
? Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|||||||
@@ -188,56 +188,59 @@ class PassengerProfilePage extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
// const Spacer(),
|
// const Spacer(),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Sign Out'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
LogOutController().logOutPassenger();
|
||||||
|
}),
|
||||||
|
GetBuilder<LogOutController>(
|
||||||
|
builder: (logOutController) {
|
||||||
|
return MyElevatedButton(
|
||||||
|
title: 'Delete My Account'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title:
|
||||||
|
'Are you sure to delete your account?'
|
||||||
|
.tr,
|
||||||
|
content: Form(
|
||||||
|
key: logOutController.formKey1,
|
||||||
|
child: MyTextForm(
|
||||||
|
controller: logOutController
|
||||||
|
.emailTextController,
|
||||||
|
label: 'Type your Email'.tr,
|
||||||
|
hint: 'Type your Email'.tr,
|
||||||
|
type:
|
||||||
|
TextInputType.emailAddress,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Delete My Account'.tr,
|
||||||
|
kolor: AppColor.redColor,
|
||||||
|
onPressed: () async {
|
||||||
|
await logOutController
|
||||||
|
.deletePassengerAccount();
|
||||||
|
}),
|
||||||
|
cancel: MyElevatedButton(
|
||||||
|
title: 'No I want'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
logOutController
|
||||||
|
.emailTextController
|
||||||
|
.clear();
|
||||||
|
logOutController.update();
|
||||||
|
Get.back();
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
Positioned(
|
|
||||||
left: 70,
|
|
||||||
bottom: 100,
|
|
||||||
right: 70,
|
|
||||||
child: MyElevatedButton(
|
|
||||||
title: 'Sign Out'.tr,
|
|
||||||
onPressed: () {
|
|
||||||
LogOutController().logOutPassenger();
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
left: 70,
|
|
||||||
bottom: 10,
|
|
||||||
right: 70,
|
|
||||||
child: GetBuilder<LogOutController>(builder: (logOutController) {
|
|
||||||
return MyElevatedButton(
|
|
||||||
title: 'Delete My Account'.tr,
|
|
||||||
onPressed: () {
|
|
||||||
Get.defaultDialog(
|
|
||||||
title: 'Are you sure to delete your account?'.tr,
|
|
||||||
content: Form(
|
|
||||||
key: logOutController.formKey1,
|
|
||||||
child: MyTextForm(
|
|
||||||
controller: logOutController.emailTextController,
|
|
||||||
label: 'Type your Email'.tr,
|
|
||||||
hint: 'Type your Email'.tr,
|
|
||||||
type: TextInputType.emailAddress,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
confirm: MyElevatedButton(
|
|
||||||
title: 'Delete My Account'.tr,
|
|
||||||
kolor: AppColor.redColor,
|
|
||||||
onPressed: () async {
|
|
||||||
await logOutController.deletePassengerAccount();
|
|
||||||
}),
|
|
||||||
cancel: MyElevatedButton(
|
|
||||||
title: 'No I want'.tr,
|
|
||||||
onPressed: () {
|
|
||||||
logOutController.emailTextController.clear();
|
|
||||||
logOutController.update();
|
|
||||||
Get.back();
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -320,64 +323,67 @@ class CountryPicker extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GetBuilder<ProfileController>(builder: (controller) {
|
return GetBuilder<ProfileController>(builder: (controller) {
|
||||||
return ListView(
|
return Padding(
|
||||||
children: [
|
padding: const EdgeInsets.all(20),
|
||||||
const SizedBox(
|
child: ListView(
|
||||||
height: 20,
|
children: [
|
||||||
),
|
const SizedBox(
|
||||||
Text(
|
height: 20,
|
||||||
"Select Your Country".tr,
|
),
|
||||||
style: AppStyle.headTitle2,
|
Text(
|
||||||
textAlign: TextAlign.center,
|
"Select Your Country".tr,
|
||||||
),
|
style: AppStyle.headTitle2,
|
||||||
// const SizedBox(
|
|
||||||
// height: 20,
|
|
||||||
// ),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
child: Text(
|
|
||||||
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
|
|
||||||
.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
),
|
// const SizedBox(
|
||||||
SizedBox(
|
// height: 20,
|
||||||
height: 200,
|
// ),
|
||||||
child: CupertinoPicker(
|
Padding(
|
||||||
itemExtent: 32,
|
padding: const EdgeInsets.all(10),
|
||||||
onSelectedItemChanged: (int index) {
|
child: Text(
|
||||||
controller.setCountry(countryOptions[index]);
|
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
|
||||||
box.write(BoxName.countryCode,
|
.tr,
|
||||||
countryOptions[index]); // Save in English
|
style: AppStyle.title,
|
||||||
},
|
textAlign: TextAlign.center,
|
||||||
children: List.generate(
|
),
|
||||||
countryOptions.length,
|
),
|
||||||
(index) => Center(
|
SizedBox(
|
||||||
child: Text(
|
height: 200,
|
||||||
countryOptions[index]
|
child: CupertinoPicker(
|
||||||
.tr, // Display translated if not English
|
itemExtent: 32,
|
||||||
style: AppStyle.title,
|
onSelectedItemChanged: (int index) {
|
||||||
|
controller.setCountry(countryOptions[index]);
|
||||||
|
box.write(BoxName.countryCode,
|
||||||
|
countryOptions[index]); // Save in English
|
||||||
|
},
|
||||||
|
children: List.generate(
|
||||||
|
countryOptions.length,
|
||||||
|
(index) => Center(
|
||||||
|
child: Text(
|
||||||
|
countryOptions[index]
|
||||||
|
.tr, // Display translated if not English
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title: 'Select Country'.tr, // Use translated text for button
|
title: 'Select Country'.tr, // Use translated text for button
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.find<LoginController>().saveCountryCode(controller
|
Get.find<LoginController>().saveCountryCode(controller
|
||||||
.selectedCountry
|
.selectedCountry
|
||||||
.toString()); // No conversion needed
|
.toString()); // No conversion needed
|
||||||
box.write(
|
box.write(
|
||||||
BoxName.countryCode, //
|
BoxName.countryCode, //
|
||||||
controller.selectedCountry); // Already saved in English
|
controller.selectedCountry); // Already saved in English
|
||||||
Get.snackbar(controller.selectedCountry.toString().tr, '');
|
Get.snackbar(controller.selectedCountry.toString().tr, '');
|
||||||
Get.off(LoginPage());
|
Get.off(LoginPage());
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -403,65 +409,68 @@ class CountryPickerFromSetting extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GetBuilder<ProfileController>(builder: (controller) {
|
return GetBuilder<ProfileController>(builder: (controller) {
|
||||||
return ListView(
|
return Padding(
|
||||||
children: [
|
padding: const EdgeInsets.all(20.0),
|
||||||
const SizedBox(
|
child: ListView(
|
||||||
height: 20,
|
children: [
|
||||||
),
|
const SizedBox(
|
||||||
Text(
|
height: 20,
|
||||||
"Select Your Country".tr,
|
),
|
||||||
style: AppStyle.headTitle2,
|
Text(
|
||||||
textAlign: TextAlign.center,
|
"Select Your Country".tr,
|
||||||
),
|
style: AppStyle.headTitle2,
|
||||||
// const SizedBox(
|
|
||||||
// height: 20,
|
|
||||||
// ),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
child: Text(
|
|
||||||
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
|
|
||||||
.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
),
|
// const SizedBox(
|
||||||
SizedBox(
|
// height: 20,
|
||||||
height: 200,
|
// ),
|
||||||
child: CupertinoPicker(
|
Padding(
|
||||||
itemExtent: 32,
|
padding: const EdgeInsets.all(10),
|
||||||
onSelectedItemChanged: (int index) {
|
child: Text(
|
||||||
controller.setCountry(countryOptions[index]);
|
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
|
||||||
box.write(BoxName.countryCode,
|
.tr,
|
||||||
countryOptions[index]); // Save in English
|
style: AppStyle.title,
|
||||||
},
|
textAlign: TextAlign.center,
|
||||||
children: List.generate(
|
),
|
||||||
countryOptions.length,
|
),
|
||||||
(index) => Center(
|
SizedBox(
|
||||||
child: Text(
|
height: 200,
|
||||||
countryOptions[index]
|
child: CupertinoPicker(
|
||||||
.tr, // Display translated if not English
|
itemExtent: 32,
|
||||||
style: AppStyle.title,
|
onSelectedItemChanged: (int index) {
|
||||||
|
controller.setCountry(countryOptions[index]);
|
||||||
|
box.write(BoxName.countryCode,
|
||||||
|
countryOptions[index]); // Save in English
|
||||||
|
},
|
||||||
|
children: List.generate(
|
||||||
|
countryOptions.length,
|
||||||
|
(index) => Center(
|
||||||
|
child: Text(
|
||||||
|
countryOptions[index]
|
||||||
|
.tr, // Display translated if not English
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title: 'Select Country'.tr, // Use translated text for button
|
title: 'Select Country'.tr, // Use translated text for button
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
loginController.saveCountryCode(controller.selectedCountry
|
loginController.saveCountryCode(controller.selectedCountry
|
||||||
.toString()); // No conversion needed
|
.toString()); // No conversion needed
|
||||||
box.write(
|
box.write(
|
||||||
BoxName.countryCode, //
|
BoxName.countryCode, //
|
||||||
controller.selectedCountry); // Already saved in English
|
controller.selectedCountry); // Already saved in English
|
||||||
Get.snackbar(controller.selectedCountry.toString().tr, '',
|
Get.snackbar(controller.selectedCountry.toString().tr, '',
|
||||||
backgroundColor: AppColor.greenColor);
|
backgroundColor: AppColor.greenColor);
|
||||||
// Get.back();//
|
// Get.back();//
|
||||||
// Get.back();
|
// Get.back();
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import flutter_local_notifications
|
|||||||
import flutter_secure_storage_macos
|
import flutter_secure_storage_macos
|
||||||
import flutter_tts
|
import flutter_tts
|
||||||
import geolocator_apple
|
import geolocator_apple
|
||||||
|
import google_sign_in_ios
|
||||||
import iris_method_channel
|
import iris_method_channel
|
||||||
import just_audio
|
import just_audio
|
||||||
import location
|
import location
|
||||||
@@ -37,6 +38,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||||||
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
|
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
|
||||||
FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin"))
|
FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin"))
|
||||||
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
||||||
|
FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))
|
||||||
IrisMethodChannelPlugin.register(with: registry.registrar(forPlugin: "IrisMethodChannelPlugin"))
|
IrisMethodChannelPlugin.register(with: registry.registrar(forPlugin: "IrisMethodChannelPlugin"))
|
||||||
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
|
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
|
||||||
LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin"))
|
LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin"))
|
||||||
|
|||||||
68
pubspec.lock
68
pubspec.lock
@@ -856,6 +856,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.1-dev"
|
version: "0.0.1-dev"
|
||||||
|
google_identity_services_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: google_identity_services_web
|
||||||
|
sha256: "9482364c9f8b7bd36902572ebc3a7c2b5c8ee57a9c93e6eb5099c1a9ec5265d8"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.3.1+1"
|
||||||
google_maps:
|
google_maps:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -908,18 +916,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: google_mlkit_commons
|
name: google_mlkit_commons
|
||||||
sha256: "046586b381cdd139f7f6a05ad6998f7e339d061bd70158249907358394b5f496"
|
sha256: "27d626c66a181351a953eba5b6ff1ff123aadb891b4dab085b292118f039d6ac"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.1"
|
version: "0.7.1"
|
||||||
google_mlkit_text_recognition:
|
google_mlkit_text_recognition:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: google_mlkit_text_recognition
|
name: google_mlkit_text_recognition
|
||||||
sha256: d484de2a10961a6f0ff8b54cc92b71bfbb0e65509be0903edca0e1f9256ca4c2
|
sha256: "89c848329355f165ff17ca8645cab5998770e9e25e431fe6dd8261ed9cf7bdc4"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.11.0"
|
version: "0.13.0"
|
||||||
google_polyline_algorithm:
|
google_polyline_algorithm:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -928,6 +936,46 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.0"
|
version: "3.1.0"
|
||||||
|
google_sign_in:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: google_sign_in
|
||||||
|
sha256: "0b8787cb9c1a68ad398e8010e8c8766bfa33556d2ab97c439fb4137756d7308f"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.2.1"
|
||||||
|
google_sign_in_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: google_sign_in_android
|
||||||
|
sha256: "7647893c65e6720973f0e579051c8f84b877b486614d9f70a404259c41a4632e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.23"
|
||||||
|
google_sign_in_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: google_sign_in_ios
|
||||||
|
sha256: a058c9880be456f21e2e8571c1126eaacd570bdc5b6c6d9d15aea4bdf22ca9fe
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.7.6"
|
||||||
|
google_sign_in_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: google_sign_in_platform_interface
|
||||||
|
sha256: "1f6e5787d7a120cc0359ddf315c92309069171306242e181c09472d1b00a2971"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.5"
|
||||||
|
google_sign_in_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: google_sign_in_web
|
||||||
|
sha256: fc0f14ed45ea616a6cfb4d1c7534c2221b7092cc4f29a709f0c3053cc3e821bd
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.12.4"
|
||||||
graphs:
|
graphs:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1933,6 +1981,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
|
web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: web
|
||||||
|
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.5.1"
|
||||||
web_socket_channel:
|
web_socket_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -2014,5 +2070,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.2"
|
version: "3.1.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.2.3 <4.0.0"
|
dart: ">=3.3.0 <4.0.0"
|
||||||
flutter: ">=3.16.6"
|
flutter: ">=3.19.0"
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ dependencies:
|
|||||||
google_maps_flutter: ^2.5.0
|
google_maps_flutter: ^2.5.0
|
||||||
sqflite: ^2.3.0
|
sqflite: ^2.3.0
|
||||||
path: ^1.8.3
|
path: ^1.8.3
|
||||||
# google_sign_in: ^6.1.4
|
|
||||||
lottie: ^2.5.0
|
lottie: ^2.5.0
|
||||||
intl: ^0.18.1
|
intl: ^0.18.1
|
||||||
google_fonts: ^ 4.0.4
|
google_fonts: ^ 4.0.4
|
||||||
@@ -39,7 +38,6 @@ dependencies:
|
|||||||
flutter_font_icons: ^2.2.5
|
flutter_font_icons: ^2.2.5
|
||||||
device_info_plus: ^9.1.0
|
device_info_plus: ^9.1.0
|
||||||
image_picker: ^1.0.4
|
image_picker: ^1.0.4
|
||||||
google_mlkit_text_recognition: ^0.11.0
|
|
||||||
flutter_stripe: ^9.5.0+1
|
flutter_stripe: ^9.5.0+1
|
||||||
camera: ^0.10.5+5
|
camera: ^0.10.5+5
|
||||||
flutter_widget_from_html: ^0.14.6
|
flutter_widget_from_html: ^0.14.6
|
||||||
@@ -57,13 +55,13 @@ dependencies:
|
|||||||
vibration: ^1.8.4
|
vibration: ^1.8.4
|
||||||
wakelock_plus:
|
wakelock_plus:
|
||||||
background_location: ^0.13.0
|
background_location: ^0.13.0
|
||||||
# flutter_sound: ^9.2.13
|
|
||||||
record: ^5.0.5
|
record: ^5.0.5
|
||||||
dio: ^5.4.3+1
|
dio: ^5.4.3+1
|
||||||
# paymob_payment: ^0.0.1+1
|
|
||||||
webview_flutter: ^4.7.0
|
webview_flutter: ^4.7.0
|
||||||
just_audio: ^0.9.37
|
just_audio: ^0.9.37
|
||||||
share: ^2.0.4
|
share: ^2.0.4
|
||||||
|
google_sign_in: ^6.2.1
|
||||||
|
google_mlkit_text_recognition: ^0.13.0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user