This commit is contained in:
Hamza-Ayed
2023-08-15 14:12:20 +03:00
parent 84ab0e86dd
commit 65ade9c874
19 changed files with 619 additions and 166 deletions

View File

@@ -20,142 +20,156 @@ class LoginPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
Get.put(LoginController());
return MyScafolld(title: 'Login', isleading: false, body: [
if (box.read(BoxName.agreeTerms) != 'agreed')
agreedpage()
else
SingleChildScrollView(
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(25),
child: Container(
decoration: const BoxDecoration(
boxShadow: [
BoxShadow(
offset: Offset(3, 3),
color: AppColor.accentColor,
blurRadius: 3)
],
color: AppColor.secondaryColor,
),
child: Form(
key: controller.formKey,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Column(
children: [
TextFormField(
keyboardType: TextInputType.emailAddress,
controller: controller.emailController,
decoration: InputDecoration(
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;
},
),
const SizedBox(
height: 30,
),
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;
},
),
const SizedBox(
height: 15,
),
TextFormField(
obscureText: true,
keyboardType: TextInputType.emailAddress,
controller: controller.passwordController,
decoration: InputDecoration(
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 || (value.length > 6)) {
return 'Please enter Your Password.'.tr;
}
return null;
},
),
GetBuilder<LoginController>(
builder: (controller) => controller.isloading
? const MyCircularProgressIndicator()
: MyElevatedButton(
onPressed: () {
if (controller.formKey.currentState!
.validate()) {
controller.login();
return GetBuilder<LoginController>(
builder: (controller) =>
MyScafolld(title: 'Login', isleading: false, body: [
if (box.read(BoxName.agreeTerms) != 'agreed')
agreedpage()
else
SingleChildScrollView(
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(25),
child: Container(
decoration: const BoxDecoration(
boxShadow: [
BoxShadow(
offset: Offset(3, 3),
color: AppColor.accentColor,
blurRadius: 3)
],
color: AppColor.secondaryColor,
),
child: Form(
key: controller.formKey,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Column(
children: [
TextFormField(
keyboardType:
TextInputType.emailAddress,
controller: controller.emailController,
decoration: InputDecoration(
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;
},
title: 'Submit',
),
)
],
),
),
const SizedBox(
height: 30,
),
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;
},
),
const SizedBox(
height: 15,
),
TextFormField(
obscureText: true,
keyboardType:
TextInputType.emailAddress,
controller:
controller.passwordController,
decoration: InputDecoration(
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 ||
(value.length > 6)) {
return 'Please enter Your Password.'
.tr;
}
return null;
},
),
GetBuilder<LoginController>(
builder: (controller) => controller
.isloading
? const MyCircularProgressIndicator()
: MyElevatedButton(
onPressed: () {
if (controller
.formKey.currentState!
.validate()) {
controller.login();
}
},
title: 'Submit',
),
)
],
),
),
),
),
)),
Text(
'if you dont have account'.tr,
style: AppStyle.subtitle,
),
),
)),
Text(
'if you dont have account'.tr,
style: AppStyle.subtitle,
),
AnimatedTextKit(
onTap: () => Get.to(() => const RegisterPage()),
animatedTexts: [
TypewriterAnimatedText(
'Register',
textStyle: AppStyle.headtitle2,
speed: const Duration(milliseconds: 200),
AnimatedTextKit(
onTap: () => Get.to(() => const RegisterPage()),
animatedTexts: [
TypewriterAnimatedText(
'Register',
textStyle: AppStyle.headtitle2,
speed: const Duration(milliseconds: 200),
),
],
totalRepeatCount: 4,
pause: const Duration(milliseconds: 200),
displayFullTextOnTap: true,
stopPauseOnTap: true,
)
],
),
],
totalRepeatCount: 4,
pause: const Duration(milliseconds: 200),
displayFullTextOnTap: true,
stopPauseOnTap: true,
)
],
),
)
]);
)
]));
}
Padding agreedpage() {

View File

@@ -50,6 +50,7 @@ class MapPage extends StatelessWidget {
},
);
},
onTap: (argument) {
controller.hidePlaces();
@@ -99,11 +100,34 @@ class MapPage extends StatelessWidget {
color: AppColor.primaryColor,
width: 5,
),
// Polyline(
// zIndex: 2,
// consumeTapEvents: true,
// geodesic: true,
// endCap: Cap.buttCap,
// startCap: Cap.buttCap,
// visible: true,
// polylineId: PolylineId('g'),
// points: [
// LatLng(controller.southwest.latitude,
// controller.southwest.longitude),
// LatLng(controller.northeast.latitude,
// controller.northeast.longitude)
// ],
// color: AppColor.primaryColor,
// width: 5,
// ),
},
// circles: {
// Circle(
// circleId: const CircleId('kk'),
// center: controller.mylocation,
// radius: 2000)
// },
mapType: MapType.normal,
myLocationButtonEnabled: true,
indoorViewEnabled: true,
trafficEnabled: true,
trafficEnabled: false,
buildingsEnabled: true,
mapToolbarEnabled: true,
onCameraMove: (position) {

View File

@@ -5,7 +5,6 @@ import '../../../constant/colors.dart';
import '../../../constant/style.dart';
import '../../../controller/home/map_page_controller.dart';
import '../../widgets/elevated_btn.dart';
import 'buttom_sheet_map_show.dart';
import 'form_search_places.dart';
class PickerAnimtionContainer extends StatelessWidget {

View File

@@ -1,19 +1,211 @@
import 'package:flutter/cupertino.dart';
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/profile/profile_controller.dart';
import 'package:ride/views/widgets/elevated_btn.dart';
import 'package:ride/views/widgets/my_scafold.dart';
import 'package:ride/views/widgets/mycircular.dart';
class PassengerProfilePage extends StatelessWidget {
const PassengerProfilePage({super.key});
@override
Widget build(BuildContext context) {
return const MyScafolld(
Get.put(ProfileController());
return MyScafolld(
isleading: true,
title: 'My Profile',
body: [
Center(
child: Text('ddd'),
),
GetBuilder<ProfileController>(
builder: (controller) => controller.isloading
? const MyCircularProgressIndicator()
: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Edit Profile'.tr,
style: AppStyle.headtitle2,
),
ListTile(
title: Text(
'Name'.tr,
style: AppStyle.title,
),
leading: const Icon(
Icons.person_pin_rounded,
size: 35,
),
trailing: const Icon(Icons.arrow_forward_ios),
subtitle: Text(
'${controller.prfoileData['first_name']} ${controller.prfoileData['last_name']}'),
onTap: () {
controller.updatField('first_name');
},
),
ListTile(
title: Text(
'Gender'.tr,
style: AppStyle.title,
),
leading: Image.asset(
'assets/images/gender.png',
width: 35,
),
trailing: const Icon(Icons.arrow_forward_ios),
subtitle: Text(
controller.prfoileData['gender'].toString()),
onTap: () {
Get.defaultDialog(
title: 'Update Gender'.tr,
content: Column(
children: [
GenderPicker(),
MyElevatedButton(
title: 'Update'.tr,
onPressed: () {
controller.updateColumn({
'id': controller.prfoileData['id']
.toString(),
'gender': controller.gender,
});
Get.back();
},
)
],
));
// controller.updatField('gender');
},
),
ListTile(
title: Text(
'Education'.tr,
style: AppStyle.title,
),
leading: Image.asset(
'assets/images/education.png',
width: 35,
),
trailing: const Icon(Icons.arrow_forward_ios),
subtitle: Text(
controller.prfoileData['education'].toString()),
onTap: () {
Get.defaultDialog(
title: 'Update Education'.tr,
content: Column(
children: [
EducationDegreePicker(),
MyElevatedButton(
title: 'Update Education'.tr,
onPressed: () {
controller.updateColumn({
'id': controller.prfoileData['id']
.toString(),
'education':
controller.selectedDegree,
});
Get.back();
},
)
],
));
},
),
ListTile(
title: Text(
'Employment Type'.tr,
style: AppStyle.title,
),
leading: Image.asset(
'assets/images/employmentType.png',
width: 35,
),
trailing: const Icon(Icons.arrow_forward_ios),
subtitle: Text(controller
.prfoileData['employmentType']
.toString()),
onTap: () {
controller.updatField('employmentType');
},
),
ListTile(
title: Text(
'Marital Status'.tr,
style: AppStyle.title,
),
leading: Image.asset(
'assets/images/maritalStatus.png',
width: 35,
),
trailing: const Icon(Icons.arrow_forward_ios),
subtitle: Text(controller
.prfoileData['maritalStatus']
.toString()),
onTap: () {
controller.updatField('maritalStatus');
},
),
],
),
),
))
],
);
}
}
class GenderPicker extends StatelessWidget {
final ProfileController controller = Get.put(ProfileController());
final List<String> genderOptions = ['Male', 'Female', 'Other'];
GenderPicker({super.key});
@override
Widget build(BuildContext context) {
return CupertinoPicker(
itemExtent: 32.0,
onSelectedItemChanged: (int index) {
controller.setGender(genderOptions[index]);
},
children: genderOptions.map((String value) {
return Text(value);
}).toList(),
);
}
}
class EducationDegreePicker extends StatelessWidget {
final ProfileController controller = Get.put(ProfileController());
final List<String> degreeOptions = [
'High School Diploma',
'Associate Degree',
'Bachelor\'s Degree',
'Master\'s Degree',
'Doctoral Degree',
];
EducationDegreePicker({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return CupertinoPicker(
// backgroundColor: AppColor.accentColor,
looping: true,
squeeze: 2, diameterRatio: 2,
itemExtent: 32.0,
onSelectedItemChanged: (int index) {
controller.setDegree(degreeOptions[index]);
},
children: degreeOptions.map((String value) {
return Text(value);
}).toList(),
);
}
}