110 lines
4.3 KiB
Dart
110 lines
4.3 KiB
Dart
import 'package:SEFER/constant/style.dart';
|
|
import 'package:SEFER/controller/auth/captin/register_captin_controller.dart';
|
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
|
import 'package:SEFER/views/widgets/my_scafold.dart';
|
|
import 'package:SEFER/views/widgets/my_textField.dart';
|
|
import 'package:SEFER/views/widgets/mycircular.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
class SmsSignupEgypt extends StatelessWidget {
|
|
SmsSignupEgypt({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Get.put(RegisterCaptainController());
|
|
return MyScafolld(
|
|
title: 'Phone Check'.tr,
|
|
body: [
|
|
GetBuilder<RegisterCaptainController>(
|
|
builder: (registerCaptainController) {
|
|
return ListView(
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
// Logo at the top
|
|
Padding(
|
|
padding: const EdgeInsets.only(bottom: 20.0),
|
|
child: Image.asset(
|
|
'assets/images/logo.png', // Make sure you have a logo image in your assets folder
|
|
height: 100,
|
|
),
|
|
),
|
|
// Message to the driver
|
|
Padding(
|
|
padding:
|
|
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
|
|
child: Text(
|
|
'We need your phone number to contact you and to help you receive orders.'
|
|
.tr,
|
|
textAlign: TextAlign.center,
|
|
style: AppStyle.title,
|
|
),
|
|
),
|
|
// Enter phone number text
|
|
Padding(
|
|
padding:
|
|
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
|
|
child: Text(
|
|
'Enter your phone number'.tr,
|
|
textAlign: TextAlign.center,
|
|
style: AppStyle.title,
|
|
),
|
|
),
|
|
// Phone number input field
|
|
Padding(
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: !registerCaptainController.isSent
|
|
? Form(
|
|
key: registerCaptainController.formKey3,
|
|
child: MyTextForm(
|
|
controller:
|
|
registerCaptainController.phoneController,
|
|
label: 'Enter your phone number'.tr,
|
|
hint: 'Enter your phone number'.tr,
|
|
type: TextInputType.phone),
|
|
)
|
|
: Container(
|
|
decoration: AppStyle.boxDecoration1,
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Text(
|
|
registerCaptainController.phoneController.text,
|
|
style: AppStyle.title,
|
|
),
|
|
),
|
|
)),
|
|
const SizedBox(
|
|
height: 10,
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: registerCaptainController.isSent
|
|
? Form(
|
|
key: registerCaptainController.formKey3,
|
|
child: MyTextForm(
|
|
controller: registerCaptainController.verifyCode,
|
|
label: '5 digit'.tr,
|
|
hint: '5 digit'.tr,
|
|
type: TextInputType.number),
|
|
)
|
|
: const SizedBox()),
|
|
// Submit button
|
|
registerCaptainController.isLoading
|
|
? const MyCircularProgressIndicator()
|
|
: MyElevatedButton(
|
|
onPressed: () async {
|
|
!registerCaptainController.isSent
|
|
? await registerCaptainController.sendOtpMessage()
|
|
: await registerCaptainController.verifySMSCode();
|
|
},
|
|
title: 'Submit'.tr,
|
|
),
|
|
],
|
|
);
|
|
}),
|
|
],
|
|
isleading: false,
|
|
);
|
|
}
|
|
}
|