12/31/1
This commit is contained in:
BIN
assets/images/brand.png
Normal file
BIN
assets/images/brand.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -8,7 +8,7 @@
|
||||
<string>Explanation of why your app needs access to the photo library.</string>
|
||||
|
||||
<key>NSFaceIDUsageDescription</key>
|
||||
<string>Use Face ID to securely authenticate payment accounts.</string>
|
||||
<string>Use Face ID to securely authenticate payment accounts.</string>
|
||||
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>This app requires access to your microphone to record audio, allowing you to add voice recordings to your photos and videos.</string>
|
||||
@@ -37,11 +37,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>4</string>
|
||||
<string>12</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.04</string>
|
||||
<string>1.32</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/links.dart';
|
||||
import 'package:ride/controller/functions/crud.dart';
|
||||
@@ -8,37 +9,46 @@ import '../../models/model/admin/monthly_ride.dart';
|
||||
|
||||
class RideAdminController extends GetxController {
|
||||
bool isLoading = false;
|
||||
late List<RideData> rideData;
|
||||
late List<MonthlyDataModel> rideData;
|
||||
late Map<String, dynamic> jsonResponse;
|
||||
List<dynamic> ridesDetails = [];
|
||||
// var chartData;
|
||||
late List<ChartDataS> chartDatasync;
|
||||
var chartData;
|
||||
// late List<ChartDataS> chartDatasync;
|
||||
Future getRidesAdminDash() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().get(link: AppLink.getRidesPerMonth, payload: {});
|
||||
jsonResponse = jsonDecode(res);
|
||||
|
||||
chartDatasync = (jsonResponse['message'] as List)
|
||||
.map((item) => ChartDataS(
|
||||
item['year'],
|
||||
item['month'],
|
||||
item['day'],
|
||||
item['rides_count'],
|
||||
))
|
||||
rideData = (jsonResponse['message'] as List)
|
||||
.map((item) => MonthlyDataModel.fromJson(item))
|
||||
.toList();
|
||||
|
||||
chartData = rideData
|
||||
.map((data) => FlSpot(data.day.toDouble(), data.ridesCount.toDouble()))
|
||||
.toList();
|
||||
|
||||
// chartDatasync = (jsonResponse['message'] as List)
|
||||
// .map((item) => ChartDataS(
|
||||
// item['year'],
|
||||
// item['month'],
|
||||
// item['day'],
|
||||
// item['rides_count'],
|
||||
// ))
|
||||
// .toList();
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
Future getRidesDetails() async {
|
||||
// isLoading = true;
|
||||
// update();
|
||||
var res = await CRUD().get(link: AppLink.getRidesDetails, payload: {});
|
||||
|
||||
var d = jsonDecode(res);
|
||||
ridesDetails = d['message'];
|
||||
|
||||
isLoading = false;
|
||||
update();
|
||||
// isLoading = false;
|
||||
// update();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -53,11 +63,11 @@ class RideAdminController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
class ChartDataS {
|
||||
ChartDataS(this.year, this.month, this.day, this.ridesCount);
|
||||
// class ChartDataS {
|
||||
// ChartDataS(this.year, this.month, this.day, this.ridesCount);
|
||||
|
||||
final int year;
|
||||
final int month;
|
||||
final int day;
|
||||
final int ridesCount;
|
||||
}
|
||||
// final int year;
|
||||
// final int month;
|
||||
// final int day;
|
||||
// final int ridesCount;
|
||||
// }
|
||||
|
||||
20
lib/controller/admin/wallet_admin_controller.dart
Normal file
20
lib/controller/admin/wallet_admin_controller.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../constant/links.dart';
|
||||
import '../functions/crud.dart';
|
||||
|
||||
class WalletAdminController extends GetxController {
|
||||
bool isLoading = false;
|
||||
|
||||
late Map<String, dynamic> jsonResponse;
|
||||
List<dynamic> walletDetails = [];
|
||||
|
||||
Future getWalletAdminDash() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().get(link: AppLink.getRidesPerMonth, payload: {});
|
||||
jsonResponse = jsonDecode(res);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -41,17 +42,32 @@ class LoginController extends GetxController {
|
||||
void adminDashboardOpen() async {
|
||||
if (formKeyAdmin.currentState!.validate()) {
|
||||
await DeviceInfoPlus.getDeviceInfo();
|
||||
print(DeviceInfoPlus.deviceData['serialNumber']);
|
||||
var res = await CRUD().get(link: AppLink.getAdminUser, payload: {
|
||||
'device_number': DeviceInfoPlus.deviceData['serialNumber'].toString(),
|
||||
});
|
||||
var d = jsonDecode(res);
|
||||
// print(d);
|
||||
// if (DeviceInfoPlus.deviceData['serialNumber'] ==
|
||||
// d['message']['device_number']) {
|
||||
Get.back();
|
||||
Get.to(() => AdminHomePage());
|
||||
// }
|
||||
if (Platform.isAndroid) {
|
||||
print(DeviceInfoPlus.deviceData['serialNumber']);
|
||||
var res = await CRUD().get(link: AppLink.getAdminUser, payload: {
|
||||
'device_number': DeviceInfoPlus.deviceData['serialNumber'].toString(),
|
||||
});
|
||||
var d = jsonDecode(res);
|
||||
// print(d);
|
||||
// if (DeviceInfoPlus.deviceData['serialNumber'] ==
|
||||
// d['message']['device_number']) {
|
||||
Get.back();
|
||||
Get.to(() => const AdminHomePage());
|
||||
// }
|
||||
}
|
||||
if (Platform.isIOS) {
|
||||
print(DeviceInfoPlus.deviceData['identifierForVendor']);
|
||||
// var res = await CRUD().get(link: AppLink.getAdminUser, payload: {
|
||||
// 'device_number': DeviceInfoPlus.deviceData['identifierForVendor'].toString(),
|
||||
// });
|
||||
// var d = jsonDecode(res);
|
||||
// print(d);
|
||||
// if (DeviceInfoPlus.deviceData['serialNumber'] ==
|
||||
// d['message']['device_number']) {
|
||||
Get.back();
|
||||
Get.to(() => const AdminHomePage());
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ class HomeCaptainController extends GetxController {
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
addToken();
|
||||
await addToken();
|
||||
onButtonSelected();
|
||||
getPaymentToday();
|
||||
getAllPayment();
|
||||
@@ -191,11 +191,11 @@ class HomeCaptainController extends GetxController {
|
||||
}
|
||||
|
||||
addToken() async {
|
||||
box.write(BoxName.statusDriverLocation, 'off');
|
||||
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
||||
'token': box.read(BoxName.tokenDriver),
|
||||
'captain_id': box.read(BoxName.driverID).toString()
|
||||
}).then((value) => print('Token Added'));
|
||||
box.write(BoxName.statusDriverLocation, 'off');
|
||||
}
|
||||
|
||||
getPaymentToday() async {
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:ride/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:ride/controller/home/captin/widget/zones_controller.dart';
|
||||
|
||||
import '../../../../constant/colors.dart';
|
||||
|
||||
@@ -25,22 +25,26 @@ import '../payment/payment_controller.dart';
|
||||
|
||||
class MapPassengerController extends GetxController {
|
||||
bool isLoading = true;
|
||||
TextEditingController placeController = TextEditingController();
|
||||
TextEditingController placeDestinationController = TextEditingController();
|
||||
TextEditingController placeStartController = TextEditingController();
|
||||
TextEditingController sosPhonePassengerProfile = TextEditingController();
|
||||
final sosFormKey = GlobalKey<FormState>();
|
||||
List data = [];
|
||||
List<LatLng> bounds = [];
|
||||
List places = [];
|
||||
List placesStart = [];
|
||||
List placesDestination = [];
|
||||
LatLngBounds? boundsdata;
|
||||
List<Marker> markers = [];
|
||||
List<Polyline> polyLines = [];
|
||||
late LatLng myLocation;
|
||||
late LatLng newMyLocation = const LatLng(32.115295, 36.064773);
|
||||
late LatLng newStartPointLocation = const LatLng(32.115295, 36.064773);
|
||||
LatLng myDestination = const LatLng(32.115295, 36.064773);
|
||||
final List<LatLng> polylineCoordinates = [];
|
||||
List<LatLng> carsLocationByPassenger = [];
|
||||
List<LatLng> driverCarsLocationToPassengerAfterApplied = [];
|
||||
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
||||
BitmapDescriptor tripIcon = BitmapDescriptor.defaultMarker;
|
||||
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
||||
double height = 150;
|
||||
DateTime currentTime = DateTime.now();
|
||||
@@ -50,6 +54,7 @@ class MapPassengerController extends GetxController {
|
||||
double widthMenu = 0;
|
||||
double heightPickerContainer = 90;
|
||||
double mainBottomMenuMap = Get.height * .2;
|
||||
bool startLocationFromMap = false;
|
||||
bool heightMenuBool = false;
|
||||
bool isPickerShown = false;
|
||||
bool isBottomSheetShown = false;
|
||||
@@ -87,10 +92,14 @@ class MapPassengerController extends GetxController {
|
||||
double progressTimerRideBegin = 0;
|
||||
int remainingTimeTimerRideBegin = 60;
|
||||
String stringRemainingTimeRideBegin = '';
|
||||
String hintTextStartPoint = 'Search for your Start point'.tr;
|
||||
String currentLocationString = 'Current Location'.tr;
|
||||
String hintTextDestinationPoint = 'Search for your destination'.tr;
|
||||
late String rideId;
|
||||
bool noCarString = false;
|
||||
bool isCashSelectedBeforeConfirmRide = false;
|
||||
bool isPassengerChosen = false;
|
||||
bool currentLocationToFormPlaces = false;
|
||||
late String driverToken;
|
||||
int carsOrder = 0;
|
||||
String? mapAPIKEY;
|
||||
@@ -105,6 +114,41 @@ class MapPassengerController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
void getCurrentLocationFormString() async {
|
||||
currentLocationToFormPlaces = true;
|
||||
await getLocation();
|
||||
currentLocationString = myLocation.toString();
|
||||
newStartPointLocation = myLocation;
|
||||
update();
|
||||
}
|
||||
|
||||
void convertHintTextStartNewPlaces(int index) {
|
||||
if (placesStart.isEmpty) {
|
||||
hintTextStartPoint = 'Search for your Start point'.tr;
|
||||
update();
|
||||
} else {
|
||||
hintTextStartPoint = placesStart[index]['name'];
|
||||
double lat = placesStart[index]['geometry']['location']['lat'];
|
||||
double lng = placesStart[index]['geometry']['location']['lng'];
|
||||
newStartPointLocation = LatLng(lat, lng);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void convertHintTextDestinationNewPlaces(int index) {
|
||||
if (placesDestination.isEmpty) {
|
||||
hintTextDestinationPoint = 'Search for your destination'.tr;
|
||||
update();
|
||||
} else {
|
||||
hintTextDestinationPoint = placesDestination[index]['name'];
|
||||
double lat = placesDestination[index]['geometry']['location']['lat'];
|
||||
double lng = placesDestination[index]['geometry']['location']['lng'];
|
||||
newMyLocation = LatLng(lat, lng);
|
||||
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
// final mainBottomMenuMap = GlobalKey<AnimatedContainer>();
|
||||
void changeBottomSheetShown() {
|
||||
isBottomSheetShown = !isBottomSheetShown;
|
||||
@@ -261,8 +305,15 @@ class MapPassengerController extends GetxController {
|
||||
timerToPassengerFromDriverAfterApplied?.cancel();
|
||||
}
|
||||
|
||||
void clearPlaces() {
|
||||
places = [];
|
||||
void clearPlacesDestination() {
|
||||
placesDestination = [];
|
||||
hintTextDestinationPoint = 'Search for your destination'.tr;
|
||||
update();
|
||||
}
|
||||
|
||||
void clearPlacesStart() {
|
||||
placesStart = [];
|
||||
hintTextStartPoint = 'Search for your Start point'.tr;
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -558,7 +609,7 @@ class MapPassengerController extends GetxController {
|
||||
}
|
||||
|
||||
restCounter() {
|
||||
clearPlaces();
|
||||
clearPlacesDestination();
|
||||
clearPolyline();
|
||||
data = [];
|
||||
rideConfirm = false;
|
||||
@@ -568,7 +619,7 @@ class MapPassengerController extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> cancelRideAfterRejectFromAll() async {
|
||||
clearPlaces();
|
||||
clearPlacesDestination();
|
||||
clearPolyline();
|
||||
data = [];
|
||||
await CRUD().post(link: AppLink.updateDriverOrder, payload: {
|
||||
@@ -591,7 +642,7 @@ class MapPassengerController extends GetxController {
|
||||
print("rideConfirm=$rideConfirm");
|
||||
|
||||
if (rideConfirm == false) {
|
||||
clearPlaces();
|
||||
clearPlacesDestination();
|
||||
clearPolyline();
|
||||
data = [];
|
||||
changeCancelRidePageShow();
|
||||
@@ -604,7 +655,7 @@ class MapPassengerController extends GetxController {
|
||||
timeToPassengerFromDriverAfterApplied = 0;
|
||||
update();
|
||||
} else {
|
||||
clearPlaces();
|
||||
clearPlacesDestination();
|
||||
clearPolyline();
|
||||
data = [];
|
||||
await CRUD().post(link: AppLink.updateDriverOrder, payload: {
|
||||
@@ -634,15 +685,24 @@ class MapPassengerController extends GetxController {
|
||||
void changeMainBottomMenuMap() {
|
||||
isMainBottomMenuMap = !isMainBottomMenuMap;
|
||||
mainBottomMenuMap =
|
||||
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .66;
|
||||
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .7;
|
||||
if (heightMenuBool == true) {
|
||||
getDrawerMenu();
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
changeHeight() {
|
||||
if (places.isEmpty) {
|
||||
changeHeightPlaces() {
|
||||
if (placesDestination.isEmpty) {
|
||||
height = 0;
|
||||
update();
|
||||
}
|
||||
height = 150;
|
||||
update();
|
||||
}
|
||||
|
||||
changeHeightStartPlaces() {
|
||||
if (placesStart.isEmpty) {
|
||||
height = 0;
|
||||
update();
|
||||
}
|
||||
@@ -659,12 +719,24 @@ class MapPassengerController extends GetxController {
|
||||
Future getPlaces() async {
|
||||
var url =
|
||||
// '${AppLink.googleMapsLink}place/nearbysearch/json?location=${mylocation.longitude}&radius=25000&language=ar&keyword=&key=${placeController.text}${AK.mapAPIKEY}';
|
||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${placeController.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${placeDestinationController.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||
|
||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||
|
||||
places = response['results'];
|
||||
print(places);
|
||||
placesDestination = response['results'];
|
||||
print(placesDestination);
|
||||
update();
|
||||
}
|
||||
|
||||
Future getPlacesStart() async {
|
||||
var url =
|
||||
// '${AppLink.googleMapsLink}place/nearbysearch/json?location=${mylocation.longitude}&radius=25000&language=ar&keyword=&key=${placeController.text}${AK.mapAPIKEY}';
|
||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${placeStartController.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||
|
||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||
|
||||
placesStart = response['results'];
|
||||
print(placesStart);
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -693,9 +765,21 @@ class MapPassengerController extends GetxController {
|
||||
});
|
||||
}
|
||||
|
||||
void addCustomTripIcon() {
|
||||
ImageConfiguration config = ImageConfiguration(
|
||||
size: Size(Get.width * .6, Get.height * .6),
|
||||
);
|
||||
BitmapDescriptor.fromAssetImage(config, 'assets/images/picker.png')
|
||||
.then((value) {
|
||||
tripIcon = value;
|
||||
update();
|
||||
});
|
||||
}
|
||||
|
||||
void addCustomCarIcon() {
|
||||
ImageConfiguration config = ImageConfiguration(
|
||||
size: Size(Get.width * .6, Get.height * .6),
|
||||
// size: Size(20, 20),
|
||||
// scale: 1.0,
|
||||
);
|
||||
BitmapDescriptor.fromAssetImage(config, 'assets/images/car.png')
|
||||
@@ -742,10 +826,10 @@ class MapPassengerController extends GetxController {
|
||||
: null)!;
|
||||
|
||||
// Print location details
|
||||
print('Accuracy: ${_locationData.accuracy}');
|
||||
print('Latitude: ${_locationData.latitude}');
|
||||
print('Longitude: ${_locationData.longitude}');
|
||||
print('Time: ${_locationData.time}');
|
||||
// print('Accuracy: ${_locationData.accuracy}');
|
||||
// print('Latitude: ${_locationData.latitude}');
|
||||
// print('Longitude: ${_locationData.longitude}');
|
||||
// print('Time: ${_locationData.time}');
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
@@ -926,19 +1010,23 @@ class MapPassengerController extends GetxController {
|
||||
getMap(String origin, destination) async {
|
||||
var origin1 = fromString(origin);
|
||||
var destination1 = fromString(destination);
|
||||
isLoading = false;
|
||||
isLoading = true;
|
||||
update();
|
||||
myDestination = destination1;
|
||||
myLocation = origin1;
|
||||
update();
|
||||
|
||||
await getCarsLocationByPassenger();
|
||||
// print(carsLocationByPassenger);
|
||||
|
||||
isLoading = false;
|
||||
update();
|
||||
var url =
|
||||
('${AppLink.googleMapsLink}directions/json?&language=en&avoid=tolls|ferries&destination=$destination&origin=$origin&key=${AK.mapAPIKEY}');
|
||||
|
||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||
data = response['routes'][0]['legs'];
|
||||
print(data);
|
||||
isLoading = false;
|
||||
update();
|
||||
durationToRide = data[0]['duration']['value'];
|
||||
final points =
|
||||
decodePolyline(response["routes"][0]["overview_polyline"]["points"]);
|
||||
@@ -1137,83 +1225,6 @@ class MapPassengerController extends GetxController {
|
||||
// buttomSheetMapPage();
|
||||
changeBottomSheetShown();
|
||||
}
|
||||
|
||||
// Get.bottomSheet(
|
||||
// Container(
|
||||
// height: 130,
|
||||
// decoration: const BoxDecoration(
|
||||
// color: AppColor.secondaryColor,
|
||||
// borderRadius: BorderRadius.only(
|
||||
// topLeft: Radius.circular(15), topRight: Radius.circular(15))),
|
||||
// child: data.isEmpty
|
||||
// ? Center(
|
||||
// child: Text(
|
||||
// 'Where are you want to go..',
|
||||
// style: AppStyle.title,
|
||||
// ))
|
||||
// : Center(
|
||||
// child: Column(
|
||||
// children: [
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
// children: [
|
||||
// Text(
|
||||
// 'distance is ${data[0]['distance']['text']}',
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// Text(
|
||||
// 'duration is ${data[0]['duration']['text']}',
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Cost for .21/km ${cost.toStringAsFixed(2)} ',
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// Text(
|
||||
// 'costDuration ${averageDuration.toStringAsFixed(2)} is ${costDuration.toStringAsFixed(2)} ',
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Cost for passenger ${totalPassenger.toStringAsFixed(2)} ',
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// Text(
|
||||
// 'totaME ${totaME.toStringAsFixed(2)} ',
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// Text(
|
||||
// 'totalDriver ${totalDriver.toStringAsFixed(2)}',
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// elevation: 6,
|
||||
// enableDrag: true,
|
||||
// isScrollControlled: true,
|
||||
// isDismissible: true,
|
||||
// useRootNavigator: true,
|
||||
// backgroundColor: Colors.transparent,
|
||||
// barrierColor: AppColor.accentColor.withOpacity(.4),
|
||||
// persistent: true,
|
||||
// shape: ShapeBorder.lerp(
|
||||
// RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
// RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
|
||||
// 0.5),
|
||||
// );
|
||||
}
|
||||
|
||||
addToken() async {
|
||||
@@ -1234,6 +1245,7 @@ class MapPassengerController extends GetxController {
|
||||
getNearestDriverByPassengerLocation();
|
||||
addCustomPicker();
|
||||
addCustomCarIcon();
|
||||
addCustomTripIcon();
|
||||
startMarkerReloading();
|
||||
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
|
||||
super.onInit();
|
||||
|
||||
@@ -53,11 +53,11 @@ void main() async {
|
||||
];
|
||||
// cameras = await availableCameras();
|
||||
await Future.wait(initializationTasks);
|
||||
SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.portraitUp,
|
||||
DeviceOrientation.portraitDown,
|
||||
]);
|
||||
}
|
||||
SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.portraitUp,
|
||||
DeviceOrientation.portraitDown,
|
||||
]);
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
class RideData {
|
||||
class MonthlyDataModel {
|
||||
final int year;
|
||||
final int month;
|
||||
final int day;
|
||||
final int ridesCount;
|
||||
|
||||
RideData({
|
||||
MonthlyDataModel({
|
||||
required this.year,
|
||||
required this.month,
|
||||
required this.day,
|
||||
required this.ridesCount,
|
||||
});
|
||||
|
||||
factory RideData.fromJson(Map<String, dynamic> json) => RideData(
|
||||
factory MonthlyDataModel.fromJson(Map<String, dynamic> json) =>
|
||||
MonthlyDataModel(
|
||||
year: json['year'] as int,
|
||||
month: json['month'] as int,
|
||||
day: json['day'] as int,
|
||||
|
||||
@@ -9,7 +9,6 @@ import '../../../controller/admin/captain_admin_controller.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import '../../widgets/my_textField.dart';
|
||||
import '../../widgets/mycircular.dart';
|
||||
import '../passenger/form_passenger.dart';
|
||||
import 'form_captain.dart';
|
||||
|
||||
class Captain extends StatelessWidget {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:fl_chart/fl_chart.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/views/widgets/my_scafold.dart';
|
||||
import 'package:ride/views/widgets/mycircular.dart';
|
||||
import 'package:syncfusion_flutter_charts/charts.dart';
|
||||
|
||||
import '../../../controller/admin/ride_admin_controller.dart';
|
||||
|
||||
@@ -19,136 +19,136 @@ class Rides extends StatelessWidget {
|
||||
? const Center(child: MyCircularProgressIndicator())
|
||||
: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: Get.height * .4,
|
||||
child: LineChart(
|
||||
duration: const Duration(milliseconds: 150),
|
||||
curve: Curves.ease,
|
||||
LineChartData(
|
||||
lineBarsData: [
|
||||
LineChartBarData(
|
||||
spots: rideAdminController.chartData,
|
||||
isCurved: true,
|
||||
color: Colors.deepPurpleAccent, // Custom color
|
||||
barWidth: 3, // Thinner line
|
||||
dotData: const FlDotData(
|
||||
show: true), // Show dots on each point
|
||||
belowBarData: BarAreaData(
|
||||
// Add gradient fill below the line
|
||||
show: true,
|
||||
color: AppColor.deepPurpleAccent,
|
||||
),
|
||||
isStrokeJoinRound: true,
|
||||
shadow: const BoxShadow(
|
||||
color: AppColor.yellowColor,
|
||||
blurRadius: 4,
|
||||
offset: Offset(2, 2),
|
||||
),
|
||||
),
|
||||
],
|
||||
showingTooltipIndicators: const [],
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
topTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Days',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30, showTitles: true)),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Total Trips on month'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30, showTitles: true)),
|
||||
leftTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Counts of Trips on month'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30, showTitles: true)),
|
||||
),
|
||||
gridData: const FlGridData(
|
||||
show: true,
|
||||
),
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: const Border(
|
||||
bottom: BorderSide(color: AppColor.accentColor),
|
||||
left: BorderSide(color: AppColor.accentColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// SizedBox(
|
||||
// height: Get.height * .4,
|
||||
// child: LineChart(
|
||||
// duration: const Duration(milliseconds: 150),
|
||||
// curve: Curves.ease,
|
||||
// LineChartData(
|
||||
// lineBarsData: [
|
||||
// LineChartBarData(
|
||||
// spots: rideAdminController.chartData,
|
||||
// isCurved: true,
|
||||
// color: Colors.deepPurpleAccent, // Custom color
|
||||
// barWidth: 3, // Thinner line
|
||||
// dotData: const FlDotData(
|
||||
// show: true), // Show dots on each point
|
||||
// belowBarData: BarAreaData(
|
||||
// // Add gradient fill below the line
|
||||
// show: true,
|
||||
// color: AppColor.deepPurpleAccent,
|
||||
// child: PieChart(
|
||||
// PieChartData(
|
||||
// sectionsSpace: 4, // Adjust spacing between sections
|
||||
// centerSpaceRadius:
|
||||
// 40, // Adjust radius of center space
|
||||
// sections: [
|
||||
// for (final rideData in rideAdminController.rideData)
|
||||
// PieChartSectionData(
|
||||
// value: rideData.ridesCount.toDouble(),
|
||||
// title: '${rideData.day}', showTitle: true,
|
||||
// titleStyle:
|
||||
// AppStyle.subtitle, // Display day as title
|
||||
// radius: 60, // Adjust radius of each section
|
||||
// color:
|
||||
// AppColor.deepPurpleAccent, // Custom color
|
||||
// ),
|
||||
// isStrokeJoinRound: true,
|
||||
// shadow: const BoxShadow(
|
||||
// color: AppColor.yellowColor,
|
||||
// blurRadius: 4,
|
||||
// offset: Offset(2, 2),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// showingTooltipIndicators: const [],
|
||||
// titlesData: FlTitlesData(
|
||||
// show: true,
|
||||
// topTitles: AxisTitles(
|
||||
// axisNameWidget: Text(
|
||||
// 'Days',
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// axisNameSize: 30,
|
||||
// sideTitles: const SideTitles(
|
||||
// reservedSize: 30, showTitles: true)),
|
||||
// bottomTitles: AxisTitles(
|
||||
// axisNameWidget: Text(
|
||||
// 'Total Trips on month'.tr,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// axisNameSize: 30,
|
||||
// sideTitles: const SideTitles(
|
||||
// reservedSize: 30, showTitles: true)),
|
||||
// leftTitles: AxisTitles(
|
||||
// axisNameWidget: Text(
|
||||
// 'Counts of Trips on month'.tr,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// axisNameSize: 30,
|
||||
// sideTitles: const SideTitles(
|
||||
// reservedSize: 30, showTitles: true)),
|
||||
// ),
|
||||
// gridData: const FlGridData(
|
||||
// show: true,
|
||||
// ),
|
||||
// borderData: FlBorderData(
|
||||
// show: true,
|
||||
// border: const Border(
|
||||
// bottom: BorderSide(color: AppColor.accentColor),
|
||||
// left: BorderSide(color: AppColor.accentColor),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// // SizedBox(
|
||||
// // height: Get.height * .4,
|
||||
// // child: PieChart(
|
||||
// // PieChartData(
|
||||
// // sectionsSpace: 4, // Adjust spacing between sections
|
||||
// // centerSpaceRadius:
|
||||
// // 40, // Adjust radius of center space
|
||||
// // sections: [
|
||||
// // for (final rideData in rideAdminController.rideData)
|
||||
// // PieChartSectionData(
|
||||
// // value: rideData.ridesCount.toDouble(),
|
||||
// // title: '${rideData.day}', showTitle: true,
|
||||
// // titleStyle:
|
||||
// // AppStyle.subtitle, // Display day as title
|
||||
// // radius: 60, // Adjust radius of each section
|
||||
// // color:
|
||||
// // AppColor.deepPurpleAccent, // Custom color
|
||||
// // ),
|
||||
// // ],
|
||||
// // ),
|
||||
// // ),
|
||||
// // ),
|
||||
|
||||
SizedBox(
|
||||
// height: 400,
|
||||
child: SfCartesianChart(
|
||||
legend: const Legend(
|
||||
isVisible: true,
|
||||
position: LegendPosition.bottom,
|
||||
overflowMode: LegendItemOverflowMode.wrap,
|
||||
textStyle: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
borderWidth: 2,
|
||||
borderColor: AppColor.blueColor,
|
||||
plotAreaBorderColor: AppColor.deepPurpleAccent,
|
||||
enableAxisAnimation: true,
|
||||
primaryXAxis: CategoryAxis(
|
||||
borderColor: AppColor.accentColor, borderWidth: 2,
|
||||
title: AxisTitle(
|
||||
text: 'Total Trips on month'.tr,
|
||||
textStyle: AppStyle.title,
|
||||
),
|
||||
// labelRotation: 45,
|
||||
majorGridLines: const MajorGridLines(width: 0),
|
||||
),
|
||||
primaryYAxis: const NumericAxis(isVisible: false),
|
||||
series: <LineSeries<ChartDataS, String>>[
|
||||
LineSeries<ChartDataS, String>(
|
||||
dataSource: rideAdminController.chartDatasync,
|
||||
xValueMapper: (ChartDataS data, _) => '${data.day}',
|
||||
yValueMapper: (ChartDataS data, _) =>
|
||||
data.ridesCount,
|
||||
dataLabelSettings:
|
||||
const DataLabelSettings(isVisible: true),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// SizedBox(
|
||||
// // height: 400,
|
||||
// child: SfCartesianChart(
|
||||
// legend: const Legend(
|
||||
// isVisible: true,
|
||||
// position: LegendPosition.bottom,
|
||||
// overflowMode: LegendItemOverflowMode.wrap,
|
||||
// textStyle: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 12,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// ),
|
||||
// borderWidth: 2,
|
||||
// borderColor: AppColor.blueColor,
|
||||
// plotAreaBorderColor: AppColor.deepPurpleAccent,
|
||||
// enableAxisAnimation: true,
|
||||
// primaryXAxis: CategoryAxis(
|
||||
// borderColor: AppColor.accentColor, borderWidth: 2,
|
||||
// title: AxisTitle(
|
||||
// text: 'Total Trips on month'.tr,
|
||||
// textStyle: AppStyle.title,
|
||||
// ),
|
||||
// // labelRotation: 45,
|
||||
// majorGridLines: const MajorGridLines(width: 0),
|
||||
// ),
|
||||
// primaryYAxis: const NumericAxis(isVisible: false),
|
||||
// series: <LineSeries<ChartDataS, String>>[
|
||||
// LineSeries<ChartDataS, String>(
|
||||
// dataSource: rideAdminController.chartDatasync,
|
||||
// xValueMapper: (ChartDataS data, _) => '${data.day}',
|
||||
// yValueMapper: (ChartDataS data, _) =>
|
||||
// data.ridesCount,
|
||||
// dataLabelSettings:
|
||||
// const DataLabelSettings(isVisible: true),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
|
||||
@@ -2,9 +2,12 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
class Wallet extends StatelessWidget {
|
||||
const Wallet({super.key});
|
||||
import '../../../controller/admin/wallet_admin_controller.dart';
|
||||
|
||||
class Wallet extends StatelessWidget {
|
||||
Wallet({super.key});
|
||||
WalletAdminController walletAdminController =
|
||||
Get.put(WalletAdminController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(title: 'Wallet'.tr, body: [], isleading: true);
|
||||
|
||||
@@ -29,13 +29,13 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
|
||||
width: 2,
|
||||
)),
|
||||
suffixIcon: const Icon(Icons.search),
|
||||
hintText: 'Search for your destination'.tr,
|
||||
hintText: controller.hintTextDestinationPoint,
|
||||
hintStyle: AppStyle.title,
|
||||
hintMaxLines: 1,
|
||||
prefixIcon: IconButton(
|
||||
onPressed: () {
|
||||
controller.placeController.clear();
|
||||
controller.clearPlaces();
|
||||
controller.placeDestinationController.clear();
|
||||
controller.clearPlacesDestination();
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.clear,
|
||||
@@ -43,18 +43,19 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
|
||||
),
|
||||
),
|
||||
),
|
||||
controller: controller.placeController,
|
||||
controller: controller.placeDestinationController,
|
||||
onChanged: (value) {
|
||||
if (controller.placeController.text.length > 5) {
|
||||
if (controller.placeDestinationController.text.length >
|
||||
5) {
|
||||
controller.getPlaces();
|
||||
controller.changeHeight();
|
||||
controller.changeHeightPlaces();
|
||||
}
|
||||
},
|
||||
// onEditingComplete: () => controller.changeHeight(),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.places.isEmpty
|
||||
controller.placesDestination.isEmpty
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
controller.changeMainBottomMenuMap();
|
||||
@@ -68,37 +69,25 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
|
||||
)
|
||||
: const SizedBox(),
|
||||
Container(
|
||||
height: controller.places.isNotEmpty ? controller.height : 0,
|
||||
height: controller.placesDestination.isNotEmpty
|
||||
? controller.height
|
||||
: 0,
|
||||
color: AppColor.secondaryColor,
|
||||
child: ListView.builder(
|
||||
itemCount: controller.places.length,
|
||||
itemCount: controller.placesDestination.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var res = controller.places[index];
|
||||
var res = controller.placesDestination[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
controller.changeHeight();
|
||||
Get.defaultDialog(
|
||||
title:
|
||||
'${'Are You sure to ride to'.tr} ${res['name']}',
|
||||
middleText: '',
|
||||
titleStyle: AppStyle.title,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Confirm'.tr,
|
||||
onPressed: () async {
|
||||
controller.clearPolyline();
|
||||
controller.data = [];
|
||||
await controller.getMap(
|
||||
'${controller.myLocation.latitude.toString()},${controller.myLocation.longitude.toString()}',
|
||||
"${res['geometry']['location']['lat']},${res['geometry']['location']['lng']}");
|
||||
controller.places = [];
|
||||
controller.placeController.clear();
|
||||
onTap: () async {
|
||||
controller.changeHeightPlaces();
|
||||
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
controller.showBottomSheet1();
|
||||
controller.changeMainBottomMenuMap();
|
||||
}),
|
||||
);
|
||||
controller.changeHeightPlaces();
|
||||
|
||||
controller.myLocation = controller.newMyLocation;
|
||||
controller.convertHintTextDestinationNewPlaces(index);
|
||||
|
||||
controller.placesDestination = [];
|
||||
controller.placeDestinationController.clear();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
|
||||
165
lib/views/home/map_widget.dart/form_search_start.dart
Normal file
165
lib/views/home/map_widget.dart/form_search_start.dart
Normal file
@@ -0,0 +1,165 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/table_names.dart';
|
||||
import 'package:ride/views/widgets/my_textField.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../main.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> formSearchPlacesStart() {
|
||||
// DbSql sql = DbSql.instance;
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Container(
|
||||
decoration:
|
||||
const BoxDecoration(color: AppColor.secondaryColor),
|
||||
child: TextField(
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.only(),
|
||||
gapPadding: 4,
|
||||
borderSide: BorderSide(
|
||||
color: AppColor.redColor,
|
||||
width: 2,
|
||||
)),
|
||||
suffixIcon: const Icon(Icons.search),
|
||||
hintText: controller.hintTextStartPoint,
|
||||
hintStyle: AppStyle.title,
|
||||
hintMaxLines: 1,
|
||||
prefixIcon: IconButton(
|
||||
onPressed: () {
|
||||
controller.placeStartController.clear();
|
||||
controller.clearPlacesStart();
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.clear,
|
||||
color: Colors.red[300],
|
||||
),
|
||||
),
|
||||
),
|
||||
controller: controller.placeStartController,
|
||||
onChanged: (value) {
|
||||
if (controller.placeStartController.text.length > 5) {
|
||||
controller.getPlacesStart();
|
||||
controller.changeHeightStartPlaces();
|
||||
}
|
||||
},
|
||||
// onEditingComplete: () => controller.changeHeight(),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.placesDestination.isEmpty
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
controller.startLocationFromMap = true;
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.changePickerShown();
|
||||
},
|
||||
child: Text(
|
||||
'Choose from Map'.tr,
|
||||
style:
|
||||
AppStyle.title.copyWith(color: AppColor.blueColor),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
Container(
|
||||
height:
|
||||
controller.placesStart.isNotEmpty ? controller.height : 0,
|
||||
color: AppColor.secondaryColor,
|
||||
child: ListView.builder(
|
||||
itemCount: controller.placesStart.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var res = controller.placesStart[index];
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
controller.changeHeightPlaces();
|
||||
// if (controller.currentLocationToFormPlaces == true) {
|
||||
// controller.newStartPointLocation =
|
||||
// controller.myLocation;
|
||||
// } else {
|
||||
// controller.myLocation =
|
||||
// controller.newStartPointLocation;
|
||||
// }
|
||||
|
||||
controller.convertHintTextStartNewPlaces(index);
|
||||
controller.currentLocationString = res['name'];
|
||||
controller.placesStart = [];
|
||||
controller.placeStartController.clear();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Image.network(
|
||||
res['icon'],
|
||||
width: 20,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await sql.insertData({
|
||||
'latitude': res['geometry']
|
||||
['location']['lat'],
|
||||
'longitude': res['geometry']
|
||||
['location']['lng'],
|
||||
'name': res['name'].toString(),
|
||||
'rate': res['rating'].toString(),
|
||||
}, TableName.placesFavorite);
|
||||
Toast.show(
|
||||
context,
|
||||
'${res['name']} ${'Saved Sucssefully'.tr}',
|
||||
AppColor.primaryColor);
|
||||
},
|
||||
icon: const Icon(Icons.favorite_border),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
res['name'].toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
res['vicinity'].toString(),
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'rate',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
res['rating'].toString(),
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
thickness: 1,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
@@ -149,9 +149,24 @@ class GoogleMapPassengerWidget extends StatelessWidget {
|
||||
markerId: MarkerId(carLocation.toString())),
|
||||
Marker(
|
||||
markerId: MarkerId('MyLocation'.tr),
|
||||
position: controller.myLocation,
|
||||
position: controller.newStartPointLocation,
|
||||
draggable: true,
|
||||
icon: controller.markerIcon,
|
||||
icon: controller.tripIcon,
|
||||
infoWindow: const InfoWindow(
|
||||
title: 'Time',
|
||||
// snippet: controller.durationFromDriverToPassenger
|
||||
// .toString(),
|
||||
),
|
||||
onDragEnd: (value) {
|
||||
print(value);
|
||||
},
|
||||
// infoWindow: InfoWindow(title: 'my location'.tr),
|
||||
),
|
||||
Marker(
|
||||
markerId: MarkerId('Destination'.tr),
|
||||
position: controller.newMyLocation,
|
||||
draggable: true,
|
||||
icon: controller.tripIcon,
|
||||
infoWindow: const InfoWindow(
|
||||
title: 'Time',
|
||||
// snippet: controller.durationFromDriverToPassenger
|
||||
@@ -230,7 +245,11 @@ class GoogleMapPassengerWidget extends StatelessWidget {
|
||||
buildingsEnabled: true,
|
||||
mapToolbarEnabled: true,
|
||||
onCameraMove: (position) {
|
||||
if (controller.startLocationFromMap == true) {
|
||||
controller.newStartPointLocation = position.target;
|
||||
}
|
||||
controller.newMyLocation = position.target;
|
||||
|
||||
// print('my' + controller.mylocation.toString());
|
||||
// print('new' + controller.newMylocation.toString());
|
||||
},
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/table_names.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import 'form_search_start.dart';
|
||||
|
||||
class MainBottomMenuMap extends StatelessWidget {
|
||||
const MainBottomMenuMap({super.key});
|
||||
@@ -37,185 +38,245 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
topLeft: Radius.circular(15),
|
||||
topRight: Radius.circular(15),
|
||||
)),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: InkWell(
|
||||
onTap: () => controller.changeMainBottomMenuMap(),
|
||||
child: Container(
|
||||
width: Get.width * .8,
|
||||
height: Get.height * .1,
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 5,
|
||||
offset: Offset(2, 4)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 5,
|
||||
offset: Offset(-2, -2))
|
||||
],
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.elliptical(15, 30),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: InkWell(
|
||||
onTap: () => controller.changeMainBottomMenuMap(),
|
||||
child: Container(
|
||||
width: Get.width * .8,
|
||||
height: Get.height * .1,
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 5,
|
||||
offset: Offset(2, 4)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 5,
|
||||
offset: Offset(-2, -2))
|
||||
],
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.elliptical(15, 30),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: DefaultTextStyle(
|
||||
style: AppStyle.title,
|
||||
child: Center(
|
||||
child: controller.isPickerShown
|
||||
? TextButton(
|
||||
onPressed: () async {
|
||||
controller.clearPolyline();
|
||||
controller.data = [];
|
||||
await controller.getMap(
|
||||
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
|
||||
'${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
||||
);
|
||||
controller.places = [];
|
||||
controller.placeController.clear();
|
||||
child: DefaultTextStyle(
|
||||
style: AppStyle.title,
|
||||
child: Center(
|
||||
child: controller.isPickerShown
|
||||
? TextButton(
|
||||
onPressed: () async {
|
||||
controller.clearPolyline();
|
||||
controller.data = [];
|
||||
if (controller
|
||||
.startLocationFromMap ==
|
||||
true) {
|
||||
controller.newMyLocation =
|
||||
controller
|
||||
.newStartPointLocation;
|
||||
controller.startLocationFromMap =
|
||||
false;
|
||||
controller.isPickerShown = false;
|
||||
print(controller.myLocation);
|
||||
print(controller
|
||||
.newStartPointLocation);
|
||||
} else {
|
||||
controller.newMyLocation =
|
||||
controller.newMyLocation;
|
||||
controller.isPickerShown = false;
|
||||
print(controller.myLocation);
|
||||
print(controller.newMyLocation);
|
||||
}
|
||||
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
controller.showBottomSheet1();
|
||||
// controller.changeMainBottomMenuMap();
|
||||
},
|
||||
child: Row(
|
||||
// await controller.getMap(
|
||||
// '${controller.myLocation.latitude},${controller.myLocation.longitude}',
|
||||
// '${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
||||
// );
|
||||
controller.placesDestination = [];
|
||||
controller
|
||||
.placeDestinationController
|
||||
.clear();
|
||||
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
controller.showBottomSheet1();
|
||||
controller
|
||||
.changeMainBottomMenuMap();
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeMainBottomMenuMap();
|
||||
},
|
||||
icon: controller
|
||||
.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons
|
||||
.arrow_circle_up_rounded,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
Icons
|
||||
.arrow_circle_down_rounded,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Click here point".tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeMainBottomMenuMap();
|
||||
},
|
||||
icon:
|
||||
controller.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons
|
||||
.arrow_circle_up_rounded,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
Icons
|
||||
.arrow_circle_down_rounded,
|
||||
size: 35,
|
||||
SizedBox(
|
||||
height: 30,
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeMainBottomMenuMap();
|
||||
},
|
||||
icon: controller
|
||||
.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons
|
||||
.arrow_circle_up_rounded,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
Icons
|
||||
.arrow_circle_down_rounded,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
],
|
||||
)),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
controller.noCarString == false
|
||||
? Text(
|
||||
'Nearest Car for you about '
|
||||
.tr)
|
||||
: Container(
|
||||
decoration:
|
||||
BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(12),
|
||||
color:
|
||||
AppColor.redColor,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Click here to go to this location"
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(6),
|
||||
child: Text(
|
||||
'No Car in your site. Sorry!'
|
||||
.tr,
|
||||
style: AppStyle
|
||||
.title
|
||||
.copyWith(
|
||||
color: AppColor
|
||||
.secondaryColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.noCarString == false
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor
|
||||
.redColor,
|
||||
width: 3)),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(4),
|
||||
child: Text((controller
|
||||
.nearestCar !=
|
||||
null
|
||||
? controller
|
||||
.durationByPassenger
|
||||
.toString()
|
||||
: 'N/A')),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30,
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeMainBottomMenuMap();
|
||||
},
|
||||
icon: controller
|
||||
.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons
|
||||
.arrow_circle_up_rounded,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
Icons
|
||||
.arrow_circle_down_rounded,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
],
|
||||
)),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
controller.noCarString == false
|
||||
? Text(
|
||||
'Nearest Car for you about '
|
||||
.tr)
|
||||
: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(12),
|
||||
color:
|
||||
AppColor.redColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(6),
|
||||
child: Text(
|
||||
'No Car in your site. Sorry!'
|
||||
.tr,
|
||||
style: AppStyle.title
|
||||
.copyWith(
|
||||
color: AppColor
|
||||
.secondaryColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.noCarString == false
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor
|
||||
.redColor,
|
||||
width: 3)),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(4),
|
||||
child: Text((controller
|
||||
.nearestCar !=
|
||||
null
|
||||
? controller
|
||||
.durationByPassenger
|
||||
.toString()
|
||||
: 'N/A')),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.isMainBottomMenuMap
|
||||
? const FavioratePlacesDialogu()
|
||||
: const SizedBox(),
|
||||
controller.isMainBottomMenuMap
|
||||
? const SizedBox()
|
||||
: Text(
|
||||
'From : Current Location'.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
controller.isMainBottomMenuMap
|
||||
? const SizedBox()
|
||||
: formSearchPlaces()
|
||||
],
|
||||
controller.isMainBottomMenuMap
|
||||
? const FavioratePlacesDialogu()
|
||||
: const SizedBox(),
|
||||
controller.isMainBottomMenuMap
|
||||
? const SizedBox()
|
||||
: InkWell(
|
||||
onTap: () async {
|
||||
controller.getCurrentLocationFormString();
|
||||
},
|
||||
child: Text(
|
||||
'From : ${controller.currentLocationString}'.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
controller.isMainBottomMenuMap
|
||||
? const SizedBox()
|
||||
: Column(
|
||||
children: [
|
||||
controller.currentLocationToFormPlaces
|
||||
? const SizedBox()
|
||||
: formSearchPlacesStart(),
|
||||
formSearchPlaces(),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Go to Ride',
|
||||
onPressed: () async {
|
||||
controller.changeMainBottomMenuMap();
|
||||
|
||||
await controller.getMap(
|
||||
'${controller.newStartPointLocation.latitude},${controller.newStartPointLocation.longitude}',
|
||||
'${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
||||
);
|
||||
controller.currentLocationToFormPlaces =
|
||||
false;
|
||||
controller.placesDestination = [];
|
||||
controller.clearPlacesStart();
|
||||
controller.clearPlacesDestination();
|
||||
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
controller.showBottomSheet1();
|
||||
})
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
@@ -270,13 +331,15 @@ class FavioratePlacesDialogu extends StatelessWidget {
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
await controller.getLocation();
|
||||
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(
|
||||
|
||||
@@ -56,7 +56,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
||||
? InkWell(
|
||||
onTapDown: (details) {
|
||||
controller.changePickerShown();
|
||||
controller.changeHeight();
|
||||
controller.changeHeightPlaces();
|
||||
},
|
||||
child: Container(
|
||||
height: 7,
|
||||
@@ -188,7 +188,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
if (controller.isPickerShown &&
|
||||
controller.places.isEmpty)
|
||||
controller.placesDestination.isEmpty)
|
||||
MyElevatedButton(
|
||||
title: 'Go to this Target'.tr,
|
||||
onPressed: () async {
|
||||
@@ -205,7 +205,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
if (controller.isPickerShown &&
|
||||
controller.places.isEmpty)
|
||||
controller.placesDestination.isEmpty)
|
||||
const SizedBox(),
|
||||
],
|
||||
),
|
||||
|
||||
32
pubspec.lock
32
pubspec.lock
@@ -361,6 +361,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.2"
|
||||
equatable:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: equatable
|
||||
sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.5"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -473,6 +481,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
fl_chart:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: fl_chart
|
||||
sha256: fe6fec7d85975a99c73b9515a69a6e291364accfa0e4a5b3ce6de814d74b9a1c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.66.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -1565,22 +1581,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.5.0+1"
|
||||
syncfusion_flutter_charts:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: syncfusion_flutter_charts
|
||||
sha256: "12ed32b889bd4a28cf44b9fa246510e8f2fc798023018a6a915cbd0bffec1517"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "24.1.43"
|
||||
syncfusion_flutter_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: syncfusion_flutter_core
|
||||
sha256: "1b40729aa10a727150a6cc56e532c770f4baded83846fca8700efd908d0f4d0a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "24.1.43"
|
||||
synchronized:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -49,7 +49,7 @@ dependencies:
|
||||
envied: ^0.5.2
|
||||
cached_network_image: ^3.3.0
|
||||
calendar_builder: ^0.0.6
|
||||
syncfusion_flutter_charts: ^24.1.43
|
||||
fl_chart: ^0.66.0
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user