11/19/1
This commit is contained in:
@@ -50,7 +50,7 @@ class AiPage extends StatelessWidget {
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: Get.height * .35,
|
||||
height: Get.height * .4,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: scanDocumentsByApi.responseMap.isEmpty
|
||||
@@ -78,7 +78,7 @@ class AiPage extends StatelessWidget {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Name :${scanDocumentsByApi.responseMap['data']['ocr']['name'].toString()}',
|
||||
'Name :${scanDocumentsByApi.name}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Row(
|
||||
@@ -87,7 +87,7 @@ class AiPage extends StatelessWidget {
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Drivers License Class: ${scanDocumentsByApi.responseMap['data']['ocr']['dlClass'].toString()}',
|
||||
'Drivers License Class: ${scanDocumentsByApi.licenseClass}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Image.memory(
|
||||
@@ -108,7 +108,7 @@ class AiPage extends StatelessWidget {
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Document Number: ${scanDocumentsByApi.responseMap['data']['ocr']['documentNumber'].toString()}',
|
||||
'Document Number: ${scanDocumentsByApi.documentNo}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Image.memory(
|
||||
@@ -118,7 +118,7 @@ class AiPage extends StatelessWidget {
|
||||
),
|
||||
]),
|
||||
Text(
|
||||
'Address: ${scanDocumentsByApi.responseMap['data']['ocr']['address'].toString()}',
|
||||
'Address: ${scanDocumentsByApi.address}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Row(
|
||||
@@ -127,21 +127,21 @@ class AiPage extends StatelessWidget {
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Height: ${scanDocumentsByApi.responseMap['data']['ocr']['height'].toString()}',
|
||||
'Height: ${scanDocumentsByApi.height}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
'Postal Code: ${scanDocumentsByApi.responseMap['data']['ocr']['addressPostalCode'].toString()}',
|
||||
'Postal Code: ${scanDocumentsByApi.postalCode}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
'Sex: ${scanDocumentsByApi.responseMap['data']['ocr']['sex'].toString()}',
|
||||
'Sex: ${scanDocumentsByApi.sex}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'Jurisdiction Code: ${scanDocumentsByApi.responseMap['data']['ocr']['addressJurisdictionCode'].toString()}',
|
||||
'Territorial Code: ${scanDocumentsByApi.stateCode}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Row(
|
||||
@@ -150,7 +150,7 @@ class AiPage extends StatelessWidget {
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Expiry Date: ${scanDocumentsByApi.responseMap['data']['ocr']['dateOfExpiry'].toString()}',
|
||||
'Expiry Date: ${scanDocumentsByApi.expireDate}',
|
||||
style: DateTime.parse(
|
||||
scanDocumentsByApi
|
||||
.responseMap['data']
|
||||
@@ -168,7 +168,7 @@ class AiPage extends StatelessWidget {
|
||||
.greenColor),
|
||||
),
|
||||
Text(
|
||||
'Date of Birth: ${scanDocumentsByApi.responseMap['data']['ocr']['dateOfBirth'].toString()}',
|
||||
'Date of Birth: ${scanDocumentsByApi.dob}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
@@ -207,7 +207,8 @@ class AiPage extends StatelessWidget {
|
||||
)
|
||||
: const SizedBox(),
|
||||
MyElevatedButton(
|
||||
title: 'title',
|
||||
title: 'get sql data',
|
||||
kolor: AppColor.yellowColor,
|
||||
onPressed: () {
|
||||
// sql.deleteAllData(TableName.faceDetectTimes);
|
||||
sql
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../../constant/colors.dart';
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../../../controller/functions/camer_controller.dart';
|
||||
import '../../../../controller/functions/ocr_controller.dart';
|
||||
import '../../../widgets/my_scafold.dart';
|
||||
|
||||
class CameraLisencePage extends StatelessWidget {
|
||||
CameraLisencePage.CameraLicensePage({super.key});
|
||||
final CameraClassController cameraClassController =
|
||||
Get.put(CameraClassController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Scan Driver License'.tr,
|
||||
body: [
|
||||
Column(children: [
|
||||
Text(
|
||||
'Please put your licence in these border'.tr,
|
||||
style: AppStyle.title.copyWith(color: AppColor.greenColor),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||
child: GetBuilder<CameraClassController>(
|
||||
builder: (cameraClassController) =>
|
||||
cameraClassController.isCameraInitialized
|
||||
? Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: CameraPreview(
|
||||
cameraClassController.cameraController,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: Get.height * .1,
|
||||
right: 5,
|
||||
left: 5,
|
||||
child: Container(
|
||||
height: Get.width * 3 / 4,
|
||||
width: Get.width * .9,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.yellowColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: Get.width * 3 / 4,
|
||||
width: Get.width,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Camera not initialized yet',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Take Image'.tr,
|
||||
onPressed: () {
|
||||
ScanDocumentsByApi().scanDocumentsByApi();
|
||||
},
|
||||
)
|
||||
]),
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/controller/auth/captin/ml_google_doc.dart';
|
||||
import 'package:ride/controller/auth/captin/register_captin_controller.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../../controller/functions/ocr_controller.dart';
|
||||
@@ -7,7 +11,10 @@ import '../../widgets/elevated_btn.dart';
|
||||
|
||||
class CarLicensePage extends StatelessWidget {
|
||||
CarLicensePage({super.key});
|
||||
ScanDocumentsByApi scanDocumentsByApi = Get.put(ScanDocumentsByApi());
|
||||
CarRegistrationRecognizerController carRegistrationRecognizerController =
|
||||
Get.put(CarRegistrationRecognizerController());
|
||||
RegisterCaptinController registerCaptainController =
|
||||
Get.put(RegisterCaptinController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -20,11 +27,65 @@ class CarLicensePage extends StatelessWidget {
|
||||
right: Get.width * .2,
|
||||
child: MyElevatedButton(
|
||||
title: 'Take Picture Of ID Card'.tr,
|
||||
onPressed: () {
|
||||
scanDocumentsByApi.scanDocumentsByApi();
|
||||
onPressed: () async {
|
||||
await carRegistrationRecognizerController.scanText();
|
||||
},
|
||||
)),
|
||||
Positioned(
|
||||
top: 50,
|
||||
child: SizedBox(
|
||||
height: Get.height * .7,
|
||||
width: Get.width,
|
||||
child: buildImageWithBoundingBoxes(),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 20,
|
||||
left: Get.width * .2,
|
||||
right: Get.width * .2,
|
||||
child: MyElevatedButton(
|
||||
title: 'Register'.tr,
|
||||
onPressed: () async {
|
||||
registerCaptainController.addLisence();
|
||||
registerCaptainController.register();
|
||||
},
|
||||
)),
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
}
|
||||
|
||||
Widget buildImageWithBoundingBoxes() {
|
||||
CarRegistrationRecognizerController carRegistrationRecognizerController =
|
||||
Get.put(CarRegistrationRecognizerController());
|
||||
if (carRegistrationRecognizerController.image == null) {
|
||||
return Text('No image selected');
|
||||
} else {
|
||||
return Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
// top: 50,
|
||||
// right: 5,
|
||||
// left: 5,
|
||||
// bottom: 50,
|
||||
child: Image.file(
|
||||
File(carRegistrationRecognizerController.image!.path),
|
||||
fit: BoxFit.fill,
|
||||
)),
|
||||
// for (var line
|
||||
// in carRegistrationRecognizerController.extractedTextWithCoordinates)
|
||||
// Positioned(
|
||||
// left: line['boundingBox']['left'],
|
||||
// top: line['boundingBox']['top'] - Get.width * 2,
|
||||
// width: line['boundingBox']['width'],
|
||||
// height: line['boundingBox']['height'],
|
||||
// child: Container(
|
||||
// decoration: BoxDecoration(
|
||||
// border: Border.all(color: Colors.red, width: 2),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/info.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/constant/table_names.dart';
|
||||
import 'package:ride/controller/auth/captin/login_captin_controller.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/auth/captin/register_captin.dart';
|
||||
@@ -190,7 +191,7 @@ class LoginCaptin extends StatelessWidget {
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
box.remove(BoxName.agreeTerms);
|
||||
sql.deleteAllData(TableName.faceDetectTimes);
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.delete,
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/auth/captin/register_captin_controller.dart';
|
||||
import 'package:ride/views/auth/captin/car_license_page.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
import 'package:ride/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import 'ai_page.dart';
|
||||
|
||||
class RegisterCaptin extends StatelessWidget {
|
||||
const RegisterCaptin({super.key});
|
||||
@@ -16,7 +14,7 @@ class RegisterCaptin extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(RegisterCaptinController());
|
||||
return MyScafolld(
|
||||
title: 'Register Captin'.tr,
|
||||
title: 'Register Captain'.tr,
|
||||
body: [
|
||||
GetBuilder<RegisterCaptinController>(
|
||||
builder: (controller) => Form(
|
||||
@@ -37,250 +35,232 @@ class RegisterCaptin extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.text,
|
||||
controller: controller.firstNameController,
|
||||
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: 'First name'.tr,
|
||||
hintText: 'Enter your first name'.tr,
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// SizedBox(
|
||||
// width: Get.width * .4,
|
||||
// child: TextFormField(
|
||||
// keyboardType: TextInputType.text,
|
||||
// controller: controller.firstNameController,
|
||||
// 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: 'First name'.tr,
|
||||
// hintText: 'Enter your first name'.tr,
|
||||
// ),
|
||||
// validator: (value) {
|
||||
// if (value!.isEmpty) {
|
||||
// return 'Please enter your first name.'.tr;
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(
|
||||
// width: Get.width * .4,
|
||||
// child: TextFormField(
|
||||
// keyboardType: TextInputType.text,
|
||||
// controller: controller.lastNameController,
|
||||
// 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: 'Last name'.tr,
|
||||
// hintText: 'Enter your last name'.tr,
|
||||
// ),
|
||||
// validator: (value) {
|
||||
// if (value!.isEmpty) {
|
||||
// return 'Please enter your last name.'.tr;
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: 15,
|
||||
// ),
|
||||
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,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter your first name.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
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,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.text,
|
||||
controller: controller.lastNameController,
|
||||
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: 'Last name'.tr,
|
||||
hintText: 'Enter your last name'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter your last name.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
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;
|
||||
},
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty ||
|
||||
(!value.contains('@') ||
|
||||
!value.contains('.'))) {
|
||||
return 'Please enter Your Email.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
TextFormField(
|
||||
obscureText: true,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
controller: controller.passwordController,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
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),
|
||||
),
|
||||
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,
|
||||
),
|
||||
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;
|
||||
},
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || (value.length > 6)) {
|
||||
return 'Please enter Your Password.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
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,
|
||||
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,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || value.length != 10) {
|
||||
return 'Please enter your phone number.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
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,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.text,
|
||||
controller: controller.siteController,
|
||||
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: 'City'.tr,
|
||||
hintText: 'Enter your City'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter your City.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || value.length != 10) {
|
||||
return 'Please enter your phone number.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () => controller.getBirthDate(),
|
||||
child: Container(
|
||||
height: 50,
|
||||
width: Get.width * .4,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(13)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20),
|
||||
child: Text(
|
||||
controller.birthDate,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
DropdownButton(
|
||||
value: controller.gender,
|
||||
items: [
|
||||
DropdownMenuItem(
|
||||
value: 'Male',
|
||||
child: Text('Male'.tr),
|
||||
),
|
||||
DropdownMenuItem(
|
||||
value: 'Female',
|
||||
child: Text('Female'.tr),
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
controller.changeGender(value!);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// InkWell(
|
||||
// onTap: () => controller.getBirthDate(),
|
||||
// child: Container(
|
||||
// height: 50,
|
||||
// width: Get.width * .4,
|
||||
// decoration: BoxDecoration(
|
||||
// border: Border.all(),
|
||||
// borderRadius: BorderRadius.circular(13)),
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.symmetric(
|
||||
// horizontal: 20),
|
||||
// child: Text(
|
||||
// controller.birthDate,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// DropdownButton(
|
||||
// value: controller.gender,
|
||||
// items: [
|
||||
// DropdownMenuItem(
|
||||
// value: 'Male',
|
||||
// child: Text('Male'.tr),
|
||||
// ),
|
||||
// DropdownMenuItem(
|
||||
// value: 'Female',
|
||||
// child: Text('Female'.tr),
|
||||
// ),
|
||||
// ],
|
||||
// onChanged: (value) {
|
||||
// controller.changeGender(value!);
|
||||
// },
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () => Get.to(() => AiPage())),
|
||||
controller.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: MyElevatedButton(
|
||||
title: 'Register Captain'.tr,
|
||||
onPressed: () => controller.register())
|
||||
onPressed: () => controller.nextToAIDetection()),
|
||||
MyElevatedButton(
|
||||
//todo remove it for test
|
||||
title: 'Car registration ai '.tr,
|
||||
kolor: AppColor.blueColor,
|
||||
onPressed: () => Get.to(() => CarLicensePage())),
|
||||
|
||||
// controller.isloading
|
||||
// ? const MyCircularProgressIndicator()
|
||||
// : MyElevatedButton(
|
||||
// title: 'Register Captain'.tr,
|
||||
// onPressed: () => controller.register())
|
||||
]),
|
||||
),
|
||||
),
|
||||
|
||||
91
lib/views/auth/captin/verify_email_captain.dart
Normal file
91
lib/views/auth/captin/verify_email_captain.dart
Normal file
@@ -0,0 +1,91 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/auth/captin/register_captin_controller.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
class VerifyEmailCaptainPage extends StatelessWidget {
|
||||
VerifyEmailCaptainPage({super.key});
|
||||
RegisterCaptinController registerCaptinController =
|
||||
Get.put(RegisterCaptinController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Verify Email For Captain'.tr,
|
||||
body: [
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: 20,
|
||||
child: Text(
|
||||
'We sent 5 digit to your Email provided'.tr,
|
||||
style: AppStyle.title.copyWith(fontSize: 20),
|
||||
)),
|
||||
GetBuilder<RegisterCaptinController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: 100,
|
||||
left: 80,
|
||||
right: 80,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: TextField(
|
||||
controller: registerCaptinController.verifyCode,
|
||||
decoration: InputDecoration(
|
||||
labelStyle: AppStyle.title,
|
||||
border: const OutlineInputBorder(),
|
||||
hintText: '5 digit'.tr,
|
||||
counterStyle: AppStyle.number,
|
||||
hintStyle: AppStyle.subtitle
|
||||
.copyWith(color: AppColor.accentColor),
|
||||
),
|
||||
maxLength: 5,
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Send Verfication Code'.tr,
|
||||
onPressed: () {
|
||||
registerCaptinController.sendVerifications();
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
|
||||
Padding verifyEmail() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor.accentColor,
|
||||
width: 2,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: SizedBox(
|
||||
width: 20,
|
||||
child: TextField(
|
||||
maxLength: 1,
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user