25-5-9/1
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:service/constant/colors.dart';
|
||||
import 'package:service/constant/links.dart';
|
||||
import 'package:service/controller/functions/crud.dart';
|
||||
import 'package:service/controller/mainController/main_controller.dart';
|
||||
import 'package:service/controller/mainController/pages/best_driver_page.dart';
|
||||
import 'package:service/controller/mainController/pages/complaint.dart';
|
||||
import 'package:service/controller/mainController/pages/edit_car_plate.dart';
|
||||
import 'package:service/controller/mainController/pages/passengers_cant_regster.dart';
|
||||
import 'package:service/views/widgets/elevated_btn.dart';
|
||||
import 'package:service/views/widgets/my_dialog.dart';
|
||||
import 'package:service/views/widgets/my_textField.dart';
|
||||
|
||||
import '../../constant/style.dart';
|
||||
import '../../controller/mainController/pages/add_car.dart';
|
||||
import '../../controller/mainController/pages/contact_page.dart';
|
||||
import '../../controller/mainController/pages/drivers_cant_register.dart';
|
||||
import '../../controller/mainController/pages/welcome_call.dart';
|
||||
import '../widgets/my_scafold.dart';
|
||||
@@ -217,6 +223,252 @@ class Main extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
await mainController.getNewDriverRegister();
|
||||
// if (mainController.carPlateNotEdit.isNotEmpty) {
|
||||
Get.to(() => DriverTheBest());
|
||||
// }
|
||||
},
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
"best driver".tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: "Add Driver Who Wants to Work".tr,
|
||||
content: SizedBox(
|
||||
width: Get.width * .7,
|
||||
height: 300,
|
||||
child: Form(
|
||||
key: mainController.formKey,
|
||||
child: ListView(
|
||||
children: [
|
||||
MyTextForm(
|
||||
controller: mainController.driverNameController,
|
||||
label: 'Insert Name of Driver'.tr,
|
||||
hint: 'Insert Name of Driver'.tr,
|
||||
type: TextInputType.name),
|
||||
MyTextForm(
|
||||
controller: mainController.nationalIdController,
|
||||
label: 'Insert national ID of Driver'.tr,
|
||||
hint: 'Insert national ID of Driver'.tr,
|
||||
type: TextInputType.number),
|
||||
MyTextForm(
|
||||
controller: mainController.phoneController,
|
||||
label: 'Insert phone of Driver'.tr,
|
||||
hint: 'Insert phone of Driver'.tr,
|
||||
type: TextInputType.phone),
|
||||
MyTextForm(
|
||||
controller: mainController.licenseTypeController,
|
||||
label: 'Insert license type of Driver'.tr,
|
||||
hint: 'Insert license type of Driver'.tr,
|
||||
type: TextInputType.name),
|
||||
MyTextForm(
|
||||
controller: mainController.siteDriverController,
|
||||
label: 'Insert site of Driver'.tr,
|
||||
hint: 'Insert site of Driver'.tr,
|
||||
type: TextInputType.name),
|
||||
MyTextForm(
|
||||
controller: mainController.birthDateController,
|
||||
label: 'Insert birth_date of Driver'.tr,
|
||||
hint: 'Insert license type of Driver'.tr,
|
||||
type: TextInputType.number),
|
||||
],
|
||||
)),
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Add'.tr,
|
||||
onPressed: () async {
|
||||
if (mainController.formKey.currentState!.validate()) {
|
||||
var res = await CRUD()
|
||||
.post(link: AppLink.addDriverWantWork, payload: {
|
||||
"driver_name": mainController.driverNameController.text,
|
||||
"national_id": mainController.nationalIdController.text,
|
||||
"birth_date": mainController.birthDateController.text,
|
||||
"site": mainController.siteDriverController.text,
|
||||
"license_type":
|
||||
mainController.licenseTypeController.text,
|
||||
"phone": mainController.phoneController.text,
|
||||
});
|
||||
if (res != 'failure') {
|
||||
Get.back();
|
||||
mainController.driverNameController.clear();
|
||||
mainController.nationalIdController.clear();
|
||||
mainController.birthDateController.clear();
|
||||
mainController.licenseTypeController.clear();
|
||||
mainController.siteDriverController.clear();
|
||||
mainController.phoneController.clear();
|
||||
Get.snackbar('done', '',
|
||||
backgroundColor: AppColor.greenColor);
|
||||
}
|
||||
}
|
||||
},
|
||||
kolor: AppColor.greenColor,
|
||||
),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Cancel'.tr,
|
||||
kolor: AppColor.redColor,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
"Add Driver Who Wants to Work".tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: "Add Car Who Wants to Work".tr,
|
||||
content: SizedBox(
|
||||
width: Get.width * .7,
|
||||
height: 300,
|
||||
child: Form(
|
||||
key: mainController.formKey,
|
||||
child: ListView(
|
||||
children: [
|
||||
MyTextForm(
|
||||
controller: mainController.carOwnerWorkController,
|
||||
label: 'Insert Name of Owner'.tr,
|
||||
hint: 'Insert Name of Owner'.tr,
|
||||
type: TextInputType.name),
|
||||
MyTextForm(
|
||||
controller: mainController.carNumberController,
|
||||
label: 'Insert car_number of Driver'.tr,
|
||||
hint: 'Insert car_number of Driver'.tr,
|
||||
type: TextInputType.name),
|
||||
MyTextForm(
|
||||
controller: mainController.phoneCarController,
|
||||
label: 'Insert phone of Owner'.tr,
|
||||
hint: 'Insert phone of Owner'.tr,
|
||||
type: TextInputType.phone),
|
||||
MyTextForm(
|
||||
controller:
|
||||
mainController.manufactureYearController,
|
||||
label: 'Insert year of Car'.tr,
|
||||
hint: 'Insert year of Car'.tr,
|
||||
type: TextInputType.number),
|
||||
MyTextForm(
|
||||
controller: mainController.carModelController,
|
||||
label: 'Insert car_model of Driver'.tr,
|
||||
hint: 'Insert car_model of Driver'.tr,
|
||||
type: TextInputType.name),
|
||||
MyTextForm(
|
||||
controller: mainController.siteCarController,
|
||||
label: 'Insert site of Owner'.tr,
|
||||
hint: 'Insert site of Owner'.tr,
|
||||
type: TextInputType.name),
|
||||
MyTextForm(
|
||||
controller: mainController.carTypeController,
|
||||
label: 'Insert car_type of Driver'.tr,
|
||||
hint: 'Insert car_type of Driver'.tr,
|
||||
type: TextInputType.name),
|
||||
MyTextForm(
|
||||
controller:
|
||||
mainController.registrationDateController,
|
||||
label: 'Insert registration_date of Car'.tr,
|
||||
hint: 'Insert registration_date of Car'.tr,
|
||||
type: TextInputType.datetime),
|
||||
],
|
||||
)),
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Add'.tr,
|
||||
onPressed: () async {
|
||||
if (mainController.formKey.currentState!.validate()) {
|
||||
var res = await CRUD()
|
||||
.post(link: AppLink.addCarWantWork, payload: {
|
||||
"owner_name":
|
||||
mainController.carOwnerWorkController.text,
|
||||
"car_number": mainController.carNumberController.text,
|
||||
"manufacture_year":
|
||||
mainController.manufactureYearController.text,
|
||||
"car_model": mainController.carModelController.text,
|
||||
"car_type": mainController.carTypeController.text,
|
||||
"site": mainController.siteCarController.text,
|
||||
"registration_date":
|
||||
mainController.registrationDateController.text,
|
||||
"phone": mainController.phoneCarController.text,
|
||||
});
|
||||
if (res != 'failure') {
|
||||
Get.back();
|
||||
mainController.ownerController.clear();
|
||||
mainController.carNumberController.clear();
|
||||
mainController.manufactureYearController.clear();
|
||||
mainController.carModelController.clear();
|
||||
mainController.siteCarController.clear();
|
||||
mainController.carTypeController.clear();
|
||||
mainController.registrationDateController.clear();
|
||||
mainController.phoneController.clear();
|
||||
Get.snackbar('done', '',
|
||||
backgroundColor: AppColor.greenColor);
|
||||
}
|
||||
}
|
||||
},
|
||||
kolor: AppColor.greenColor,
|
||||
),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Cancel'.tr,
|
||||
kolor: AppColor.redColor,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
"Add Car Who Wants to Work".tr,
|
||||
style: AppStyle.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// Get.to(() => const ContactPage());
|
||||
// },
|
||||
// child: Container(
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
// child: const Center(child: Text('contact')),
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
)
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user