8-13/
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../controller/auth/login_controller.dart';
|
||||
import '../widgets/mycircular.dart';
|
||||
import 'register_page.dart';
|
||||
|
||||
class LoginPage extends StatelessWidget {
|
||||
@@ -114,15 +115,19 @@ class LoginPage extends StatelessWidget {
|
||||
return null;
|
||||
},
|
||||
),
|
||||
MyElevatedButton(
|
||||
onPressed: () {
|
||||
if (controller.formKey.currentState!
|
||||
.validate()) {
|
||||
controller.login();
|
||||
}
|
||||
},
|
||||
title: 'Submit',
|
||||
),
|
||||
GetBuilder<LoginController>(
|
||||
builder: (controller) => controller.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: MyElevatedButton(
|
||||
onPressed: () {
|
||||
if (controller.formKey.currentState!
|
||||
.validate()) {
|
||||
controller.login();
|
||||
}
|
||||
},
|
||||
title: 'Submit',
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -134,7 +139,7 @@ class LoginPage extends StatelessWidget {
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
AnimatedTextKit(
|
||||
onTap: () => Get.to(() => RegisterPage()),
|
||||
onTap: () => Get.to(() => const RegisterPage()),
|
||||
animatedTexts: [
|
||||
TypewriterAnimatedText(
|
||||
'Register',
|
||||
|
||||
@@ -137,46 +137,97 @@ class RegisterPage extends StatelessWidget {
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
TextFormField(
|
||||
keyboardType: TextInputType.phone,
|
||||
cursorColor: AppColor.accentColor,
|
||||
controller: controller.phoneController,
|
||||
decoration: InputDecoration(
|
||||
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;
|
||||
},
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.phone,
|
||||
cursorColor: AppColor.accentColor,
|
||||
controller: controller.phoneController,
|
||||
decoration: InputDecoration(
|
||||
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;
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.text,
|
||||
controller: controller.siteController,
|
||||
decoration: InputDecoration(
|
||||
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;
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => controller.getBirthDate(),
|
||||
child: Container(
|
||||
height: 50,
|
||||
width: Get.width,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(13)),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Text(
|
||||
controller.birthDate,
|
||||
style: AppStyle.title,
|
||||
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'.tr,
|
||||
child: Text('Male'.tr),
|
||||
),
|
||||
DropdownMenuItem(
|
||||
value: 'Female'.tr,
|
||||
child: Text('Female'.tr),
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
controller.changeGender(value!);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Register'.tr,
|
||||
|
||||
90
lib/views/auth/verify_email_page.dart
Normal file
90
lib/views/auth/verify_email_page.dart
Normal file
@@ -0,0 +1,90 @@
|
||||
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/register_controller.dart';
|
||||
import 'package:ride/controller/auth/verify_email_controller.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
class VerifyEmailPage extends StatelessWidget {
|
||||
const VerifyEmailPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(RegisterController());
|
||||
return MyScafolld(
|
||||
title: 'Verify Email'.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<RegisterController>(
|
||||
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: controller.verfyCode,
|
||||
decoration: InputDecoration(
|
||||
labelStyle: AppStyle.title,
|
||||
border: const OutlineInputBorder(),
|
||||
hintText: '5 digit',
|
||||
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: () => controller.sendverfications())
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
37
lib/views/widgets/mycircular.dart
Normal file
37
lib/views/widgets/mycircular.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MyCircularProgressIndicator extends StatelessWidget {
|
||||
final Color backgroundColor;
|
||||
|
||||
const MyCircularProgressIndicator({
|
||||
super.key,
|
||||
this.backgroundColor = Colors.transparent,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Container(
|
||||
width: 110,
|
||||
height: 110,
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
const Center(child: CircularProgressIndicator()),
|
||||
Column(
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: Image.asset('assets/images/logo.png'),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user