This commit is contained in:
Hamza-Ayed
2024-05-11 00:58:11 +03:00
parent b473a9ce09
commit 750d980fcb
38 changed files with 329 additions and 1814 deletions

View File

@@ -36,7 +36,7 @@ class AiPage extends StatelessWidget {
child: InkWell(
onTap: () async {
await CRUD().allMethodForAI(
'name,address,dob,nationalNo,',
'firstName,fullName,address,dob,nationalNo,',
AppLink.uploadEgypt,
'idFront'); //egypt
},

View File

@@ -18,14 +18,13 @@ import '../../widgets/mycircular.dart';
import 'register_captin.dart';
class LoginCaptin extends StatelessWidget {
// final controller = Get.put(LoginController());
final controller = Get.put(LoginCaptinController());
LoginCaptin({super.key});
@override
Widget build(BuildContext context) {
Get.put(LoginCaptinController());
final controller = Get.put(LoginController());
// Get.put(LoginCaptinController());
return GetBuilder<LoginCaptinController>(
builder: (controller) => MyScafolld(
title: 'Login Driver'.tr,
@@ -35,6 +34,8 @@ class LoginCaptin extends StatelessWidget {
agreedPage()
else if (box.read(BoxName.countryCode) == null)
CountryPicker()
else if (box.read(BoxName.locationPermission) != 'true')
locationPermissionDialog()
else
SingleChildScrollView(
child: Column(
@@ -155,21 +156,17 @@ class LoginCaptin extends StatelessWidget {
return null;
},
),
GetBuilder<LoginCaptinController>(
builder: (controller) => controller
.isloading
? const MyCircularProgressIndicator()
: MyElevatedButton(
onPressed: () {
if (controller
.formKey.currentState!
.validate()) {
controller.login();
}
},
title: 'Submit'.tr,
),
)
controller.isloading
? const MyCircularProgressIndicator()
: MyElevatedButton(
onPressed: () {
if (controller.formKey.currentState!
.validate()) {
controller.login();
}
},
title: 'Submit'.tr,
),
],
),
),
@@ -314,4 +311,38 @@ class LoginCaptin extends StatelessWidget {
),
);
}
locationPermissionDialog() {
return Padding(
padding: const EdgeInsets.all(16),
child: Container(
height: Get.height * .4,
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
'We use location to get accurate and nearest passengers for you'
.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
),
MyElevatedButton(
title: 'Grant Location'.tr,
onPressed: () async {
await controller.getLocationPermission();
},
kolor: AppColor.greenColor,
)
],
),
),
),
),
);
}
}