8-18/1
This commit is contained in:
@@ -63,6 +63,7 @@ class LoginController extends GetxController {
|
||||
if (jsonDecoeded['data'][0]['verified'] == 1) {
|
||||
box.write(BoxName.pasengerID, jsonDecoeded['data'][0]['id']);
|
||||
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']);
|
||||
saveData(BoxName.passwoerd, passwordController.text);
|
||||
Get.offAll(() => MapPage());
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/links.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 '../../views/auth/verify_email_page.dart';
|
||||
@@ -63,7 +64,7 @@ class RegisterController extends GetxController {
|
||||
});
|
||||
|
||||
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_polyline_algorithm/google_polyline_algorithm.dart';
|
||||
import 'package:location/location.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/credential.dart';
|
||||
import 'package:ride/constant/links.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/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../main.dart';
|
||||
import '../../models/model/locations.dart';
|
||||
import '../firebase/firbase_messge.dart';
|
||||
|
||||
@@ -39,15 +42,32 @@ class MapController extends GetxController {
|
||||
bool isPickerShown = false;
|
||||
bool isButtomSheetShown = false;
|
||||
bool mapType = false;
|
||||
bool isCancelRidePageShown = false;
|
||||
bool isCashConfirmPageShown = false;
|
||||
bool isPaymentMethodPageShown = false;
|
||||
bool isMainBottomMenuMap = true;
|
||||
double heightButtomSheetShown = 240;
|
||||
double heightButtomSheetShown = 300;
|
||||
double cashConfirmPageShown = 250;
|
||||
double paymentPageShown = 380;
|
||||
late final LatLng southwest;
|
||||
late final LatLng northeast;
|
||||
List<CarLocationModel> carLocations = <CarLocationModel>[];
|
||||
// final mainBottomMenuMap = GlobalKey<AnimatedContainer>();
|
||||
void changeButtomSheetShown() {
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -57,6 +77,14 @@ class MapController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
void changeCancelRidePageShow() {
|
||||
// rideConfirm == true
|
||||
// ?
|
||||
isCancelRidePageShown = !isCancelRidePageShown;
|
||||
// : cancelRide();
|
||||
update();
|
||||
}
|
||||
|
||||
void getDrawerMenu() {
|
||||
heightMenuBool = !heightMenuBool;
|
||||
heightMenu = heightMenuBool == true ? 100 : 0;
|
||||
@@ -68,6 +96,36 @@ class MapController extends GetxController {
|
||||
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() {
|
||||
isPickerShown = !isPickerShown;
|
||||
heightPickerContainer = isPickerShown == true ? 150 : 90;
|
||||
|
||||
Reference in New Issue
Block a user