5/2/4
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/controller/functions/crud.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.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/mycircular.dart';
|
||||
|
||||
import '../../../constant/links.dart';
|
||||
import '../../../controller/functions/gemeni.dart';
|
||||
|
||||
class AiPage extends StatelessWidget {
|
||||
@@ -21,46 +23,20 @@ class AiPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'AI Page'.tr,
|
||||
title: 'Documents check'.tr,
|
||||
body: [
|
||||
box.read(BoxName.countryCode) == 'USA'
|
||||
? Positioned(
|
||||
top: 3,
|
||||
left: Get.width * .2,
|
||||
right: Get.width * .2,
|
||||
child: MyElevatedButton(
|
||||
title: 'Take Picture Of ID Card'.tr,
|
||||
onPressed: () {
|
||||
scanDocumentsByApi.scanDocumentsByApi();
|
||||
},
|
||||
))
|
||||
: box.read(BoxName.countryCode) == 'Jordan'
|
||||
? 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()
|
||||
// box.read(BoxName.countryCode) == 'USA'
|
||||
// ? UsaAiDocuments(scanDocumentsByApi: scanDocumentsByApi)
|
||||
// : box.read(BoxName.countryCode) == 'Jordan'
|
||||
// ? JordanDocumants(contentController: contentController)
|
||||
// :
|
||||
// EgyptDocuments(contentController: contentController),
|
||||
// box.read(BoxName.countryCode) == 'USA'
|
||||
// ? usaDriverLicensWidget()
|
||||
// : box.read(BoxName.countryCode) == 'Jordan'
|
||||
// ? jordanDriverLicenseWidget()
|
||||
// :
|
||||
egyptDriverLicenseWidget()
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
@@ -87,14 +63,14 @@ class AiPage extends StatelessWidget {
|
||||
child: ListView(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
// height: Get.height * .4,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: contentController.responseMap.isEmpty
|
||||
? Center(
|
||||
child: Text(
|
||||
'There is no data yet.'.tr,
|
||||
'Take Picture Of ID Card'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)
|
||||
@@ -318,45 +294,6 @@ class AiPage extends StatelessWidget {
|
||||
)
|
||||
]))
|
||||
: 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(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: Get.height * .35,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'There is no data yet.'.tr,
|
||||
style: AppStyle.title,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
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:get/get.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 '../../../constant/colors.dart';
|
||||
import '../../../controller/auth/google_sign.dart';
|
||||
|
||||
class RegisterCaptin extends StatelessWidget {
|
||||
const RegisterCaptin({super.key});
|
||||
@@ -17,150 +16,151 @@ class RegisterCaptin extends StatelessWidget {
|
||||
return MyScafolld(
|
||||
title: 'Register Driver'.tr,
|
||||
body: [
|
||||
GetBuilder<RegisterCaptainController>(
|
||||
builder: (controller) => Form(
|
||||
key: controller.formKey,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
offset: Offset(3, 3),
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 3)
|
||||
],
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .8,
|
||||
child: 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,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .8,
|
||||
child: 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: 'Enter your Password'.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;
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .8,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.phone,
|
||||
cursorColor: AppColor.accentColor,
|
||||
controller: controller.phoneController,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
focusColor: AppColor.accentColor,
|
||||
fillColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(12))),
|
||||
labelText: 'Phone'.tr,
|
||||
hintText: 'Enter your phone number'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || value.length != 10) {
|
||||
return 'Please enter your phone number.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () => controller.nextToAIDetection()),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
print(box.write(BoxName.countryCode, 'Jordan'));
|
||||
print(box.read(BoxName.countryCode));
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
// GetBuilder<RegisterCaptainController>(
|
||||
// builder: (controller) => Form(
|
||||
// key: controller.formKey,
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(16.0),
|
||||
// child: SingleChildScrollView(
|
||||
// child: Container(
|
||||
// decoration: const BoxDecoration(
|
||||
// boxShadow: [
|
||||
// BoxShadow(
|
||||
// offset: Offset(3, 3),
|
||||
// color: AppColor.accentColor,
|
||||
// blurRadius: 3)
|
||||
// ],
|
||||
// color: AppColor.secondaryColor,
|
||||
// ),
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(16),
|
||||
// child: Column(
|
||||
// children: [
|
||||
// SizedBox(
|
||||
// width: Get.width * .8,
|
||||
// child: 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,
|
||||
// ),
|
||||
// SizedBox(
|
||||
// width: Get.width * .8,
|
||||
// child: 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: 'Enter your Password'.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;
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: 15,
|
||||
// ),
|
||||
// SizedBox(
|
||||
// width: Get.width * .8,
|
||||
// child: TextFormField(
|
||||
// keyboardType: TextInputType.phone,
|
||||
// cursorColor: AppColor.accentColor,
|
||||
// controller: controller.phoneController,
|
||||
// decoration: InputDecoration(
|
||||
// focusedBorder: OutlineInputBorder(
|
||||
// borderSide: const BorderSide(
|
||||
// color: AppColor.primaryColor,
|
||||
// width: 2.0,
|
||||
// ),
|
||||
// borderRadius: BorderRadius.circular(10),
|
||||
// ),
|
||||
// focusColor: AppColor.accentColor,
|
||||
// fillColor: AppColor.accentColor,
|
||||
// border: const OutlineInputBorder(
|
||||
// borderRadius:
|
||||
// BorderRadius.all(Radius.circular(12))),
|
||||
// labelText: 'Phone'.tr,
|
||||
// hintText: 'Enter your phone number'.tr,
|
||||
// ),
|
||||
// validator: (value) {
|
||||
// if (value!.isEmpty || value.length != 10) {
|
||||
// return 'Please enter your phone number.'.tr;
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: 15,
|
||||
// ),
|
||||
// MyElevatedButton(
|
||||
// title: 'Next'.tr,
|
||||
// onPressed: () => controller.nextToAIDetection()),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
Center(
|
||||
child: MyElevatedButton(
|
||||
title: 'Sign In by Google'.tr,
|
||||
onPressed: () async {
|
||||
await GoogleSignInHelper.signIn();
|
||||
},
|
||||
kolor: AppColor.blueColor,
|
||||
))
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ GetBuilder<MapPassengerController> cancelRidePage() {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => controller.isCancelRidePageShown
|
||||
? Positioned(
|
||||
left: 60,
|
||||
top: 40,
|
||||
right: 60,
|
||||
// bottom: 100,
|
||||
left: Get.width * .1,
|
||||
top: Get.width * .2,
|
||||
right: Get.width * .1,
|
||||
bottom: Get.width * .15,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
|
||||
@@ -219,10 +219,11 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
|
||||
|
||||
controller.passengerLocation = controller.newMyLocation;
|
||||
controller.myDestination = LatLng(
|
||||
double.parse(
|
||||
res['geometry']['location']['lat'].toString()),
|
||||
double.parse(
|
||||
res['geometry']['location']['lng'].toString()));
|
||||
double.parse(
|
||||
res['geometry']['location']['lat'].toString()),
|
||||
double.parse(
|
||||
res['geometry']['location']['lng'].toString()),
|
||||
);
|
||||
controller.convertHintTextDestinationNewPlaces(index);
|
||||
|
||||
controller.placesDestination = [];
|
||||
|
||||
@@ -12,7 +12,6 @@ import '../../../constant/colors.dart';
|
||||
import '../../../constant/table_names.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/functions/tts.dart';
|
||||
import 'form_search_start.dart';
|
||||
|
||||
class MainBottomMenuMap extends StatelessWidget {
|
||||
const MainBottomMenuMap({super.key});
|
||||
@@ -103,26 +102,26 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Get Details of Trip'.tr,
|
||||
onPressed: () async {
|
||||
controller.changeMainBottomMenuMap();
|
||||
|
||||
await controller.getMap(
|
||||
'${controller.newStartPointLocation.latitude},${controller.newStartPointLocation.longitude}',
|
||||
'${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
||||
);
|
||||
controller.currentLocationToFormPlaces =
|
||||
false;
|
||||
controller.placesDestination = [];
|
||||
// controller.isCancelRidePageShown = true;
|
||||
controller.clearPlacesStart();
|
||||
controller.clearPlacesDestination();
|
||||
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
controller.showBottomSheet1();
|
||||
}),
|
||||
// MyElevatedButton(
|
||||
// title: 'Get Details of Trip'.tr,
|
||||
// onPressed: () async {
|
||||
// controller.changeMainBottomMenuMap();
|
||||
//
|
||||
// await controller.getMap(
|
||||
// '${controller.newStartPointLocation.latitude},${controller.newStartPointLocation.longitude}',
|
||||
// '${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
||||
// );
|
||||
// controller.currentLocationToFormPlaces =
|
||||
// false;
|
||||
// controller.placesDestination = [];
|
||||
// // controller.isCancelRidePageShown = true;
|
||||
// controller.clearPlacesStart();
|
||||
// controller.clearPlacesDestination();
|
||||
//
|
||||
// controller.showBottomSheet1();
|
||||
// Get.back();
|
||||
// controller.showBottomSheet1();
|
||||
// }),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
controller.changeMainBottomMenuMap();
|
||||
@@ -303,7 +302,8 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
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,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
@@ -346,15 +346,16 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(6),
|
||||
child: Text(
|
||||
'No Car in your site. Sorry!'.tr,
|
||||
style: AppStyle.title
|
||||
.copyWith(color: AppColor.secondaryColor),
|
||||
),
|
||||
child: null
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(6),
|
||||
// child: Text(
|
||||
// 'No Car in your site. Sorry!'.tr,
|
||||
// style: AppStyle.title
|
||||
// .copyWith(color: AppColor.secondaryColor),
|
||||
// ),
|
||||
// ),
|
||||
),
|
||||
),
|
||||
controller.noCarString == false
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
|
||||
@@ -188,56 +188,59 @@ class PassengerProfilePage extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
// 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
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<ProfileController>(builder: (controller) {
|
||||
return ListView(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text(
|
||||
"Select Your Country".tr,
|
||||
style: AppStyle.headTitle2,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
// 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,
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text(
|
||||
"Select Your Country".tr,
|
||||
style: AppStyle.headTitle2,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 200,
|
||||
child: CupertinoPicker(
|
||||
itemExtent: 32,
|
||||
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,
|
||||
// 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,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 200,
|
||||
child: CupertinoPicker(
|
||||
itemExtent: 32,
|
||||
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(
|
||||
title: 'Select Country'.tr, // Use translated text for button
|
||||
onPressed: () {
|
||||
Get.find<LoginController>().saveCountryCode(controller
|
||||
.selectedCountry
|
||||
.toString()); // No conversion needed
|
||||
box.write(
|
||||
BoxName.countryCode, //
|
||||
controller.selectedCountry); // Already saved in English
|
||||
Get.snackbar(controller.selectedCountry.toString().tr, '');
|
||||
Get.off(LoginPage());
|
||||
},
|
||||
)
|
||||
],
|
||||
MyElevatedButton(
|
||||
title: 'Select Country'.tr, // Use translated text for button
|
||||
onPressed: () {
|
||||
Get.find<LoginController>().saveCountryCode(controller
|
||||
.selectedCountry
|
||||
.toString()); // No conversion needed
|
||||
box.write(
|
||||
BoxName.countryCode, //
|
||||
controller.selectedCountry); // Already saved in English
|
||||
Get.snackbar(controller.selectedCountry.toString().tr, '');
|
||||
Get.off(LoginPage());
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -403,65 +409,68 @@ class CountryPickerFromSetting extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<ProfileController>(builder: (controller) {
|
||||
return ListView(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text(
|
||||
"Select Your Country".tr,
|
||||
style: AppStyle.headTitle2,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
// 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,
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: ListView(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text(
|
||||
"Select Your Country".tr,
|
||||
style: AppStyle.headTitle2,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 200,
|
||||
child: CupertinoPicker(
|
||||
itemExtent: 32,
|
||||
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,
|
||||
// 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,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 200,
|
||||
child: CupertinoPicker(
|
||||
itemExtent: 32,
|
||||
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(
|
||||
title: 'Select Country'.tr, // Use translated text for button
|
||||
onPressed: () async {
|
||||
loginController.saveCountryCode(controller.selectedCountry
|
||||
.toString()); // No conversion needed
|
||||
box.write(
|
||||
BoxName.countryCode, //
|
||||
controller.selectedCountry); // Already saved in English
|
||||
Get.snackbar(controller.selectedCountry.toString().tr, '',
|
||||
backgroundColor: AppColor.greenColor);
|
||||
// Get.back();//
|
||||
// Get.back();
|
||||
},
|
||||
)
|
||||
],
|
||||
MyElevatedButton(
|
||||
title: 'Select Country'.tr, // Use translated text for button
|
||||
onPressed: () async {
|
||||
loginController.saveCountryCode(controller.selectedCountry
|
||||
.toString()); // No conversion needed
|
||||
box.write(
|
||||
BoxName.countryCode, //
|
||||
controller.selectedCountry); // Already saved in English
|
||||
Get.snackbar(controller.selectedCountry.toString().tr, '',
|
||||
backgroundColor: AppColor.greenColor);
|
||||
// Get.back();//
|
||||
// Get.back();
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user