8-18/1
This commit is contained in:
@@ -7,6 +7,15 @@ class AppLink {
|
|||||||
static const String getTokens = "$server/ride/firebase/get.php";
|
static const String getTokens = "$server/ride/firebase/get.php";
|
||||||
static const String addTokens = "$server/ride/firebase/add.php";
|
static const String addTokens = "$server/ride/firebase/add.php";
|
||||||
|
|
||||||
|
//=======================ride===================
|
||||||
|
static const String ride = '$server/ride/';
|
||||||
|
static const String addCancelRide = "$server/ride/addCancelRide.php";
|
||||||
|
//-----------------ridessss------------------
|
||||||
|
static const String addRides = "$ride/rides/add.php";
|
||||||
|
static const String getRides = "$ride/rides/get.php";
|
||||||
|
static const String updateRides = "$ride/rides/update.php";
|
||||||
|
static const String deleteRides = "$ride/rides/delete.php";
|
||||||
|
|
||||||
static const String pathImage = "$server/upload/types/";
|
static const String pathImage = "$server/upload/types/";
|
||||||
static const String uploadImage = "$server/uploadImage.php";
|
static const String uploadImage = "$server/uploadImage.php";
|
||||||
static const String uploadImageType = "$server/uploadImageType.php";
|
static const String uploadImageType = "$server/uploadImageType.php";
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ class LoginController extends GetxController {
|
|||||||
if (jsonDecoeded['data'][0]['verified'] == 1) {
|
if (jsonDecoeded['data'][0]['verified'] == 1) {
|
||||||
box.write(BoxName.pasengerID, jsonDecoeded['data'][0]['id']);
|
box.write(BoxName.pasengerID, jsonDecoeded['data'][0]['id']);
|
||||||
box.write(BoxName.email, jsonDecoeded['data'][0]['email']);
|
box.write(BoxName.email, jsonDecoeded['data'][0]['email']);
|
||||||
|
box.write(BoxName.name, jsonDecoeded['data'][0]['first_name']);
|
||||||
box.write(BoxName.phone, jsonDecoeded['data'][0]['phone']);
|
box.write(BoxName.phone, jsonDecoeded['data'][0]['phone']);
|
||||||
saveData(BoxName.passwoerd, passwordController.text);
|
saveData(BoxName.passwoerd, passwordController.text);
|
||||||
Get.offAll(() => MapPage());
|
Get.offAll(() => MapPage());
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:ride/constant/links.dart';
|
import 'package:ride/constant/links.dart';
|
||||||
import 'package:ride/controller/functions/crud.dart';
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
|
import 'package:ride/views/auth/login_page.dart';
|
||||||
import 'package:ride/views/home/map_page.dart';
|
import 'package:ride/views/home/map_page.dart';
|
||||||
|
|
||||||
import '../../views/auth/verify_email_page.dart';
|
import '../../views/auth/verify_email_page.dart';
|
||||||
@@ -63,7 +64,7 @@ class RegisterController extends GetxController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (jsonDecode(res)['status'] == 'success') {
|
if (jsonDecode(res)['status'] == 'success') {
|
||||||
Get.offAll(() => const MapPage());
|
Get.offAll(() => LoginPage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,11 +5,14 @@ import 'package:get/get.dart';
|
|||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
||||||
import 'package:location/location.dart';
|
import 'package:location/location.dart';
|
||||||
|
import 'package:ride/constant/box_name.dart';
|
||||||
import 'package:ride/constant/credential.dart';
|
import 'package:ride/constant/credential.dart';
|
||||||
import 'package:ride/constant/links.dart';
|
import 'package:ride/constant/links.dart';
|
||||||
import 'package:ride/controller/functions/crud.dart';
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
import 'package:ride/views/home/map_widget.dart/buttom_sheet_map_show.dart';
|
import 'package:ride/views/home/map_widget.dart/buttom_sheet_map_show.dart';
|
||||||
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
|
import '../../main.dart';
|
||||||
import '../../models/model/locations.dart';
|
import '../../models/model/locations.dart';
|
||||||
import '../firebase/firbase_messge.dart';
|
import '../firebase/firbase_messge.dart';
|
||||||
|
|
||||||
@@ -39,15 +42,32 @@ class MapController extends GetxController {
|
|||||||
bool isPickerShown = false;
|
bool isPickerShown = false;
|
||||||
bool isButtomSheetShown = false;
|
bool isButtomSheetShown = false;
|
||||||
bool mapType = false;
|
bool mapType = false;
|
||||||
|
bool isCancelRidePageShown = false;
|
||||||
|
bool isCashConfirmPageShown = false;
|
||||||
|
bool isPaymentMethodPageShown = false;
|
||||||
bool isMainBottomMenuMap = true;
|
bool isMainBottomMenuMap = true;
|
||||||
double heightButtomSheetShown = 240;
|
double heightButtomSheetShown = 300;
|
||||||
|
double cashConfirmPageShown = 250;
|
||||||
|
double paymentPageShown = 380;
|
||||||
late final LatLng southwest;
|
late final LatLng southwest;
|
||||||
late final LatLng northeast;
|
late final LatLng northeast;
|
||||||
List<CarLocationModel> carLocations = <CarLocationModel>[];
|
List<CarLocationModel> carLocations = <CarLocationModel>[];
|
||||||
// final mainBottomMenuMap = GlobalKey<AnimatedContainer>();
|
// final mainBottomMenuMap = GlobalKey<AnimatedContainer>();
|
||||||
void changeButtomSheetShown() {
|
void changeButtomSheetShown() {
|
||||||
isButtomSheetShown = !isButtomSheetShown;
|
isButtomSheetShown = !isButtomSheetShown;
|
||||||
heightButtomSheetShown = isButtomSheetShown == true ? 240 : 0;
|
heightButtomSheetShown = isButtomSheetShown == true ? 250 : 0;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void changeCashConfirmPageShown() {
|
||||||
|
isCashConfirmPageShown = !isCashConfirmPageShown;
|
||||||
|
cashConfirmPageShown = isCashConfirmPageShown == true ? 250 : 0;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void changePaymentMethodPageShown() {
|
||||||
|
isPaymentMethodPageShown = !isPaymentMethodPageShown;
|
||||||
|
paymentPageShown = isPaymentMethodPageShown == true ? Get.height * .6 : 0;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,6 +77,14 @@ class MapController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void changeCancelRidePageShow() {
|
||||||
|
// rideConfirm == true
|
||||||
|
// ?
|
||||||
|
isCancelRidePageShown = !isCancelRidePageShown;
|
||||||
|
// : cancelRide();
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
void getDrawerMenu() {
|
void getDrawerMenu() {
|
||||||
heightMenuBool = !heightMenuBool;
|
heightMenuBool = !heightMenuBool;
|
||||||
heightMenu = heightMenuBool == true ? 100 : 0;
|
heightMenu = heightMenuBool == true ? 100 : 0;
|
||||||
@@ -68,6 +96,36 @@ class MapController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int selectedReason = -1;
|
||||||
|
|
||||||
|
void selectReason(int index) {
|
||||||
|
selectedReason = index;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool rideConfirm = false;
|
||||||
|
void cancelRide() async {
|
||||||
|
if (rideConfirm == false) {
|
||||||
|
clearPlaces();
|
||||||
|
clearpolyline();
|
||||||
|
data = [];
|
||||||
|
changeCancelRidePageShow();
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
clearPlaces();
|
||||||
|
clearpolyline();
|
||||||
|
data = [];
|
||||||
|
changeCancelRidePageShow();
|
||||||
|
await CRUD().post(link: AppLink.addCancelRide, payload: {
|
||||||
|
"driverID": 1,
|
||||||
|
"passengerID": box.read(BoxName.pasengerID).toString(),
|
||||||
|
"rideID": 222,
|
||||||
|
"note": "zxcz"
|
||||||
|
});
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void changePickerShown() {
|
void changePickerShown() {
|
||||||
isPickerShown = !isPickerShown;
|
isPickerShown = !isPickerShown;
|
||||||
heightPickerContainer = isPickerShown == true ? 150 : 90;
|
heightPickerContainer = isPickerShown == true ? 150 : 90;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class HomePage extends StatelessWidget {
|
|||||||
title: 'Home Page',
|
title: 'Home Page',
|
||||||
body: [
|
body: [
|
||||||
Center(
|
Center(
|
||||||
child: CircleContainer(
|
child: MyCircleContainer(
|
||||||
child: const Icon(Icons.clear),
|
child: const Icon(Icons.clear),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,13 +3,17 @@ import 'package:get/get.dart';
|
|||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:ride/constant/colors.dart';
|
import 'package:ride/constant/colors.dart';
|
||||||
import 'package:ride/controller/home/map_page_controller.dart';
|
import 'package:ride/controller/home/map_page_controller.dart';
|
||||||
|
import 'package:ride/views/home/map_widget.dart/cancel_raide_page.dart';
|
||||||
|
import 'package:ride/views/widgets/circle_container.dart';
|
||||||
import 'package:ride/views/widgets/mycircular.dart';
|
import 'package:ride/views/widgets/mycircular.dart';
|
||||||
|
|
||||||
import '../../controller/home/menu_controller.dart';
|
import '../../controller/home/menu_controller.dart';
|
||||||
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
||||||
|
import 'map_widget.dart/cash_confirm_bottom_page.dart';
|
||||||
import 'map_widget.dart/main_bottom_Menu_map.dart';
|
import 'map_widget.dart/main_bottom_Menu_map.dart';
|
||||||
import 'map_widget.dart/map_menu_widget.dart';
|
import 'map_widget.dart/map_menu_widget.dart';
|
||||||
import 'map_widget.dart/menu_map_page.dart';
|
import 'map_widget.dart/menu_map_page.dart';
|
||||||
|
import 'map_widget.dart/payment_method.page.dart';
|
||||||
import 'map_widget.dart/picker_animation_container.dart';
|
import 'map_widget.dart/picker_animation_container.dart';
|
||||||
|
|
||||||
class MapPage extends StatelessWidget {
|
class MapPage extends StatelessWidget {
|
||||||
@@ -153,11 +157,29 @@ class MapPage extends StatelessWidget {
|
|||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
const PickerIconOnMap(),
|
const PickerIconOnMap(),
|
||||||
PickerAnimtionContainerFormPlaces(),
|
// PickerAnimtionContainerFormPlaces(),
|
||||||
// MainBottomMenuMap(),
|
MainBottomMenuMap(),
|
||||||
const MapMenuWidget(),
|
const MapMenuWidget(),
|
||||||
const MenuIconMapPageWidget(),
|
const MenuIconMapPageWidget(),
|
||||||
buttomSheetMapPage()
|
buttomSheetMapPage(),
|
||||||
|
cancelRidePage(),
|
||||||
|
GetBuilder<MapController>(
|
||||||
|
builder: (controller) => controller.data.isNotEmpty
|
||||||
|
? Positioned(
|
||||||
|
right: 5,
|
||||||
|
top: 55,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
controller.changeCancelRidePageShow();
|
||||||
|
},
|
||||||
|
child: const Icon(
|
||||||
|
Icons.clear,
|
||||||
|
size: 30,
|
||||||
|
),
|
||||||
|
))
|
||||||
|
: const SizedBox()),
|
||||||
|
CashConfirmPageShown(),
|
||||||
|
PaymentMethodPage()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
import '../../../constant/style.dart';
|
import '../../../constant/style.dart';
|
||||||
@@ -17,7 +18,7 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
|||||||
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||||
curve: Curves.easeInCirc,
|
curve: Curves.easeInCirc,
|
||||||
onEnd: () {
|
onEnd: () {
|
||||||
controller.height = 240;
|
controller.height = 250;
|
||||||
},
|
},
|
||||||
height: controller.heightButtomSheetShown,
|
height: controller.heightButtomSheetShown,
|
||||||
duration: const Duration(seconds: 2),
|
duration: const Duration(seconds: 2),
|
||||||
@@ -91,55 +92,115 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
|||||||
child: controller.data.isEmpty
|
child: controller.data.isEmpty
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: Center(
|
: Center(
|
||||||
child: Column(
|
child: Padding(
|
||||||
children: [
|
padding:
|
||||||
Row(
|
const EdgeInsets.symmetric(horizontal: 5),
|
||||||
mainAxisAlignment:
|
child: Column(
|
||||||
MainAxisAlignment.spaceAround,
|
children: [
|
||||||
children: [
|
Row(
|
||||||
Text(
|
children: [
|
||||||
'distance is ${controller.data[0]['distance']['text']}',
|
const Icon(
|
||||||
style: AppStyle.title,
|
Icons.location_on,
|
||||||
|
color: AppColor.redColor,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'From : '.tr,
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
controller.data[0]['start_address']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.location_searching_rounded),
|
||||||
|
const SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'To : '.tr,
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
controller.data[0]['end_address'],
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const Divider(
|
||||||
|
color: AppColor.accentColor,
|
||||||
|
thickness: 1,
|
||||||
|
height: 2,
|
||||||
|
indent: 1,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 40,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(12),
|
||||||
|
// border: Border.all(),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.monetization_on,
|
||||||
|
color: Colors.green[400],
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () => controller
|
||||||
|
.changeCashConfirmPageShown(),
|
||||||
|
child: Text(
|
||||||
|
'CASH',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 40,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.qr_code_2_rounded,
|
||||||
|
color: Colors.green[400],
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Add Promo'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Text(
|
),
|
||||||
'duration is ${controller.data[0]['duration']['text']}',
|
MyElevatedButton(
|
||||||
style: AppStyle.title,
|
title: 'Confirm Selection',
|
||||||
),
|
onPressed: () {},
|
||||||
],
|
)
|
||||||
),
|
],
|
||||||
Row(
|
),
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.spaceAround,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'Cost for .21/km ${controller.cost.toStringAsFixed(2)} ',
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'costDuration ${controller.averageDuration.toStringAsFixed(2)} is ${controller.costDuration.toStringAsFixed(2)} ',
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.spaceAround,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'totalDriver ${controller.totalDriver.toStringAsFixed(2)}',
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'totaME ${controller.totaME.toStringAsFixed(2)} ',
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'Cost for passenger ${controller.totalPassenger.toStringAsFixed(2)} ',
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -149,3 +210,61 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
|||||||
)
|
)
|
||||||
: const SizedBox());
|
: const SizedBox());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Details extends StatelessWidget {
|
||||||
|
const Details({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<MapController>(
|
||||||
|
builder: (controller) => Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'distance is ${controller.data[0]['distance']['text']}',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'duration is ${controller.data[0]['duration']['text']}',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Cost for .21/km ${controller.cost.toStringAsFixed(2)} ',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'costDuration ${controller.averageDuration.toStringAsFixed(2)} is ${controller.costDuration.toStringAsFixed(2)} ',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'totalDriver ${controller.totalDriver.toStringAsFixed(2)}',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'totaME ${controller.totaME.toStringAsFixed(2)} ',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Cost for passenger ${controller.totalPassenger.toStringAsFixed(2)} ',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
87
lib/views/home/map_widget.dart/cancel_raide_page.dart
Normal file
87
lib/views/home/map_widget.dart/cancel_raide_page.dart
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/constant/colors.dart';
|
||||||
|
import 'package:ride/constant/style.dart';
|
||||||
|
import 'package:ride/controller/home/map_page_controller.dart';
|
||||||
|
|
||||||
|
import '../../widgets/elevated_btn.dart';
|
||||||
|
|
||||||
|
GetBuilder<MapController> cancelRidePage() {
|
||||||
|
Get.put(MapController());
|
||||||
|
final List<String> reasons = [
|
||||||
|
"I don't need a ride anymore".tr,
|
||||||
|
"I was just trying the application".tr,
|
||||||
|
"No driver accepted my request".tr,
|
||||||
|
"I added the wrong pick-up/drop-off location".tr,
|
||||||
|
"I don't have a reason".tr,
|
||||||
|
"Other".tr,
|
||||||
|
];
|
||||||
|
return GetBuilder<MapController>(
|
||||||
|
builder: (controller) => controller.isCancelRidePageShown
|
||||||
|
? Positioned(
|
||||||
|
left: 60,
|
||||||
|
top: 40,
|
||||||
|
right: 60,
|
||||||
|
// bottom: 100,
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
boxShadow: [
|
||||||
|
const BoxShadow(
|
||||||
|
color: AppColor.accentColor,
|
||||||
|
offset: Offset(2, 2),
|
||||||
|
blurRadius: 5),
|
||||||
|
BoxShadow(
|
||||||
|
color: AppColor.accentColor.withOpacity(.4),
|
||||||
|
offset: const Offset(-2, -2),
|
||||||
|
blurRadius: 5)
|
||||||
|
],
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(15)),
|
||||||
|
),
|
||||||
|
height: Get.height * .7,
|
||||||
|
width: Get.width * .7,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
child: Text(
|
||||||
|
'Can we know why you want to cancel Ride ?'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 380,
|
||||||
|
width: 300,
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: reasons.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return ListTile(
|
||||||
|
title: Text(reasons[index]),
|
||||||
|
leading: Radio(
|
||||||
|
value: index,
|
||||||
|
groupValue: controller.selectedReason,
|
||||||
|
onChanged: (int? value) {
|
||||||
|
print(value);
|
||||||
|
controller.selectReason(value!);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Cancel Ride'.tr,
|
||||||
|
onPressed: () async {
|
||||||
|
controller.cancelRide();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
|
);
|
||||||
|
}
|
||||||
123
lib/views/home/map_widget.dart/cash_confirm_bottom_page.dart
Normal file
123
lib/views/home/map_widget.dart/cash_confirm_bottom_page.dart
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/constant/style.dart';
|
||||||
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
|
import '../../../constant/colors.dart';
|
||||||
|
import '../../../controller/home/map_page_controller.dart';
|
||||||
|
|
||||||
|
class CashConfirmPageShown extends StatelessWidget {
|
||||||
|
const CashConfirmPageShown({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<MapController>(
|
||||||
|
builder: (controller) => Positioned(
|
||||||
|
right: 5,
|
||||||
|
bottom: 5,
|
||||||
|
left: 5,
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: const Duration(milliseconds: 400),
|
||||||
|
height: controller.cashConfirmPageShown,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Payment Method'.tr,
|
||||||
|
style: AppStyle.title.copyWith(fontSize: 22),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () =>
|
||||||
|
controller.changeCashConfirmPageShown(),
|
||||||
|
icon: const Icon(Icons.close),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.wallet_outlined,
|
||||||
|
size: 25,
|
||||||
|
color: AppColor.redColor,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 20,
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Ride Wallet'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${'Your Wallet balance is '.tr}JD 0.00',
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
Checkbox.adaptive(
|
||||||
|
value: false,
|
||||||
|
onChanged: (value) {},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const Divider(
|
||||||
|
color: AppColor.accentColor,
|
||||||
|
thickness: 1,
|
||||||
|
height: 2,
|
||||||
|
indent: 1,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.monetization_on,
|
||||||
|
color: Colors.green[400],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 20,
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () =>
|
||||||
|
controller.changeCashConfirmPageShown(),
|
||||||
|
child: Text(
|
||||||
|
'CASH',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
Checkbox.adaptive(
|
||||||
|
value: false,
|
||||||
|
onChanged: (value) {},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const Divider(
|
||||||
|
color: AppColor.accentColor,
|
||||||
|
thickness: 1,
|
||||||
|
height: 2,
|
||||||
|
indent: 1,
|
||||||
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Add Payment Method',
|
||||||
|
onPressed: () =>
|
||||||
|
controller.changePaymentMethodPageShown(),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -89,7 +89,10 @@ class MainBottomMenuMap extends StatelessWidget {
|
|||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
controller.isMainBottomMenuMap
|
controller.isMainBottomMenuMap
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: Text('From : Current Location',style: AppStyle.subtitle,),
|
: Text(
|
||||||
|
'From : Current Location',
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
),
|
||||||
controller.isMainBottomMenuMap
|
controller.isMainBottomMenuMap
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: formSearchPlaces()
|
: formSearchPlaces()
|
||||||
@@ -101,96 +104,102 @@ class MainBottomMenuMap extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class FavioratePlacesDialogu extends StatelessWidget {
|
class FavioratePlacesDialogu extends StatelessWidget {
|
||||||
FavioratePlacesDialogu({
|
const FavioratePlacesDialogu({
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
final controller = MapController();
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return DefaultTextStyle(
|
Get.put(MapController());
|
||||||
style: AppStyle.title,
|
return GetBuilder<MapController>(
|
||||||
child: Center(
|
builder: (controller) => DefaultTextStyle(
|
||||||
child: AnimatedTextKit(
|
style: AppStyle.title,
|
||||||
animatedTexts: [
|
child: Center(
|
||||||
TypewriterAnimatedText('Favorite Places'.tr),
|
child: AnimatedTextKit(
|
||||||
ScaleAnimatedText(
|
animatedTexts: [
|
||||||
'Favorite Places'.tr,
|
TypewriterAnimatedText('Favorite Places'.tr),
|
||||||
),
|
ScaleAnimatedText(
|
||||||
TyperAnimatedText(
|
'Favorite Places'.tr,
|
||||||
'Favorite Places'.tr,
|
),
|
||||||
),
|
TyperAnimatedText(
|
||||||
],
|
'Favorite Places'.tr,
|
||||||
isRepeatingAnimation: true,
|
),
|
||||||
onTap: () async {
|
],
|
||||||
List favoritePlaces =
|
isRepeatingAnimation: true,
|
||||||
await sql.getAllData(TableName.placesFavorite);
|
onTap: () async {
|
||||||
print(favoritePlaces);
|
List favoritePlaces =
|
||||||
Get.defaultDialog(
|
await sql.getAllData(TableName.placesFavorite);
|
||||||
title: 'Favorite Places'.tr,
|
print(favoritePlaces);
|
||||||
content: SizedBox(
|
Get.defaultDialog(
|
||||||
width: Get.width * .8,
|
title: 'Favorite Places'.tr,
|
||||||
height: 300,
|
content: SizedBox(
|
||||||
child: favoritePlaces.isEmpty
|
width: Get.width * .8,
|
||||||
? Center(
|
height: 300,
|
||||||
child: Column(
|
child: favoritePlaces.isEmpty
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
? Center(
|
||||||
children: [
|
child: Column(
|
||||||
const Icon(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
Icons.hourglass_empty_rounded,
|
children: [
|
||||||
size: 99,
|
const Icon(
|
||||||
color: AppColor.primaryColor,
|
Icons.hourglass_empty_rounded,
|
||||||
),
|
size: 99,
|
||||||
Text(
|
color: AppColor.primaryColor,
|
||||||
'You Dont Have Any places yet !'.tr,
|
),
|
||||||
style: AppStyle.title,
|
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: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () async {
|
|
||||||
await controller.getMap(
|
|
||||||
'${controller.mylocation.latitude},${controller.mylocation.longitude}',
|
|
||||||
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
|
|
||||||
);
|
|
||||||
controller.changePickerShown();
|
|
||||||
controller.changeButtomSheetShown();
|
|
||||||
controller.bottomSheet();
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
favoritePlaces[index]['name'],
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
IconButton(
|
: ListView.builder(
|
||||||
onPressed: () async {
|
itemCount: favoritePlaces.length,
|
||||||
await sql.deleteData(TableName.placesFavorite,
|
itemBuilder: (BuildContext context, int index) {
|
||||||
favoritePlaces[index]['id']);
|
return Row(
|
||||||
Get.back();
|
mainAxisAlignment:
|
||||||
Get.snackbar('Deleted ',
|
MainAxisAlignment.spaceBetween,
|
||||||
'You are Delete ${favoritePlaces[index]['name']} from your list',
|
children: [
|
||||||
backgroundColor: AppColor.accentColor);
|
TextButton(
|
||||||
|
onPressed: () async {
|
||||||
|
await controller.getMap(
|
||||||
|
'${controller.mylocation.latitude},${controller.mylocation.longitude}',
|
||||||
|
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
|
||||||
|
);
|
||||||
|
controller.changePickerShown();
|
||||||
|
controller.changeButtomSheetShown();
|
||||||
|
controller.bottomSheet();
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
favoritePlaces[index]['name'],
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () async {
|
||||||
|
await sql.deleteData(
|
||||||
|
TableName.placesFavorite,
|
||||||
|
favoritePlaces[index]['id']);
|
||||||
|
Get.back();
|
||||||
|
Get.snackbar('Deleted ',
|
||||||
|
'You are Delete ${favoritePlaces[index]['name']} from your list',
|
||||||
|
backgroundColor:
|
||||||
|
AppColor.accentColor);
|
||||||
|
},
|
||||||
|
icon:
|
||||||
|
const Icon(Icons.favorite_outlined),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.favorite_outlined),
|
|
||||||
),
|
),
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
|
cancel: MyElevatedButton(
|
||||||
|
title: 'Back'.tr, onPressed: () => Get.back()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
cancel: MyElevatedButton(
|
));
|
||||||
title: 'Back'.tr, onPressed: () => Get.back()),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
87
lib/views/home/map_widget.dart/payment_method.page.dart
Normal file
87
lib/views/home/map_widget.dart/payment_method.page.dart
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
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/home/map_page_controller.dart';
|
||||||
|
|
||||||
|
class PaymentMethodPage extends StatelessWidget {
|
||||||
|
const PaymentMethodPage({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<MapController>(
|
||||||
|
builder: (controller) => Positioned(
|
||||||
|
right: 5,
|
||||||
|
bottom: 5,
|
||||||
|
left: 5,
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: const Duration(milliseconds: 400),
|
||||||
|
height: controller.paymentPageShown,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'My Cared'.tr,
|
||||||
|
style: AppStyle.title.copyWith(fontSize: 22),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () =>
|
||||||
|
controller.changePaymentMethodPageShown(),
|
||||||
|
icon: const Icon(Icons.close),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Add Card'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: Get.height * .3,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(15)),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
spreadRadius: 3,
|
||||||
|
offset: Offset(3, 3),
|
||||||
|
blurRadius: 3,
|
||||||
|
color: AppColor.redColor),
|
||||||
|
BoxShadow(
|
||||||
|
offset: Offset(-3, -3),
|
||||||
|
blurRadius: 3,
|
||||||
|
spreadRadius: 3,
|
||||||
|
color: AppColor.redColor)
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Add Credit Card',
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:ride/constant/colors.dart';
|
import 'package:ride/constant/colors.dart';
|
||||||
|
|
||||||
class CircleContainer extends StatelessWidget {
|
class MyCircleContainer extends StatelessWidget {
|
||||||
final Widget child;
|
final Widget child;
|
||||||
final Color backgroundColor;
|
final Color backgroundColor;
|
||||||
final Color borderColor;
|
final Color borderColor;
|
||||||
|
|
||||||
CircleContainer({
|
MyCircleContainer({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.child,
|
required this.child,
|
||||||
this.backgroundColor = AppColor.secondaryColor,
|
this.backgroundColor = AppColor.secondaryColor,
|
||||||
|
|||||||
Reference in New Issue
Block a user