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>
|
<string>Explanation of why your app needs access to the photo library.</string>
|
||||||
|
|
||||||
<key>NSFaceIDUsageDescription</key>
|
<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>
|
<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>
|
<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>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>4</string>
|
<string>12</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.04</string>
|
<string>1.32</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:fl_chart/fl_chart.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';
|
||||||
@@ -8,37 +9,46 @@ import '../../models/model/admin/monthly_ride.dart';
|
|||||||
|
|
||||||
class RideAdminController extends GetxController {
|
class RideAdminController extends GetxController {
|
||||||
bool isLoading = false;
|
bool isLoading = false;
|
||||||
late List<RideData> rideData;
|
late List<MonthlyDataModel> rideData;
|
||||||
late Map<String, dynamic> jsonResponse;
|
late Map<String, dynamic> jsonResponse;
|
||||||
List<dynamic> ridesDetails = [];
|
List<dynamic> ridesDetails = [];
|
||||||
// var chartData;
|
var chartData;
|
||||||
late List<ChartDataS> chartDatasync;
|
// late List<ChartDataS> chartDatasync;
|
||||||
Future getRidesAdminDash() async {
|
Future getRidesAdminDash() async {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
update();
|
update();
|
||||||
var res = await CRUD().get(link: AppLink.getRidesPerMonth, payload: {});
|
var res = await CRUD().get(link: AppLink.getRidesPerMonth, payload: {});
|
||||||
jsonResponse = jsonDecode(res);
|
jsonResponse = jsonDecode(res);
|
||||||
|
rideData = (jsonResponse['message'] as List)
|
||||||
chartDatasync = (jsonResponse['message'] as List)
|
.map((item) => MonthlyDataModel.fromJson(item))
|
||||||
.map((item) => ChartDataS(
|
|
||||||
item['year'],
|
|
||||||
item['month'],
|
|
||||||
item['day'],
|
|
||||||
item['rides_count'],
|
|
||||||
))
|
|
||||||
.toList();
|
.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;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future getRidesDetails() async {
|
Future getRidesDetails() async {
|
||||||
|
// isLoading = true;
|
||||||
|
// update();
|
||||||
var res = await CRUD().get(link: AppLink.getRidesDetails, payload: {});
|
var res = await CRUD().get(link: AppLink.getRidesDetails, payload: {});
|
||||||
|
|
||||||
var d = jsonDecode(res);
|
var d = jsonDecode(res);
|
||||||
ridesDetails = d['message'];
|
ridesDetails = d['message'];
|
||||||
|
|
||||||
isLoading = false;
|
// isLoading = false;
|
||||||
update();
|
// update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -53,11 +63,11 @@ class RideAdminController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChartDataS {
|
// class ChartDataS {
|
||||||
ChartDataS(this.year, this.month, this.day, this.ridesCount);
|
// ChartDataS(this.year, this.month, this.day, this.ridesCount);
|
||||||
|
|
||||||
final int year;
|
// final int year;
|
||||||
final int month;
|
// final int month;
|
||||||
final int day;
|
// final int day;
|
||||||
final int ridesCount;
|
// 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:convert';
|
||||||
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -41,17 +42,32 @@ class LoginController extends GetxController {
|
|||||||
void adminDashboardOpen() async {
|
void adminDashboardOpen() async {
|
||||||
if (formKeyAdmin.currentState!.validate()) {
|
if (formKeyAdmin.currentState!.validate()) {
|
||||||
await DeviceInfoPlus.getDeviceInfo();
|
await DeviceInfoPlus.getDeviceInfo();
|
||||||
print(DeviceInfoPlus.deviceData['serialNumber']);
|
if (Platform.isAndroid) {
|
||||||
var res = await CRUD().get(link: AppLink.getAdminUser, payload: {
|
print(DeviceInfoPlus.deviceData['serialNumber']);
|
||||||
'device_number': DeviceInfoPlus.deviceData['serialNumber'].toString(),
|
var res = await CRUD().get(link: AppLink.getAdminUser, payload: {
|
||||||
});
|
'device_number': DeviceInfoPlus.deviceData['serialNumber'].toString(),
|
||||||
var d = jsonDecode(res);
|
});
|
||||||
// print(d);
|
var d = jsonDecode(res);
|
||||||
// if (DeviceInfoPlus.deviceData['serialNumber'] ==
|
// print(d);
|
||||||
// d['message']['device_number']) {
|
// if (DeviceInfoPlus.deviceData['serialNumber'] ==
|
||||||
Get.back();
|
// d['message']['device_number']) {
|
||||||
Get.to(() => AdminHomePage());
|
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
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
addToken();
|
await addToken();
|
||||||
onButtonSelected();
|
onButtonSelected();
|
||||||
getPaymentToday();
|
getPaymentToday();
|
||||||
getAllPayment();
|
getAllPayment();
|
||||||
@@ -191,11 +191,11 @@ class HomeCaptainController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addToken() async {
|
addToken() async {
|
||||||
|
box.write(BoxName.statusDriverLocation, 'off');
|
||||||
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
||||||
'token': box.read(BoxName.tokenDriver),
|
'token': box.read(BoxName.tokenDriver),
|
||||||
'captain_id': box.read(BoxName.driverID).toString()
|
'captain_id': box.read(BoxName.driverID).toString()
|
||||||
}).then((value) => print('Token Added'));
|
}).then((value) => print('Token Added'));
|
||||||
box.write(BoxName.statusDriverLocation, 'off');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getPaymentToday() async {
|
getPaymentToday() async {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:ride/controller/home/captin/home_captain_controller.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 'package:ride/controller/home/captin/widget/zones_controller.dart';
|
||||||
|
|
||||||
import '../../../../constant/colors.dart';
|
import '../../../../constant/colors.dart';
|
||||||
|
|||||||
@@ -25,22 +25,26 @@ import '../payment/payment_controller.dart';
|
|||||||
|
|
||||||
class MapPassengerController extends GetxController {
|
class MapPassengerController extends GetxController {
|
||||||
bool isLoading = true;
|
bool isLoading = true;
|
||||||
TextEditingController placeController = TextEditingController();
|
TextEditingController placeDestinationController = TextEditingController();
|
||||||
|
TextEditingController placeStartController = TextEditingController();
|
||||||
TextEditingController sosPhonePassengerProfile = TextEditingController();
|
TextEditingController sosPhonePassengerProfile = TextEditingController();
|
||||||
final sosFormKey = GlobalKey<FormState>();
|
final sosFormKey = GlobalKey<FormState>();
|
||||||
List data = [];
|
List data = [];
|
||||||
List<LatLng> bounds = [];
|
List<LatLng> bounds = [];
|
||||||
List places = [];
|
List placesStart = [];
|
||||||
|
List placesDestination = [];
|
||||||
LatLngBounds? boundsdata;
|
LatLngBounds? boundsdata;
|
||||||
List<Marker> markers = [];
|
List<Marker> markers = [];
|
||||||
List<Polyline> polyLines = [];
|
List<Polyline> polyLines = [];
|
||||||
late LatLng myLocation;
|
late LatLng myLocation;
|
||||||
late LatLng newMyLocation = const LatLng(32.115295, 36.064773);
|
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);
|
LatLng myDestination = const LatLng(32.115295, 36.064773);
|
||||||
final List<LatLng> polylineCoordinates = [];
|
final List<LatLng> polylineCoordinates = [];
|
||||||
List<LatLng> carsLocationByPassenger = [];
|
List<LatLng> carsLocationByPassenger = [];
|
||||||
List<LatLng> driverCarsLocationToPassengerAfterApplied = [];
|
List<LatLng> driverCarsLocationToPassengerAfterApplied = [];
|
||||||
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
||||||
|
BitmapDescriptor tripIcon = BitmapDescriptor.defaultMarker;
|
||||||
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
||||||
double height = 150;
|
double height = 150;
|
||||||
DateTime currentTime = DateTime.now();
|
DateTime currentTime = DateTime.now();
|
||||||
@@ -50,6 +54,7 @@ class MapPassengerController extends GetxController {
|
|||||||
double widthMenu = 0;
|
double widthMenu = 0;
|
||||||
double heightPickerContainer = 90;
|
double heightPickerContainer = 90;
|
||||||
double mainBottomMenuMap = Get.height * .2;
|
double mainBottomMenuMap = Get.height * .2;
|
||||||
|
bool startLocationFromMap = false;
|
||||||
bool heightMenuBool = false;
|
bool heightMenuBool = false;
|
||||||
bool isPickerShown = false;
|
bool isPickerShown = false;
|
||||||
bool isBottomSheetShown = false;
|
bool isBottomSheetShown = false;
|
||||||
@@ -87,10 +92,14 @@ class MapPassengerController extends GetxController {
|
|||||||
double progressTimerRideBegin = 0;
|
double progressTimerRideBegin = 0;
|
||||||
int remainingTimeTimerRideBegin = 60;
|
int remainingTimeTimerRideBegin = 60;
|
||||||
String stringRemainingTimeRideBegin = '';
|
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;
|
late String rideId;
|
||||||
bool noCarString = false;
|
bool noCarString = false;
|
||||||
bool isCashSelectedBeforeConfirmRide = false;
|
bool isCashSelectedBeforeConfirmRide = false;
|
||||||
bool isPassengerChosen = false;
|
bool isPassengerChosen = false;
|
||||||
|
bool currentLocationToFormPlaces = false;
|
||||||
late String driverToken;
|
late String driverToken;
|
||||||
int carsOrder = 0;
|
int carsOrder = 0;
|
||||||
String? mapAPIKEY;
|
String? mapAPIKEY;
|
||||||
@@ -105,6 +114,41 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
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>();
|
// final mainBottomMenuMap = GlobalKey<AnimatedContainer>();
|
||||||
void changeBottomSheetShown() {
|
void changeBottomSheetShown() {
|
||||||
isBottomSheetShown = !isBottomSheetShown;
|
isBottomSheetShown = !isBottomSheetShown;
|
||||||
@@ -261,8 +305,15 @@ class MapPassengerController extends GetxController {
|
|||||||
timerToPassengerFromDriverAfterApplied?.cancel();
|
timerToPassengerFromDriverAfterApplied?.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearPlaces() {
|
void clearPlacesDestination() {
|
||||||
places = [];
|
placesDestination = [];
|
||||||
|
hintTextDestinationPoint = 'Search for your destination'.tr;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void clearPlacesStart() {
|
||||||
|
placesStart = [];
|
||||||
|
hintTextStartPoint = 'Search for your Start point'.tr;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -558,7 +609,7 @@ class MapPassengerController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
restCounter() {
|
restCounter() {
|
||||||
clearPlaces();
|
clearPlacesDestination();
|
||||||
clearPolyline();
|
clearPolyline();
|
||||||
data = [];
|
data = [];
|
||||||
rideConfirm = false;
|
rideConfirm = false;
|
||||||
@@ -568,7 +619,7 @@ class MapPassengerController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> cancelRideAfterRejectFromAll() async {
|
Future<void> cancelRideAfterRejectFromAll() async {
|
||||||
clearPlaces();
|
clearPlacesDestination();
|
||||||
clearPolyline();
|
clearPolyline();
|
||||||
data = [];
|
data = [];
|
||||||
await CRUD().post(link: AppLink.updateDriverOrder, payload: {
|
await CRUD().post(link: AppLink.updateDriverOrder, payload: {
|
||||||
@@ -591,7 +642,7 @@ class MapPassengerController extends GetxController {
|
|||||||
print("rideConfirm=$rideConfirm");
|
print("rideConfirm=$rideConfirm");
|
||||||
|
|
||||||
if (rideConfirm == false) {
|
if (rideConfirm == false) {
|
||||||
clearPlaces();
|
clearPlacesDestination();
|
||||||
clearPolyline();
|
clearPolyline();
|
||||||
data = [];
|
data = [];
|
||||||
changeCancelRidePageShow();
|
changeCancelRidePageShow();
|
||||||
@@ -604,7 +655,7 @@ class MapPassengerController extends GetxController {
|
|||||||
timeToPassengerFromDriverAfterApplied = 0;
|
timeToPassengerFromDriverAfterApplied = 0;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
clearPlaces();
|
clearPlacesDestination();
|
||||||
clearPolyline();
|
clearPolyline();
|
||||||
data = [];
|
data = [];
|
||||||
await CRUD().post(link: AppLink.updateDriverOrder, payload: {
|
await CRUD().post(link: AppLink.updateDriverOrder, payload: {
|
||||||
@@ -634,15 +685,24 @@ class MapPassengerController extends GetxController {
|
|||||||
void changeMainBottomMenuMap() {
|
void changeMainBottomMenuMap() {
|
||||||
isMainBottomMenuMap = !isMainBottomMenuMap;
|
isMainBottomMenuMap = !isMainBottomMenuMap;
|
||||||
mainBottomMenuMap =
|
mainBottomMenuMap =
|
||||||
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .66;
|
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .7;
|
||||||
if (heightMenuBool == true) {
|
if (heightMenuBool == true) {
|
||||||
getDrawerMenu();
|
getDrawerMenu();
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
changeHeight() {
|
changeHeightPlaces() {
|
||||||
if (places.isEmpty) {
|
if (placesDestination.isEmpty) {
|
||||||
|
height = 0;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
height = 150;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
changeHeightStartPlaces() {
|
||||||
|
if (placesStart.isEmpty) {
|
||||||
height = 0;
|
height = 0;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -659,12 +719,24 @@ class MapPassengerController extends GetxController {
|
|||||||
Future getPlaces() async {
|
Future getPlaces() async {
|
||||||
var url =
|
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?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: {});
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
|
||||||
places = response['results'];
|
placesDestination = response['results'];
|
||||||
print(places);
|
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();
|
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() {
|
void addCustomCarIcon() {
|
||||||
ImageConfiguration config = ImageConfiguration(
|
ImageConfiguration config = ImageConfiguration(
|
||||||
size: Size(Get.width * .6, Get.height * .6),
|
size: Size(Get.width * .6, Get.height * .6),
|
||||||
|
// size: Size(20, 20),
|
||||||
// scale: 1.0,
|
// scale: 1.0,
|
||||||
);
|
);
|
||||||
BitmapDescriptor.fromAssetImage(config, 'assets/images/car.png')
|
BitmapDescriptor.fromAssetImage(config, 'assets/images/car.png')
|
||||||
@@ -742,10 +826,10 @@ class MapPassengerController extends GetxController {
|
|||||||
: null)!;
|
: null)!;
|
||||||
|
|
||||||
// Print location details
|
// Print location details
|
||||||
print('Accuracy: ${_locationData.accuracy}');
|
// print('Accuracy: ${_locationData.accuracy}');
|
||||||
print('Latitude: ${_locationData.latitude}');
|
// print('Latitude: ${_locationData.latitude}');
|
||||||
print('Longitude: ${_locationData.longitude}');
|
// print('Longitude: ${_locationData.longitude}');
|
||||||
print('Time: ${_locationData.time}');
|
// print('Time: ${_locationData.time}');
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -926,19 +1010,23 @@ class MapPassengerController extends GetxController {
|
|||||||
getMap(String origin, destination) async {
|
getMap(String origin, destination) async {
|
||||||
var origin1 = fromString(origin);
|
var origin1 = fromString(origin);
|
||||||
var destination1 = fromString(destination);
|
var destination1 = fromString(destination);
|
||||||
isLoading = false;
|
isLoading = true;
|
||||||
|
update();
|
||||||
myDestination = destination1;
|
myDestination = destination1;
|
||||||
myLocation = origin1;
|
myLocation = origin1;
|
||||||
update();
|
|
||||||
await getCarsLocationByPassenger();
|
await getCarsLocationByPassenger();
|
||||||
// print(carsLocationByPassenger);
|
// print(carsLocationByPassenger);
|
||||||
|
isLoading = false;
|
||||||
|
update();
|
||||||
var url =
|
var url =
|
||||||
('${AppLink.googleMapsLink}directions/json?&language=en&avoid=tolls|ferries&destination=$destination&origin=$origin&key=${AK.mapAPIKEY}');
|
('${AppLink.googleMapsLink}directions/json?&language=en&avoid=tolls|ferries&destination=$destination&origin=$origin&key=${AK.mapAPIKEY}');
|
||||||
|
|
||||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
data = response['routes'][0]['legs'];
|
data = response['routes'][0]['legs'];
|
||||||
print(data);
|
print(data);
|
||||||
|
isLoading = false;
|
||||||
|
update();
|
||||||
durationToRide = data[0]['duration']['value'];
|
durationToRide = data[0]['duration']['value'];
|
||||||
final points =
|
final points =
|
||||||
decodePolyline(response["routes"][0]["overview_polyline"]["points"]);
|
decodePolyline(response["routes"][0]["overview_polyline"]["points"]);
|
||||||
@@ -1137,83 +1225,6 @@ class MapPassengerController extends GetxController {
|
|||||||
// buttomSheetMapPage();
|
// buttomSheetMapPage();
|
||||||
changeBottomSheetShown();
|
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 {
|
addToken() async {
|
||||||
@@ -1234,6 +1245,7 @@ class MapPassengerController extends GetxController {
|
|||||||
getNearestDriverByPassengerLocation();
|
getNearestDriverByPassengerLocation();
|
||||||
addCustomPicker();
|
addCustomPicker();
|
||||||
addCustomCarIcon();
|
addCustomCarIcon();
|
||||||
|
addCustomTripIcon();
|
||||||
startMarkerReloading();
|
startMarkerReloading();
|
||||||
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
|
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|||||||
@@ -53,11 +53,11 @@ void main() async {
|
|||||||
];
|
];
|
||||||
// cameras = await availableCameras();
|
// cameras = await availableCameras();
|
||||||
await Future.wait(initializationTasks);
|
await Future.wait(initializationTasks);
|
||||||
|
SystemChrome.setPreferredOrientations([
|
||||||
|
DeviceOrientation.portraitUp,
|
||||||
|
DeviceOrientation.portraitDown,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
SystemChrome.setPreferredOrientations([
|
|
||||||
DeviceOrientation.portraitUp,
|
|
||||||
DeviceOrientation.portraitDown,
|
|
||||||
]);
|
|
||||||
|
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
class RideData {
|
class MonthlyDataModel {
|
||||||
final int year;
|
final int year;
|
||||||
final int month;
|
final int month;
|
||||||
final int day;
|
final int day;
|
||||||
final int ridesCount;
|
final int ridesCount;
|
||||||
|
|
||||||
RideData({
|
MonthlyDataModel({
|
||||||
required this.year,
|
required this.year,
|
||||||
required this.month,
|
required this.month,
|
||||||
required this.day,
|
required this.day,
|
||||||
required this.ridesCount,
|
required this.ridesCount,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory RideData.fromJson(Map<String, dynamic> json) => RideData(
|
factory MonthlyDataModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
MonthlyDataModel(
|
||||||
year: json['year'] as int,
|
year: json['year'] as int,
|
||||||
month: json['month'] as int,
|
month: json['month'] as int,
|
||||||
day: json['day'] 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/elevated_btn.dart';
|
||||||
import '../../widgets/my_textField.dart';
|
import '../../widgets/my_textField.dart';
|
||||||
import '../../widgets/mycircular.dart';
|
import '../../widgets/mycircular.dart';
|
||||||
import '../passenger/form_passenger.dart';
|
|
||||||
import 'form_captain.dart';
|
import 'form_captain.dart';
|
||||||
|
|
||||||
class Captain extends StatelessWidget {
|
class Captain extends StatelessWidget {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
import 'package:fl_chart/fl_chart.dart';
|
||||||
import 'package:flutter/material.dart';
|
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';
|
||||||
import 'package:ride/constant/style.dart';
|
import 'package:ride/constant/style.dart';
|
||||||
import 'package:ride/views/widgets/my_scafold.dart';
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
import 'package:ride/views/widgets/mycircular.dart';
|
import 'package:ride/views/widgets/mycircular.dart';
|
||||||
import 'package:syncfusion_flutter_charts/charts.dart';
|
|
||||||
|
|
||||||
import '../../../controller/admin/ride_admin_controller.dart';
|
import '../../../controller/admin/ride_admin_controller.dart';
|
||||||
|
|
||||||
@@ -19,136 +19,136 @@ class Rides extends StatelessWidget {
|
|||||||
? const Center(child: MyCircularProgressIndicator())
|
? const Center(child: MyCircularProgressIndicator())
|
||||||
: Column(
|
: Column(
|
||||||
children: [
|
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(
|
// SizedBox(
|
||||||
// height: Get.height * .4,
|
// height: Get.height * .4,
|
||||||
// child: LineChart(
|
// child: PieChart(
|
||||||
// duration: const Duration(milliseconds: 150),
|
// PieChartData(
|
||||||
// curve: Curves.ease,
|
// sectionsSpace: 4, // Adjust spacing between sections
|
||||||
// LineChartData(
|
// centerSpaceRadius:
|
||||||
// lineBarsData: [
|
// 40, // Adjust radius of center space
|
||||||
// LineChartBarData(
|
// sections: [
|
||||||
// spots: rideAdminController.chartData,
|
// for (final rideData in rideAdminController.rideData)
|
||||||
// isCurved: true,
|
// PieChartSectionData(
|
||||||
// color: Colors.deepPurpleAccent, // Custom color
|
// value: rideData.ridesCount.toDouble(),
|
||||||
// barWidth: 3, // Thinner line
|
// title: '${rideData.day}', showTitle: true,
|
||||||
// dotData: const FlDotData(
|
// titleStyle:
|
||||||
// show: true), // Show dots on each point
|
// AppStyle.subtitle, // Display day as title
|
||||||
// belowBarData: BarAreaData(
|
// radius: 60, // Adjust radius of each section
|
||||||
// // Add gradient fill below the line
|
// color:
|
||||||
// show: true,
|
// AppColor.deepPurpleAccent, // Custom color
|
||||||
// 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: 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(
|
// SizedBox(
|
||||||
// height: 400,
|
// // height: 400,
|
||||||
child: SfCartesianChart(
|
// child: SfCartesianChart(
|
||||||
legend: const Legend(
|
// legend: const Legend(
|
||||||
isVisible: true,
|
// isVisible: true,
|
||||||
position: LegendPosition.bottom,
|
// position: LegendPosition.bottom,
|
||||||
overflowMode: LegendItemOverflowMode.wrap,
|
// overflowMode: LegendItemOverflowMode.wrap,
|
||||||
textStyle: TextStyle(
|
// textStyle: TextStyle(
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
fontSize: 12,
|
// fontSize: 12,
|
||||||
fontWeight: FontWeight.bold,
|
// fontWeight: FontWeight.bold,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
borderWidth: 2,
|
// borderWidth: 2,
|
||||||
borderColor: AppColor.blueColor,
|
// borderColor: AppColor.blueColor,
|
||||||
plotAreaBorderColor: AppColor.deepPurpleAccent,
|
// plotAreaBorderColor: AppColor.deepPurpleAccent,
|
||||||
enableAxisAnimation: true,
|
// enableAxisAnimation: true,
|
||||||
primaryXAxis: CategoryAxis(
|
// primaryXAxis: CategoryAxis(
|
||||||
borderColor: AppColor.accentColor, borderWidth: 2,
|
// borderColor: AppColor.accentColor, borderWidth: 2,
|
||||||
title: AxisTitle(
|
// title: AxisTitle(
|
||||||
text: 'Total Trips on month'.tr,
|
// text: 'Total Trips on month'.tr,
|
||||||
textStyle: AppStyle.title,
|
// textStyle: AppStyle.title,
|
||||||
),
|
// ),
|
||||||
// labelRotation: 45,
|
// // labelRotation: 45,
|
||||||
majorGridLines: const MajorGridLines(width: 0),
|
// majorGridLines: const MajorGridLines(width: 0),
|
||||||
),
|
// ),
|
||||||
primaryYAxis: const NumericAxis(isVisible: false),
|
// primaryYAxis: const NumericAxis(isVisible: false),
|
||||||
series: <LineSeries<ChartDataS, String>>[
|
// series: <LineSeries<ChartDataS, String>>[
|
||||||
LineSeries<ChartDataS, String>(
|
// LineSeries<ChartDataS, String>(
|
||||||
dataSource: rideAdminController.chartDatasync,
|
// dataSource: rideAdminController.chartDatasync,
|
||||||
xValueMapper: (ChartDataS data, _) => '${data.day}',
|
// xValueMapper: (ChartDataS data, _) => '${data.day}',
|
||||||
yValueMapper: (ChartDataS data, _) =>
|
// yValueMapper: (ChartDataS data, _) =>
|
||||||
data.ridesCount,
|
// data.ridesCount,
|
||||||
dataLabelSettings:
|
// dataLabelSettings:
|
||||||
const DataLabelSettings(isVisible: true),
|
// const DataLabelSettings(isVisible: true),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
|
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
|
|||||||
@@ -2,9 +2,12 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:ride/views/widgets/my_scafold.dart';
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
class Wallet extends StatelessWidget {
|
import '../../../controller/admin/wallet_admin_controller.dart';
|
||||||
const Wallet({super.key});
|
|
||||||
|
|
||||||
|
class Wallet extends StatelessWidget {
|
||||||
|
Wallet({super.key});
|
||||||
|
WalletAdminController walletAdminController =
|
||||||
|
Get.put(WalletAdminController());
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MyScafolld(title: 'Wallet'.tr, body: [], isleading: true);
|
return MyScafolld(title: 'Wallet'.tr, body: [], isleading: true);
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
|
|||||||
width: 2,
|
width: 2,
|
||||||
)),
|
)),
|
||||||
suffixIcon: const Icon(Icons.search),
|
suffixIcon: const Icon(Icons.search),
|
||||||
hintText: 'Search for your destination'.tr,
|
hintText: controller.hintTextDestinationPoint,
|
||||||
hintStyle: AppStyle.title,
|
hintStyle: AppStyle.title,
|
||||||
hintMaxLines: 1,
|
hintMaxLines: 1,
|
||||||
prefixIcon: IconButton(
|
prefixIcon: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
controller.placeController.clear();
|
controller.placeDestinationController.clear();
|
||||||
controller.clearPlaces();
|
controller.clearPlacesDestination();
|
||||||
},
|
},
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.clear,
|
Icons.clear,
|
||||||
@@ -43,18 +43,19 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
controller: controller.placeController,
|
controller: controller.placeDestinationController,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
if (controller.placeController.text.length > 5) {
|
if (controller.placeDestinationController.text.length >
|
||||||
|
5) {
|
||||||
controller.getPlaces();
|
controller.getPlaces();
|
||||||
controller.changeHeight();
|
controller.changeHeightPlaces();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// onEditingComplete: () => controller.changeHeight(),
|
// onEditingComplete: () => controller.changeHeight(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
controller.places.isEmpty
|
controller.placesDestination.isEmpty
|
||||||
? InkWell(
|
? InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
controller.changeMainBottomMenuMap();
|
controller.changeMainBottomMenuMap();
|
||||||
@@ -68,37 +69,25 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
|
|||||||
)
|
)
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
Container(
|
Container(
|
||||||
height: controller.places.isNotEmpty ? controller.height : 0,
|
height: controller.placesDestination.isNotEmpty
|
||||||
|
? controller.height
|
||||||
|
: 0,
|
||||||
color: AppColor.secondaryColor,
|
color: AppColor.secondaryColor,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: controller.places.length,
|
itemCount: controller.placesDestination.length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
var res = controller.places[index];
|
var res = controller.placesDestination[index];
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
controller.changeHeight();
|
controller.changeHeightPlaces();
|
||||||
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();
|
|
||||||
|
|
||||||
controller.showBottomSheet1();
|
controller.changeHeightPlaces();
|
||||||
Get.back();
|
|
||||||
controller.showBottomSheet1();
|
controller.myLocation = controller.newMyLocation;
|
||||||
controller.changeMainBottomMenuMap();
|
controller.convertHintTextDestinationNewPlaces(index);
|
||||||
}),
|
|
||||||
);
|
controller.placesDestination = [];
|
||||||
|
controller.placeDestinationController.clear();
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
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())),
|
markerId: MarkerId(carLocation.toString())),
|
||||||
Marker(
|
Marker(
|
||||||
markerId: MarkerId('MyLocation'.tr),
|
markerId: MarkerId('MyLocation'.tr),
|
||||||
position: controller.myLocation,
|
position: controller.newStartPointLocation,
|
||||||
draggable: true,
|
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(
|
infoWindow: const InfoWindow(
|
||||||
title: 'Time',
|
title: 'Time',
|
||||||
// snippet: controller.durationFromDriverToPassenger
|
// snippet: controller.durationFromDriverToPassenger
|
||||||
@@ -230,7 +245,11 @@ class GoogleMapPassengerWidget extends StatelessWidget {
|
|||||||
buildingsEnabled: true,
|
buildingsEnabled: true,
|
||||||
mapToolbarEnabled: true,
|
mapToolbarEnabled: true,
|
||||||
onCameraMove: (position) {
|
onCameraMove: (position) {
|
||||||
|
if (controller.startLocationFromMap == true) {
|
||||||
|
controller.newStartPointLocation = position.target;
|
||||||
|
}
|
||||||
controller.newMyLocation = position.target;
|
controller.newMyLocation = position.target;
|
||||||
|
|
||||||
// print('my' + controller.mylocation.toString());
|
// print('my' + controller.mylocation.toString());
|
||||||
// print('new' + controller.newMylocation.toString());
|
// print('new' + controller.newMylocation.toString());
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:ride/views/widgets/elevated_btn.dart';
|
|||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
import '../../../constant/table_names.dart';
|
import '../../../constant/table_names.dart';
|
||||||
import '../../../controller/functions/toast.dart';
|
import '../../../controller/functions/toast.dart';
|
||||||
|
import 'form_search_start.dart';
|
||||||
|
|
||||||
class MainBottomMenuMap extends StatelessWidget {
|
class MainBottomMenuMap extends StatelessWidget {
|
||||||
const MainBottomMenuMap({super.key});
|
const MainBottomMenuMap({super.key});
|
||||||
@@ -37,185 +38,245 @@ class MainBottomMenuMap extends StatelessWidget {
|
|||||||
topLeft: Radius.circular(15),
|
topLeft: Radius.circular(15),
|
||||||
topRight: Radius.circular(15),
|
topRight: Radius.circular(15),
|
||||||
)),
|
)),
|
||||||
child: Column(
|
child: SingleChildScrollView(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
child: Column(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
Padding(
|
children: [
|
||||||
padding: const EdgeInsets.all(15),
|
Padding(
|
||||||
child: InkWell(
|
padding: const EdgeInsets.all(15),
|
||||||
onTap: () => controller.changeMainBottomMenuMap(),
|
child: InkWell(
|
||||||
child: Container(
|
onTap: () => controller.changeMainBottomMenuMap(),
|
||||||
width: Get.width * .8,
|
child: Container(
|
||||||
height: Get.height * .1,
|
width: Get.width * .8,
|
||||||
decoration: const BoxDecoration(
|
height: Get.height * .1,
|
||||||
boxShadow: [
|
decoration: const BoxDecoration(
|
||||||
BoxShadow(
|
boxShadow: [
|
||||||
color: AppColor.accentColor,
|
BoxShadow(
|
||||||
blurRadius: 5,
|
color: AppColor.accentColor,
|
||||||
offset: Offset(2, 4)),
|
blurRadius: 5,
|
||||||
BoxShadow(
|
offset: Offset(2, 4)),
|
||||||
color: AppColor.accentColor,
|
BoxShadow(
|
||||||
blurRadius: 5,
|
color: AppColor.accentColor,
|
||||||
offset: Offset(-2, -2))
|
blurRadius: 5,
|
||||||
],
|
offset: Offset(-2, -2))
|
||||||
color: AppColor.secondaryColor,
|
],
|
||||||
borderRadius: BorderRadius.all(
|
color: AppColor.secondaryColor,
|
||||||
Radius.elliptical(15, 30),
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.elliptical(15, 30),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
child: DefaultTextStyle(
|
||||||
child: DefaultTextStyle(
|
style: AppStyle.title,
|
||||||
style: AppStyle.title,
|
child: Center(
|
||||||
child: Center(
|
child: controller.isPickerShown
|
||||||
child: controller.isPickerShown
|
? TextButton(
|
||||||
? TextButton(
|
onPressed: () async {
|
||||||
onPressed: () async {
|
controller.clearPolyline();
|
||||||
controller.clearPolyline();
|
controller.data = [];
|
||||||
controller.data = [];
|
if (controller
|
||||||
await controller.getMap(
|
.startLocationFromMap ==
|
||||||
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
|
true) {
|
||||||
'${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
controller.newMyLocation =
|
||||||
);
|
controller
|
||||||
controller.places = [];
|
.newStartPointLocation;
|
||||||
controller.placeController.clear();
|
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();
|
// await controller.getMap(
|
||||||
Get.back();
|
// '${controller.myLocation.latitude},${controller.myLocation.longitude}',
|
||||||
controller.showBottomSheet1();
|
// '${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
||||||
// controller.changeMainBottomMenuMap();
|
// );
|
||||||
},
|
controller.placesDestination = [];
|
||||||
child: Row(
|
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: [
|
children: [
|
||||||
IconButton(
|
SizedBox(
|
||||||
onPressed: () {
|
height: 30,
|
||||||
controller
|
child: Row(
|
||||||
.changeMainBottomMenuMap();
|
children: [
|
||||||
},
|
IconButton(
|
||||||
icon:
|
onPressed: () {
|
||||||
controller.isMainBottomMenuMap
|
controller
|
||||||
? const Icon(
|
.changeMainBottomMenuMap();
|
||||||
Icons
|
},
|
||||||
.arrow_circle_up_rounded,
|
icon: controller
|
||||||
size: 35,
|
.isMainBottomMenuMap
|
||||||
)
|
? const Icon(
|
||||||
: const Icon(
|
Icons
|
||||||
Icons
|
.arrow_circle_up_rounded,
|
||||||
.arrow_circle_down_rounded,
|
size: 35,
|
||||||
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(
|
||||||
Text(
|
padding:
|
||||||
"Click here to go to this location"
|
const EdgeInsets
|
||||||
.tr,
|
.all(6),
|
||||||
style: AppStyle.title,
|
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
|
||||||
controller.isMainBottomMenuMap
|
? const FavioratePlacesDialogu()
|
||||||
? const FavioratePlacesDialogu()
|
: const SizedBox(),
|
||||||
: const SizedBox(),
|
controller.isMainBottomMenuMap
|
||||||
controller.isMainBottomMenuMap
|
? const SizedBox()
|
||||||
? const SizedBox()
|
: InkWell(
|
||||||
: Text(
|
onTap: () async {
|
||||||
'From : Current Location'.tr,
|
controller.getCurrentLocationFormString();
|
||||||
style: AppStyle.subtitle,
|
},
|
||||||
),
|
child: Text(
|
||||||
controller.isMainBottomMenuMap
|
'From : ${controller.currentLocationString}'.tr,
|
||||||
? const SizedBox()
|
style: AppStyle.subtitle,
|
||||||
: formSearchPlaces()
|
),
|
||||||
],
|
),
|
||||||
|
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: [
|
children: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
Get.back();
|
||||||
|
await controller.getLocation();
|
||||||
await controller.getMap(
|
await controller.getMap(
|
||||||
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
|
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
|
||||||
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
|
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
|
||||||
);
|
);
|
||||||
// controller.changePickerShown();
|
// controller.changePickerShown();
|
||||||
controller.showBottomSheet1();
|
controller.showBottomSheet1();
|
||||||
Get.back();
|
|
||||||
controller.showBottomSheet1();
|
controller.showBottomSheet1();
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
|||||||
? InkWell(
|
? InkWell(
|
||||||
onTapDown: (details) {
|
onTapDown: (details) {
|
||||||
controller.changePickerShown();
|
controller.changePickerShown();
|
||||||
controller.changeHeight();
|
controller.changeHeightPlaces();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 7,
|
height: 7,
|
||||||
@@ -188,7 +188,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (controller.isPickerShown &&
|
if (controller.isPickerShown &&
|
||||||
controller.places.isEmpty)
|
controller.placesDestination.isEmpty)
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title: 'Go to this Target'.tr,
|
title: 'Go to this Target'.tr,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
@@ -205,7 +205,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (controller.isPickerShown &&
|
if (controller.isPickerShown &&
|
||||||
controller.places.isEmpty)
|
controller.placesDestination.isEmpty)
|
||||||
const SizedBox(),
|
const SizedBox(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
32
pubspec.lock
32
pubspec.lock
@@ -361,6 +361,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.2"
|
version: "0.5.2"
|
||||||
|
equatable:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: equatable
|
||||||
|
sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.5"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -473,6 +481,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
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:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -1565,22 +1581,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "9.5.0+1"
|
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:
|
synchronized:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ dependencies:
|
|||||||
envied: ^0.5.2
|
envied: ^0.5.2
|
||||||
cached_network_image: ^3.3.0
|
cached_network_image: ^3.3.0
|
||||||
calendar_builder: ^0.0.6
|
calendar_builder: ^0.0.6
|
||||||
syncfusion_flutter_charts: ^24.1.43
|
fl_chart: ^0.66.0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user