10/16/1
This commit is contained in:
@@ -121,8 +121,8 @@ class HomeCaptain extends StatelessWidget {
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
homeCaptainController.sendSMSToRecipents(
|
||||
'hi from Sefer', ['+962798583052']);
|
||||
// homeCaptainController.sendSMSToRecipents(
|
||||
// 'hi from Sefer', ['+962798583052']);
|
||||
},
|
||||
child: const Text('send msg')),
|
||||
],
|
||||
|
||||
@@ -151,7 +151,7 @@ class MapPage extends StatelessWidget {
|
||||
onTap: (argument) {
|
||||
controller.hidePlaces();
|
||||
|
||||
controller.changeBottomSheetShown();
|
||||
// controller.changeBottomSheetShown();
|
||||
// controller.bottomSheet();
|
||||
},
|
||||
initialCameraPosition: CameraPosition(
|
||||
|
||||
@@ -327,7 +327,7 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Container(
|
||||
SizedBox(
|
||||
height:
|
||||
200, // Set the desired height here
|
||||
child: CupertinoPicker(
|
||||
|
||||
@@ -71,24 +71,26 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30,
|
||||
child: AnimatedTextKit(
|
||||
animatedTexts: [
|
||||
ScaleAnimatedText(
|
||||
'${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
// WavyAnimatedText(
|
||||
// '${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
// FlickerAnimatedText(
|
||||
// '${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
// WavyAnimatedText(
|
||||
// '${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
],
|
||||
isRepeatingAnimation: true,
|
||||
onTap: () {
|
||||
print("Tap Event");
|
||||
},
|
||||
),
|
||||
),
|
||||
height: 30,
|
||||
child: Text(
|
||||
'${'Where to'.tr} ${box.read(BoxName.name)}')
|
||||
// AnimatedTextKit(
|
||||
// animatedTexts: [
|
||||
// ScaleAnimatedText(
|
||||
// '${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
// // WavyAnimatedText(
|
||||
// // '${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
// // FlickerAnimatedText(
|
||||
// // '${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
// // WavyAnimatedText(
|
||||
// // '${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
// ],
|
||||
// isRepeatingAnimation: true,
|
||||
// onTap: () {
|
||||
// print("Tap Event");
|
||||
// },
|
||||
// ),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
@@ -148,96 +150,88 @@ class FavioratePlacesDialogu extends StatelessWidget {
|
||||
builder: (controller) => DefaultTextStyle(
|
||||
style: AppStyle.title,
|
||||
child: Center(
|
||||
child: AnimatedTextKit(
|
||||
animatedTexts: [
|
||||
TypewriterAnimatedText('Favorite Places'.tr),
|
||||
ScaleAnimatedText(
|
||||
'Favorite Places'.tr,
|
||||
),
|
||||
// TyperAnimatedText(
|
||||
// 'Favorite Places'.tr,
|
||||
// ),
|
||||
],
|
||||
isRepeatingAnimation: true,
|
||||
onTap: () async {
|
||||
List favoritePlaces =
|
||||
await sql.getAllData(TableName.placesFavorite);
|
||||
print(favoritePlaces);
|
||||
Get.defaultDialog(
|
||||
title: 'Favorite Places'.tr,
|
||||
content: SizedBox(
|
||||
width: Get.width * .8,
|
||||
height: 300,
|
||||
child: favoritePlaces.isEmpty
|
||||
? Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
List favoritePlaces =
|
||||
await sql.getAllData(TableName.placesFavorite);
|
||||
// print(favoritePlaces);
|
||||
Get.defaultDialog(
|
||||
title: 'Favorite Places'.tr,
|
||||
content: SizedBox(
|
||||
width: Get.width * .8,
|
||||
height: 300,
|
||||
child: favoritePlaces.isEmpty
|
||||
? Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.hourglass_empty_rounded,
|
||||
size: 99,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
Text(
|
||||
'You Dont Have Any places yet !'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount: favoritePlaces.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.hourglass_empty_rounded,
|
||||
size: 99,
|
||||
color: AppColor.primaryColor,
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
await controller.getMap(
|
||||
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
|
||||
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
|
||||
);
|
||||
// controller.changePickerShown();
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
controller.showBottomSheet1();
|
||||
},
|
||||
child: Text(
|
||||
favoritePlaces[index]['name'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'You Dont Have Any places yet !'.tr,
|
||||
style: AppStyle.title,
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await sql.deleteData(
|
||||
TableName.placesFavorite,
|
||||
favoritePlaces[index]['id']);
|
||||
Get.back();
|
||||
// ignore: use_build_context_synchronously
|
||||
Toast.show(
|
||||
context,
|
||||
'${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
|
||||
AppColor.redColor);
|
||||
// Get.snackbar('Deleted'.tr,
|
||||
// '${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
|
||||
// backgroundColor:
|
||||
// AppColor.accentColor);
|
||||
},
|
||||
icon: const Icon(Icons.favorite_outlined),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount: favoritePlaces.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
await controller.getMap(
|
||||
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
|
||||
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
|
||||
);
|
||||
// controller.changePickerShown();
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
controller.showBottomSheet1();
|
||||
},
|
||||
child: Text(
|
||||
favoritePlaces[index]['name'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await sql.deleteData(
|
||||
TableName.placesFavorite,
|
||||
favoritePlaces[index]['id']);
|
||||
Get.back();
|
||||
// ignore: use_build_context_synchronously
|
||||
Toast.show(
|
||||
context,
|
||||
'${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
|
||||
AppColor.redColor);
|
||||
// Get.snackbar('Deleted'.tr,
|
||||
// '${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
|
||||
// backgroundColor:
|
||||
// AppColor.accentColor);
|
||||
},
|
||||
icon:
|
||||
const Icon(Icons.favorite_outlined),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Back'.tr, onPressed: () => Get.back()),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Back'.tr, onPressed: () => Get.back()),
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
'\u{1F3D8} ' 'Favorite Places'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
)),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/controller/profile/profile_controller.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
@@ -13,6 +16,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProfileController profileController = Get.put(ProfileController());
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
if (controller.rideTimerBegin) {
|
||||
return Positioned(
|
||||
@@ -26,6 +30,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'You will arrive to your destination after '.tr,
|
||||
@@ -50,34 +55,137 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
),
|
||||
controller.remainingTimeTimerRideBegin < 5
|
||||
? MyElevatedButton(
|
||||
title:
|
||||
'If you in destination Now. Press finish The Ride',
|
||||
onPressed: () async {
|
||||
//todo finish the trip and rest all counter ,start new counter of the trip time
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
if (box.read(BoxName.sosPhonePassenger).toString() ==
|
||||
'') {
|
||||
Get.defaultDialog(
|
||||
title: 'You dont Add Emergency Phone Yet!'.tr,
|
||||
content: Column(
|
||||
children: [
|
||||
Form(
|
||||
key: controller.sosFormKey,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType
|
||||
.phone, // Set the keyboard type to phone
|
||||
validator: (value) {
|
||||
if (value!.isEmpty ||
|
||||
value.length < 10) {
|
||||
return 'Please enter a phone number';
|
||||
}
|
||||
// Add additional validation if needed
|
||||
return null;
|
||||
},
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
hintText: 'Type here',
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Add Phone'.tr,
|
||||
onPressed: () async {
|
||||
await profileController
|
||||
.updatField('sosPhone');
|
||||
box.write(
|
||||
BoxName.sosPhonePassenger,
|
||||
profileController
|
||||
.prfoileData['sosPhone']);
|
||||
}));
|
||||
} else {
|
||||
controller
|
||||
.sendSMS(box.read(BoxName.sosPhonePassenger));
|
||||
}
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.sos_rounded,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
if (box.read(BoxName.sosPhonePassenger).toString() ==
|
||||
'') {
|
||||
Get.defaultDialog(
|
||||
title: 'You dont Add Emergency Phone Yet!'.tr,
|
||||
content: Column(
|
||||
children: [
|
||||
Form(
|
||||
key: controller.sosFormKey,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType
|
||||
.phone, // Set the keyboard type to phone
|
||||
validator: (value) {
|
||||
if (value!.isEmpty ||
|
||||
value.length < 10) {
|
||||
return 'Please enter a phone number';
|
||||
}
|
||||
// Add additional validation if needed
|
||||
return null;
|
||||
},
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
hintText: 'Type here',
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Add Phone'.tr,
|
||||
onPressed: () async {
|
||||
await profileController
|
||||
.updatField('sosPhone');
|
||||
box.write(
|
||||
BoxName.sosPhonePassenger,
|
||||
profileController
|
||||
.prfoileData['sosPhone']);
|
||||
}));
|
||||
} else {
|
||||
controller.sendWhatsapp(
|
||||
box.read(BoxName.sosPhonePassenger));
|
||||
}
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.ring_volume,
|
||||
color: AppColor.blueColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
// controller.remainingTimeTimerRideBegin < 5
|
||||
// ? MyElevatedButton(
|
||||
// title:
|
||||
// 'If you in destination Now. Press finish The Ride',
|
||||
// onPressed: () async {
|
||||
//todo finish the trip and rest all counter ,start new counter of the trip time
|
||||
|
||||
// await CRUD()
|
||||
// .post(link: AppLink.updateRides, payload: {
|
||||
// 'id': controller.rideId,
|
||||
// 'rideTimeStart': DateTime.now().toString(),
|
||||
// 'status': 'Applied'
|
||||
// });
|
||||
// controller.driverArrivePassenger();
|
||||
// // Send notification to driver to alert him that trip is begin
|
||||
// FirebaseMessagesController()
|
||||
// .sendNotificationToAnyWithoutData(
|
||||
// 'BeginTrip',
|
||||
// box.read(BoxName.name).toString(),
|
||||
// controller.driverToken.toString(),
|
||||
// );
|
||||
// print(controller.driverToken.toString());
|
||||
// Get.defaultDialog(
|
||||
// title: 'The Ride is Begin'.tr,
|
||||
// backgroundColor: AppColor.greenColor,
|
||||
// );
|
||||
})
|
||||
: const SizedBox()
|
||||
// await CRUD()
|
||||
// .post(link: AppLink.updateRides, payload: {
|
||||
// 'id': controller.rideId,
|
||||
// 'rideTimeStart': DateTime.now().toString(),
|
||||
// 'status': 'Applied'
|
||||
// });
|
||||
// controller.driverArrivePassenger();
|
||||
// // Send notification to driver to alert him that trip is begin
|
||||
// FirebaseMessagesController()
|
||||
// .sendNotificationToAnyWithoutData(
|
||||
// 'BeginTrip',
|
||||
// box.read(BoxName.name).toString(),
|
||||
// controller.driverToken.toString(),
|
||||
// );
|
||||
// print(controller.driverToken.toString());
|
||||
// Get.defaultDialog(
|
||||
// title: 'The Ride is Begin'.tr,
|
||||
// backgroundColor: AppColor.greenColor,
|
||||
// );
|
||||
// })
|
||||
// : const SizedBox()
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/profile/profile_controller.dart';
|
||||
import 'package:ride/main.dart';
|
||||
@@ -106,23 +107,27 @@ class PassengerProfilePage extends StatelessWidget {
|
||||
.toString()),
|
||||
onTap: () {
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: true,
|
||||
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();
|
||||
},
|
||||
)
|
||||
],
|
||||
content: SizedBox(
|
||||
height: 200,
|
||||
child: Column(
|
||||
children: [
|
||||
EducationDegreePicker(),
|
||||
],
|
||||
),
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Update Education'.tr,
|
||||
onPressed: () {
|
||||
controller.updateColumn({
|
||||
'id': controller.prfoileData['id']
|
||||
.toString(),
|
||||
'education':
|
||||
controller.selectedDegree,
|
||||
});
|
||||
Get.back();
|
||||
},
|
||||
));
|
||||
},
|
||||
),
|
||||
@@ -160,6 +165,25 @@ class PassengerProfilePage extends StatelessWidget {
|
||||
controller.updatField('maritalStatus');
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: Text(
|
||||
'SOS Phone'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
leading: const Icon(
|
||||
Icons.sos,
|
||||
color: AppColor.redColor,
|
||||
size: 35,
|
||||
),
|
||||
trailing: const Icon(Icons.arrow_forward_ios),
|
||||
subtitle: Text(controller.prfoileData['sosPhone']
|
||||
.toString()),
|
||||
onTap: () async {
|
||||
await controller.updatField('sosPhone');
|
||||
box.write(BoxName.sosPhonePassenger,
|
||||
controller.prfoileData['sosPhone']);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -189,14 +213,17 @@ class GenderPicker extends StatelessWidget {
|
||||
|
||||
@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(),
|
||||
return SizedBox(
|
||||
height: 100,
|
||||
child: CupertinoPicker(
|
||||
itemExtent: 32.0,
|
||||
onSelectedItemChanged: (int index) {
|
||||
controller.setGender(genderOptions[index]);
|
||||
},
|
||||
children: genderOptions.map((String value) {
|
||||
return Text(value);
|
||||
}).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -216,17 +243,21 @@ class EducationDegreePicker extends StatelessWidget {
|
||||
|
||||
@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(),
|
||||
return SizedBox(
|
||||
height: 200,
|
||||
child: CupertinoPicker(
|
||||
// backgroundColor: AppColor.accentColor,
|
||||
// looping: true,
|
||||
squeeze: 2,
|
||||
// diameterRatio: 5,
|
||||
itemExtent: 32,
|
||||
onSelectedItemChanged: (int index) {
|
||||
controller.setDegree(degreeOptions[index]);
|
||||
},
|
||||
children: degreeOptions.map((String value) {
|
||||
return Text(value);
|
||||
}).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user