1/10/1
This commit is contained in:
@@ -36,10 +36,6 @@ class RegisterCaptainController extends GetxController {
|
|||||||
late String stateCode;
|
late String stateCode;
|
||||||
late String expireDate;
|
late String expireDate;
|
||||||
late String dob;
|
late String dob;
|
||||||
@override
|
|
||||||
void onInit() {
|
|
||||||
super.onInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
getBirthDate() {
|
getBirthDate() {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
|
|||||||
@@ -49,10 +49,10 @@ class MapPassengerController extends GetxController {
|
|||||||
List<List<dynamic>> placeListResponseAll = [];
|
List<List<dynamic>> placeListResponseAll = [];
|
||||||
|
|
||||||
List<Widget> placeListResponse = [
|
List<Widget> placeListResponse = [
|
||||||
formSearchPlaces1(),
|
formSearchPlaces(0),
|
||||||
formSearchPlaces2(),
|
formSearchPlaces(1),
|
||||||
formSearchPlaces3(),
|
formSearchPlaces(2),
|
||||||
formSearchPlaces4(),
|
formSearchPlaces(3),
|
||||||
];
|
];
|
||||||
LatLngBounds? boundsdata;
|
LatLngBounds? boundsdata;
|
||||||
List<Marker> markers = [];
|
List<Marker> markers = [];
|
||||||
@@ -67,6 +67,12 @@ class MapPassengerController extends GetxController {
|
|||||||
late LatLng newPointLocation4 = const LatLng(32.115295, 36.064773);
|
late LatLng newPointLocation4 = 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 = [];
|
||||||
|
final List<LatLng> polylineCoordinates0 = [];
|
||||||
|
final List<LatLng> polylineCoordinates1 = [];
|
||||||
|
final List<LatLng> polylineCoordinates2 = [];
|
||||||
|
final List<LatLng> polylineCoordinates3 = [];
|
||||||
|
final List<LatLng> polylineCoordinates4 = [];
|
||||||
|
List<List<LatLng>> polylineCoordinatesPointsAll = [];
|
||||||
List<LatLng> carsLocationByPassenger = [];
|
List<LatLng> carsLocationByPassenger = [];
|
||||||
List<LatLng> driverCarsLocationToPassengerAfterApplied = [];
|
List<LatLng> driverCarsLocationToPassengerAfterApplied = [];
|
||||||
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
||||||
@@ -88,6 +94,7 @@ class MapPassengerController extends GetxController {
|
|||||||
bool startLocationFromMap2 = false;
|
bool startLocationFromMap2 = false;
|
||||||
bool startLocationFromMap3 = false;
|
bool startLocationFromMap3 = false;
|
||||||
bool startLocationFromMap4 = false;
|
bool startLocationFromMap4 = false;
|
||||||
|
List startLocationFromMapAll = [];
|
||||||
bool heightMenuBool = false;
|
bool heightMenuBool = false;
|
||||||
bool isPickerShown = false;
|
bool isPickerShown = false;
|
||||||
bool isPointsPageForRider = false;
|
bool isPointsPageForRider = false;
|
||||||
@@ -135,11 +142,18 @@ class MapPassengerController extends GetxController {
|
|||||||
String hintTextwayPoint4 = 'Search for waypoint'.tr;
|
String hintTextwayPoint4 = 'Search for waypoint'.tr;
|
||||||
String currentLocationString = 'Current Location'.tr;
|
String currentLocationString = 'Current Location'.tr;
|
||||||
String currentLocationString0 = 'Current Location'.tr;
|
String currentLocationString0 = 'Current Location'.tr;
|
||||||
String currentLocationString1 = 'Current Location 1'.tr;
|
String currentLocationString1 = 'Add Location 1'.tr;
|
||||||
String currentLocationString2 = 'Current Location 2'.tr;
|
String currentLocationString2 = 'Add Location 2'.tr;
|
||||||
String currentLocationString3 = 'Current Location 3'.tr;
|
String currentLocationString3 = 'Add Location 3'.tr;
|
||||||
String currentLocationString4 = 'Current Location 4'.tr;
|
String currentLocationString4 = 'Add Location 4'.tr;
|
||||||
|
String placesCoordinate0 = ''.tr;
|
||||||
|
String placesCoordinate1 = ''.tr;
|
||||||
|
String placesCoordinate2 = ''.tr;
|
||||||
|
String placesCoordinate3 = ''.tr;
|
||||||
|
String placesCoordinate4 = ''.tr;
|
||||||
List<String> currentLocationStringAll = [];
|
List<String> currentLocationStringAll = [];
|
||||||
|
List<String> hintTextwayPointStringAll = [];
|
||||||
|
var placesCoordinate = <String>[];
|
||||||
String hintTextDestinationPoint = 'Search for your destination'.tr;
|
String hintTextDestinationPoint = 'Search for your destination'.tr;
|
||||||
late String rideId;
|
late String rideId;
|
||||||
bool noCarString = false;
|
bool noCarString = false;
|
||||||
@@ -151,6 +165,7 @@ class MapPassengerController extends GetxController {
|
|||||||
bool currentLocationToFormPlaces2 = false;
|
bool currentLocationToFormPlaces2 = false;
|
||||||
bool currentLocationToFormPlaces3 = false;
|
bool currentLocationToFormPlaces3 = false;
|
||||||
bool currentLocationToFormPlaces4 = false;
|
bool currentLocationToFormPlaces4 = false;
|
||||||
|
List currentLocationToFormPlacesAll = [];
|
||||||
late String driverToken;
|
late String driverToken;
|
||||||
int carsOrder = 0;
|
int carsOrder = 0;
|
||||||
String? mapAPIKEY;
|
String? mapAPIKEY;
|
||||||
@@ -199,17 +214,23 @@ class MapPassengerController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void convertHintTextPlaces0(int index) {
|
void convertHintTextPlaces(int index, var res) {
|
||||||
if (wayPoint0.isEmpty) {
|
if (placeListResponseAll[index].isEmpty) {
|
||||||
hintTextwayPoint0 = 'Search for your Start point'.tr;
|
placeListResponseAll[index] = res;
|
||||||
|
hintTextwayPointStringAll[index] = 'Search for your Start point'.tr;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
hintTextwayPoint0 = wayPoint0[index]['name'];
|
hintTextwayPointStringAll[index] = res['name'];
|
||||||
currentLocationString0 = wayPoint1[index]['name'];
|
currentLocationStringAll[index] = res['name'];
|
||||||
double lat = wayPoint0[index]['geometry']['location']['lat'];
|
placesCoordinate[index] =
|
||||||
double lng = wayPoint0[index]['geometry']['location']['lng'];
|
'${res['geometry']['location']['lat']},${res['geometry']['location']['lng']}';
|
||||||
newPointLocation0 = LatLng(lat, lng);
|
placeListResponseAll[index] = [];
|
||||||
|
allTextEditingPlaces[index].clear();
|
||||||
|
// double lat = wayPoint0[index]['geometry']['location']['lat'];
|
||||||
|
// double lng = wayPoint0[index]['geometry']['location']['lng'];
|
||||||
|
// newPointLocation0 = LatLng(lat, lng);
|
||||||
update();
|
update();
|
||||||
|
Get.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,9 +472,9 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearPlaces0() {
|
void clearPlaces(int index) {
|
||||||
wayPoint0 = [];
|
placeListResponseAll[index] = [];
|
||||||
hintTextwayPoint0 = 'Search for waypoint'.tr;
|
hintTextwayPointStringAll[index] = 'Search for waypoint'.tr;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -853,7 +874,7 @@ class MapPassengerController extends GetxController {
|
|||||||
|
|
||||||
void changeWayPointSheet() {
|
void changeWayPointSheet() {
|
||||||
isWayPointSheet = !isWayPointSheet;
|
isWayPointSheet = !isWayPointSheet;
|
||||||
wayPointSheetHeight = isWayPointSheet == false ? 0 : Get.height * .7;
|
wayPointSheetHeight = isWayPointSheet == false ? 0 : Get.height * .4;
|
||||||
// if (heightMenuBool == true) {
|
// if (heightMenuBool == true) {
|
||||||
// getDrawerMenu();
|
// getDrawerMenu();
|
||||||
// }
|
// }
|
||||||
@@ -878,8 +899,8 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
changeHeightPlaces0() {
|
changeHeightPlacesAll(int index) {
|
||||||
if (wayPoint0.isEmpty) {
|
if (placeListResponseAll[index].isEmpty) {
|
||||||
height = 0;
|
height = 0;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -953,13 +974,14 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future getPlacesListsWayPoint0() async {
|
Future getPlacesListsWayPoint(int index) async {
|
||||||
var url =
|
var url =
|
||||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint0Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint0Controller.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: {});
|
||||||
|
|
||||||
wayPoint0 = response['results'];
|
wayPoint0 = response['results'];
|
||||||
|
placeListResponseAll[index] = response['results'];
|
||||||
print(wayPoint0);
|
print(wayPoint0);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -1279,13 +1301,6 @@ class MapPassengerController extends GetxController {
|
|||||||
|
|
||||||
late LatLngBounds boundsData;
|
late LatLngBounds boundsData;
|
||||||
getMap(String origin, destination) async {
|
getMap(String origin, destination) async {
|
||||||
var origin1 = fromString(origin);
|
|
||||||
var destination1 = fromString(destination);
|
|
||||||
isLoading = true;
|
|
||||||
update();
|
|
||||||
myDestination = destination1;
|
|
||||||
myLocation = origin1;
|
|
||||||
|
|
||||||
await getCarsLocationByPassenger();
|
await getCarsLocationByPassenger();
|
||||||
// print(carsLocationByPassenger);
|
// print(carsLocationByPassenger);
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
@@ -1295,7 +1310,7 @@ class MapPassengerController extends GetxController {
|
|||||||
|
|
||||||
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;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
durationToRide = data[0]['duration']['value'];
|
durationToRide = data[0]['duration']['value'];
|
||||||
@@ -1352,6 +1367,72 @@ class MapPassengerController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getMapPoints(String origin, destination, int index) async {
|
||||||
|
await getCarsLocationByPassenger();
|
||||||
|
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"]);
|
||||||
|
for (int i = 0; i < points.length; i++) {
|
||||||
|
double lat = points[i][0].toDouble();
|
||||||
|
double lng = points[i][1].toDouble();
|
||||||
|
polylineCoordinatesPointsAll[index].add(LatLng(lat, lng));
|
||||||
|
}
|
||||||
|
// Define the northeast and southwest coordinates
|
||||||
|
final bounds = response["routes"][0]["bounds"];
|
||||||
|
|
||||||
|
LatLng northeast =
|
||||||
|
LatLng(bounds['northeast']['lat'], bounds['northeast']['lng']);
|
||||||
|
LatLng southwest =
|
||||||
|
LatLng(bounds['southwest']['lat'], bounds['southwest']['lng']);
|
||||||
|
|
||||||
|
// Create the LatLngBounds object
|
||||||
|
boundsData = LatLngBounds(northeast: northeast, southwest: southwest);
|
||||||
|
|
||||||
|
// Calculate the zoom level based on the distance and screen size
|
||||||
|
|
||||||
|
double distanceOfDestnation =
|
||||||
|
getDistanceFromText(data[0]['distance']['text']);
|
||||||
|
|
||||||
|
// Animate the camera to the adjusted bounds
|
||||||
|
if (distanceOfDestnation <= 5) {
|
||||||
|
mapController!.animateCamera(CameraUpdate.newLatLngZoom(myLocation, 14));
|
||||||
|
} else if (distanceOfDestnation > 5 && distanceOfDestnation <= 8) {
|
||||||
|
mapController!.animateCamera(CameraUpdate.newLatLngZoom(myLocation, 13));
|
||||||
|
} else if (distanceOfDestnation > 8 && distanceOfDestnation < 16) {
|
||||||
|
mapController!.animateCamera(CameraUpdate.newLatLngZoom(myLocation, 12));
|
||||||
|
} else if (distanceOfDestnation >= 16 && distanceOfDestnation < 30) {
|
||||||
|
mapController!.animateCamera(CameraUpdate.newLatLngZoom(myLocation, 11));
|
||||||
|
} else if (distanceOfDestnation >= 30 && distanceOfDestnation < 100) {
|
||||||
|
mapController!.animateCamera(CameraUpdate.newLatLngZoom(myLocation, 10));
|
||||||
|
} else if (distanceOfDestnation >= 100) {
|
||||||
|
mapController!.animateCamera(CameraUpdate.newLatLngZoom(myLocation, 7));
|
||||||
|
}
|
||||||
|
if (polyLines.isNotEmpty) {
|
||||||
|
clearPolyline();
|
||||||
|
} else {
|
||||||
|
var polyline = Polyline(
|
||||||
|
polylineId: PolylineId(response["routes"][0]["summary"]),
|
||||||
|
points: polylineCoordinatesPointsAll[index],
|
||||||
|
width: 10,
|
||||||
|
color: Colors.blue,
|
||||||
|
);
|
||||||
|
|
||||||
|
polyLines.add(polyline);
|
||||||
|
rideConfirm = false;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
showBottomSheet1() async {
|
showBottomSheet1() async {
|
||||||
bottomSheet();
|
bottomSheet();
|
||||||
isBottomSheetShown = true;
|
isBottomSheetShown = true;
|
||||||
@@ -1490,12 +1571,26 @@ class MapPassengerController extends GetxController {
|
|||||||
await CRUD().post(link: AppLink.addTokens, payload: {
|
await CRUD().post(link: AppLink.addTokens, payload: {
|
||||||
'token': box.read(BoxName.tokenFCM),
|
'token': box.read(BoxName.tokenFCM),
|
||||||
'passengerID': box.read(BoxName.passengerID).toString()
|
'passengerID': box.read(BoxName.passengerID).toString()
|
||||||
}).then((value) => print('cccc'));
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
List<LatLng> polylineCoordinate = [];
|
List<LatLng> polylineCoordinate = [];
|
||||||
String? cardNumber;
|
String? cardNumber;
|
||||||
void readyWayPoints() {
|
void readyWayPoints() {
|
||||||
|
hintTextwayPointStringAll = [
|
||||||
|
hintTextwayPoint0,
|
||||||
|
hintTextwayPoint1,
|
||||||
|
hintTextwayPoint2,
|
||||||
|
hintTextwayPoint3,
|
||||||
|
hintTextwayPoint4,
|
||||||
|
];
|
||||||
|
polylineCoordinatesPointsAll = [
|
||||||
|
polylineCoordinates0,
|
||||||
|
polylineCoordinates1,
|
||||||
|
polylineCoordinates2,
|
||||||
|
polylineCoordinates3,
|
||||||
|
polylineCoordinates4,
|
||||||
|
];
|
||||||
allTextEditingPlaces = [
|
allTextEditingPlaces = [
|
||||||
wayPoint0Controller,
|
wayPoint0Controller,
|
||||||
wayPoint1Controller,
|
wayPoint1Controller,
|
||||||
@@ -1503,6 +1598,13 @@ class MapPassengerController extends GetxController {
|
|||||||
wayPoint3Controller,
|
wayPoint3Controller,
|
||||||
wayPoint4Controller,
|
wayPoint4Controller,
|
||||||
];
|
];
|
||||||
|
currentLocationToFormPlacesAll = [
|
||||||
|
currentLocationToFormPlaces0,
|
||||||
|
currentLocationToFormPlaces1,
|
||||||
|
currentLocationToFormPlaces2,
|
||||||
|
currentLocationToFormPlaces3,
|
||||||
|
currentLocationToFormPlaces4,
|
||||||
|
];
|
||||||
placeListResponseAll = [
|
placeListResponseAll = [
|
||||||
wayPoint0,
|
wayPoint0,
|
||||||
wayPoint1,
|
wayPoint1,
|
||||||
@@ -1510,22 +1612,34 @@ class MapPassengerController extends GetxController {
|
|||||||
wayPoint3,
|
wayPoint3,
|
||||||
wayPoint4
|
wayPoint4
|
||||||
];
|
];
|
||||||
|
startLocationFromMapAll = [
|
||||||
|
startLocationFromMap0,
|
||||||
|
startLocationFromMap1,
|
||||||
|
startLocationFromMap2,
|
||||||
|
startLocationFromMap3,
|
||||||
|
startLocationFromMap4,
|
||||||
|
];
|
||||||
currentLocationStringAll = [
|
currentLocationStringAll = [
|
||||||
currentLocationString0,
|
currentLocationString0,
|
||||||
currentLocationString1,
|
currentLocationString1,
|
||||||
currentLocationString2,
|
currentLocationString2,
|
||||||
currentLocationString3,
|
currentLocationString3,
|
||||||
currentLocationString4,
|
currentLocationString4,
|
||||||
]; // placeListResponse.add(wayPoint0);
|
];
|
||||||
// placeListResponse.add(wayPoint1);
|
placesCoordinate = [
|
||||||
// placeListResponse.add(wayPoint2);
|
placesCoordinate0,
|
||||||
// placeListResponse.add(wayPoint3);
|
placesCoordinate1,
|
||||||
// placeListResponse.add(wayPoint4);
|
placesCoordinate2,
|
||||||
|
placesCoordinate3,
|
||||||
|
placesCoordinate4,
|
||||||
|
];
|
||||||
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
||||||
|
readyWayPoints();
|
||||||
await getLocation();
|
await getLocation();
|
||||||
await addToken();
|
await addToken();
|
||||||
await getCarsLocationByPassenger();
|
await getCarsLocationByPassenger();
|
||||||
@@ -1535,7 +1649,6 @@ class MapPassengerController extends GetxController {
|
|||||||
addCustomTripIcon();
|
addCustomTripIcon();
|
||||||
startMarkerReloading();
|
startMarkerReloading();
|
||||||
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
|
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
|
||||||
readyWayPoints();
|
|
||||||
|
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ class WayPointController extends GetxController {
|
|||||||
TextEditingController textSearchCotroller = TextEditingController();
|
TextEditingController textSearchCotroller = TextEditingController();
|
||||||
// A list of places corresponding to each text field
|
// A list of places corresponding to each text field
|
||||||
final places = <String>[];
|
final places = <String>[];
|
||||||
|
|
||||||
final hintTextPointList = <String>[];
|
final hintTextPointList = <String>[];
|
||||||
late LatLng myLocation;
|
late LatLng myLocation;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class MapPagePassenger extends StatelessWidget {
|
|||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
const GoogleMapPassengerWidget(),
|
GoogleMapPassengerWidget(),
|
||||||
leftMainMenuIcons(),
|
leftMainMenuIcons(),
|
||||||
const PickerIconOnMap(),
|
const PickerIconOnMap(),
|
||||||
// PickerAnimtionContainerFormPlaces(),
|
// PickerAnimtionContainerFormPlaces(),
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import '../../../controller/functions/toast.dart';
|
|||||||
import '../../../controller/home/map_passenger_controller.dart';
|
import '../../../controller/home/map_passenger_controller.dart';
|
||||||
import '../../../main.dart';
|
import '../../../main.dart';
|
||||||
|
|
||||||
GetBuilder<MapPassengerController> formSearchPlaces0() {
|
GetBuilder<MapPassengerController> formSearchPlaces(int index) {
|
||||||
// DbSql sql = DbSql.instance;
|
// DbSql sql = DbSql.instance;
|
||||||
return GetBuilder<MapPassengerController>(
|
return GetBuilder<MapPassengerController>(
|
||||||
builder: (controller) => Column(
|
builder: (controller) => Column(
|
||||||
@@ -33,8 +33,8 @@ GetBuilder<MapPassengerController> formSearchPlaces0() {
|
|||||||
hintMaxLines: 1,
|
hintMaxLines: 1,
|
||||||
prefixIcon: IconButton(
|
prefixIcon: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
controller.wayPoint0Controller.clear();
|
controller.allTextEditingPlaces[index].clear();
|
||||||
controller.clearPlaces0();
|
controller.clearPlaces(index);
|
||||||
},
|
},
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.clear,
|
Icons.clear,
|
||||||
@@ -42,21 +42,22 @@ GetBuilder<MapPassengerController> formSearchPlaces0() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
controller: controller.wayPoint0Controller,
|
controller: controller.allTextEditingPlaces[index],
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
if (controller.wayPoint0Controller.text.length > 5) {
|
if (controller.allTextEditingPlaces[index].text.length >
|
||||||
controller.getPlacesListsWayPoint0();
|
5) {
|
||||||
controller.changeHeightPlaces0();
|
controller.getPlacesListsWayPoint(index);
|
||||||
|
controller.changeHeightPlacesAll(index);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// onEditingComplete: () => controller.changeHeight(),
|
// onEditingComplete: () => controller.changeHeight(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
controller.wayPoint0.isEmpty
|
controller.placeListResponseAll[index].isEmpty
|
||||||
? InkWell(
|
? InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
controller.startLocationFromMap0 = true;
|
controller.startLocationFromMapAll[index] = true;
|
||||||
controller.changeMainBottomMenuMap();
|
controller.changeMainBottomMenuMap();
|
||||||
controller.changePickerShown();
|
controller.changePickerShown();
|
||||||
},
|
},
|
||||||
@@ -68,16 +69,19 @@ GetBuilder<MapPassengerController> formSearchPlaces0() {
|
|||||||
)
|
)
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
Container(
|
Container(
|
||||||
height: controller.wayPoint0.isNotEmpty ? controller.height : 0,
|
height: controller.placeListResponseAll[index].isNotEmpty
|
||||||
|
? controller.height
|
||||||
|
: 0,
|
||||||
color: AppColor.secondaryColor,
|
color: AppColor.secondaryColor,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: controller.wayPoint0.length,
|
itemCount: controller.placeListResponseAll[index].length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int i) {
|
||||||
var res = controller.wayPoint0[index];
|
var res = controller.placeListResponseAll[index][i];
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
controller.changeHeightPlaces();
|
controller.changeHeightPlaces();
|
||||||
if (controller.currentLocationToFormPlaces0 == true) {
|
if (controller.currentLocationToFormPlacesAll[index] ==
|
||||||
|
true) {
|
||||||
controller.newStartPointLocation =
|
controller.newStartPointLocation =
|
||||||
controller.myLocation;
|
controller.myLocation;
|
||||||
} else {
|
} else {
|
||||||
@@ -85,631 +89,7 @@ GetBuilder<MapPassengerController> formSearchPlaces0() {
|
|||||||
controller.newStartPointLocation;
|
controller.newStartPointLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
controller.convertHintTextPlaces0(index);
|
controller.convertHintTextPlaces(index, res);
|
||||||
controller.currentLocationString0 = res['name'];
|
|
||||||
controller.wayPoint0 = [];
|
|
||||||
controller.wayPoint0Controller.clear();
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
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,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
GetBuilder<MapPassengerController> formSearchPlaces1() {
|
|
||||||
// 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.hintTextwayPoint1.tr,
|
|
||||||
hintStyle: AppStyle.title,
|
|
||||||
hintMaxLines: 1,
|
|
||||||
prefixIcon: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
controller.wayPoint1Controller.clear();
|
|
||||||
controller.clearPlaces1();
|
|
||||||
},
|
|
||||||
icon: Icon(
|
|
||||||
Icons.clear,
|
|
||||||
color: Colors.red[300],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
controller: controller.wayPoint1Controller,
|
|
||||||
onChanged: (value) {
|
|
||||||
if (controller.wayPoint1Controller.text.length > 5) {
|
|
||||||
controller.getPlacesListsWayPoint1();
|
|
||||||
controller.changeHeightPlaces1();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// onEditingComplete: () => controller.changeHeight(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
controller.wayPoint1.isEmpty
|
|
||||||
? InkWell(
|
|
||||||
onTap: () {
|
|
||||||
controller.startLocationFromMap1 = true;
|
|
||||||
controller.changeMainBottomMenuMap();
|
|
||||||
controller.changePickerShown();
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
'Choose from Map'.tr,
|
|
||||||
style:
|
|
||||||
AppStyle.title.copyWith(color: AppColor.blueColor),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: const SizedBox(),
|
|
||||||
Container(
|
|
||||||
height: controller.wayPoint1.isNotEmpty ? controller.height : 0,
|
|
||||||
color: AppColor.secondaryColor,
|
|
||||||
child: ListView.builder(
|
|
||||||
itemCount: controller.wayPoint1.length,
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
var res = controller.wayPoint1[index];
|
|
||||||
return InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
controller.changeHeightPlaces();
|
|
||||||
if (controller.currentLocationToFormPlaces1 == true) {
|
|
||||||
controller.newStartPointLocation =
|
|
||||||
controller.myLocation;
|
|
||||||
} else {
|
|
||||||
controller.myLocation =
|
|
||||||
controller.newStartPointLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
controller.convertHintTextPlaces1(index);
|
|
||||||
controller.currentLocationString1 = res['name'];
|
|
||||||
// controller.wayPoint1 = [];
|
|
||||||
// controller.wayPoint1Controller.clear();
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
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,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
GetBuilder<MapPassengerController> formSearchPlaces2() {
|
|
||||||
// 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.hintTextwayPoint2.tr,
|
|
||||||
hintStyle: AppStyle.title,
|
|
||||||
hintMaxLines: 1,
|
|
||||||
prefixIcon: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
controller.wayPoint2Controller.clear();
|
|
||||||
controller.clearPlaces2();
|
|
||||||
},
|
|
||||||
icon: Icon(
|
|
||||||
Icons.clear,
|
|
||||||
color: Colors.red[300],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
controller: controller.wayPoint2Controller,
|
|
||||||
onChanged: (value) {
|
|
||||||
if (controller.wayPoint2Controller.text.length > 5) {
|
|
||||||
controller.getPlacesListsWayPoint2();
|
|
||||||
controller.changeHeightPlaces2();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// onEditingComplete: () => controller.changeHeight(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
controller.wayPoint2.isEmpty
|
|
||||||
? InkWell(
|
|
||||||
onTap: () {
|
|
||||||
controller.startLocationFromMap2 = true;
|
|
||||||
controller.changeMainBottomMenuMap();
|
|
||||||
controller.changePickerShown();
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
'Choose from Map'.tr,
|
|
||||||
style:
|
|
||||||
AppStyle.title.copyWith(color: AppColor.blueColor),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: const SizedBox(),
|
|
||||||
Container(
|
|
||||||
height: controller.wayPoint2.isNotEmpty ? controller.height : 0,
|
|
||||||
color: AppColor.secondaryColor,
|
|
||||||
child: ListView.builder(
|
|
||||||
itemCount: controller.wayPoint2.length,
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
var res = controller.wayPoint2[index];
|
|
||||||
return InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
controller.changeHeightPlaces();
|
|
||||||
if (controller.currentLocationToFormPlaces2 == true) {
|
|
||||||
controller.newStartPointLocation =
|
|
||||||
controller.myLocation;
|
|
||||||
} else {
|
|
||||||
controller.myLocation =
|
|
||||||
controller.newStartPointLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
controller.convertHintTextPlaces2(index);
|
|
||||||
controller.currentLocationString2 = res['name'];
|
|
||||||
controller.wayPoint2 = [];
|
|
||||||
controller.wayPoint2Controller.clear();
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
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,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
GetBuilder<MapPassengerController> formSearchPlaces3() {
|
|
||||||
// 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.hintTextwayPoint3.tr,
|
|
||||||
hintStyle: AppStyle.title,
|
|
||||||
hintMaxLines: 1,
|
|
||||||
prefixIcon: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
controller.wayPoint3Controller.clear();
|
|
||||||
controller.clearPlaces3();
|
|
||||||
},
|
|
||||||
icon: Icon(
|
|
||||||
Icons.clear,
|
|
||||||
color: Colors.red[300],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
controller: controller.wayPoint3Controller,
|
|
||||||
onChanged: (value) {
|
|
||||||
if (controller.wayPoint3Controller.text.length > 5) {
|
|
||||||
controller.getPlacesListsWayPoint3();
|
|
||||||
controller.changeHeightPlaces3();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// onEditingComplete: () => controller.changeHeight(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
controller.wayPoint3.isEmpty
|
|
||||||
? InkWell(
|
|
||||||
onTap: () {
|
|
||||||
controller.startLocationFromMap3 = true;
|
|
||||||
controller.changeMainBottomMenuMap();
|
|
||||||
controller.changePickerShown();
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
'Choose from Map'.tr,
|
|
||||||
style:
|
|
||||||
AppStyle.title.copyWith(color: AppColor.blueColor),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: const SizedBox(),
|
|
||||||
Container(
|
|
||||||
height: controller.wayPoint3.isNotEmpty ? controller.height : 0,
|
|
||||||
color: AppColor.secondaryColor,
|
|
||||||
child: ListView.builder(
|
|
||||||
itemCount: controller.wayPoint3.length,
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
var res = controller.wayPoint3[index];
|
|
||||||
return InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
controller.changeHeightPlaces();
|
|
||||||
if (controller.currentLocationToFormPlaces3 == true) {
|
|
||||||
controller.newStartPointLocation =
|
|
||||||
controller.myLocation;
|
|
||||||
} else {
|
|
||||||
controller.myLocation =
|
|
||||||
controller.newStartPointLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
controller.convertHintTextPlaces3(index);
|
|
||||||
controller.currentLocationString3 = res['name'];
|
|
||||||
controller.wayPoint3 = [];
|
|
||||||
controller.wayPoint3Controller.clear();
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
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,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
GetBuilder<MapPassengerController> formSearchPlaces4() {
|
|
||||||
// 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.hintTextwayPoint4.tr,
|
|
||||||
hintStyle: AppStyle.title,
|
|
||||||
hintMaxLines: 1,
|
|
||||||
prefixIcon: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
controller.wayPoint4Controller.clear();
|
|
||||||
controller.clearPlaces4();
|
|
||||||
},
|
|
||||||
icon: Icon(
|
|
||||||
Icons.clear,
|
|
||||||
color: Colors.red[300],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
controller: controller.wayPoint4Controller,
|
|
||||||
onChanged: (value) {
|
|
||||||
if (controller.wayPoint4Controller.text.length > 5) {
|
|
||||||
controller.getPlacesListsWayPoint4();
|
|
||||||
controller.changeHeightPlaces4();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// onEditingComplete: () => controller.changeHeight(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
controller.wayPoint4.isEmpty
|
|
||||||
? InkWell(
|
|
||||||
onTap: () {
|
|
||||||
controller.startLocationFromMap4 = true;
|
|
||||||
controller.changeMainBottomMenuMap();
|
|
||||||
controller.changePickerShown();
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
'Choose from Map'.tr,
|
|
||||||
style:
|
|
||||||
AppStyle.title.copyWith(color: AppColor.blueColor),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: const SizedBox(),
|
|
||||||
Container(
|
|
||||||
height: controller.wayPoint4.isNotEmpty ? controller.height : 0,
|
|
||||||
color: AppColor.secondaryColor,
|
|
||||||
child: ListView.builder(
|
|
||||||
itemCount: controller.wayPoint4.length,
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
var res = controller.wayPoint4[index];
|
|
||||||
return InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
controller.changeHeightPlaces();
|
|
||||||
if (controller.currentLocationToFormPlaces4 == true) {
|
|
||||||
controller.newStartPointLocation =
|
|
||||||
controller.myLocation;
|
|
||||||
} else {
|
|
||||||
controller.myLocation =
|
|
||||||
controller.newStartPointLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
controller.convertHintTextPlaces4(index);
|
|
||||||
controller.currentLocationString4 = res['name'];
|
|
||||||
controller.wayPoint4 = [];
|
|
||||||
controller.wayPoint4Controller.clear();
|
|
||||||
Get.back();
|
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
|
import 'package:ride/controller/home/points_for_rider_controller.dart';
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
import '../../../constant/style.dart';
|
import '../../../constant/style.dart';
|
||||||
@@ -9,10 +10,10 @@ import '../../widgets/elevated_btn.dart';
|
|||||||
import '../../widgets/mycircular.dart';
|
import '../../widgets/mycircular.dart';
|
||||||
|
|
||||||
class GoogleMapPassengerWidget extends StatelessWidget {
|
class GoogleMapPassengerWidget extends StatelessWidget {
|
||||||
const GoogleMapPassengerWidget({
|
GoogleMapPassengerWidget({
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
WayPointController wayPointController = Get.put(WayPointController());
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GetBuilder<MapPassengerController>(
|
return GetBuilder<MapPassengerController>(
|
||||||
@@ -199,6 +200,55 @@ class GoogleMapPassengerWidget extends StatelessWidget {
|
|||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
width: 5,
|
width: 5,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
Polyline(
|
||||||
|
zIndex: 1,
|
||||||
|
consumeTapEvents: true,
|
||||||
|
geodesic: true,
|
||||||
|
endCap: Cap.buttCap,
|
||||||
|
startCap: Cap.buttCap,
|
||||||
|
visible: true,
|
||||||
|
polylineId: const PolylineId('route0'),
|
||||||
|
points: controller.polylineCoordinatesPointsAll[0],
|
||||||
|
color: AppColor.blueColor,
|
||||||
|
width: 5,
|
||||||
|
),
|
||||||
|
Polyline(
|
||||||
|
zIndex: 2,
|
||||||
|
consumeTapEvents: true,
|
||||||
|
geodesic: true,
|
||||||
|
endCap: Cap.buttCap,
|
||||||
|
startCap: Cap.buttCap,
|
||||||
|
visible: true,
|
||||||
|
polylineId: const PolylineId('route1'),
|
||||||
|
points: controller.polylineCoordinatesPointsAll[1],
|
||||||
|
color: AppColor.yellowColor,
|
||||||
|
width: 5,
|
||||||
|
),
|
||||||
|
Polyline(
|
||||||
|
zIndex: 2,
|
||||||
|
consumeTapEvents: true,
|
||||||
|
geodesic: true,
|
||||||
|
endCap: Cap.buttCap,
|
||||||
|
startCap: Cap.buttCap,
|
||||||
|
visible: true,
|
||||||
|
polylineId: const PolylineId('route2'),
|
||||||
|
points: controller.polylineCoordinatesPointsAll[2],
|
||||||
|
color: AppColor.greenColor,
|
||||||
|
width: 5,
|
||||||
|
),
|
||||||
|
Polyline(
|
||||||
|
zIndex: 2,
|
||||||
|
consumeTapEvents: true,
|
||||||
|
geodesic: true,
|
||||||
|
endCap: Cap.buttCap,
|
||||||
|
startCap: Cap.buttCap,
|
||||||
|
visible: true,
|
||||||
|
polylineId: const PolylineId('route3'),
|
||||||
|
points: controller.polylineCoordinatesPointsAll[2],
|
||||||
|
color: AppColor.deepPurpleAccent,
|
||||||
|
width: 5,
|
||||||
|
),
|
||||||
// Polyline(
|
// Polyline(
|
||||||
// zIndex: 2,
|
// zIndex: 2,
|
||||||
// consumeTapEvents: true,
|
// consumeTapEvents: true,
|
||||||
|
|||||||
@@ -30,14 +30,53 @@ class PointsPageForRider extends StatelessWidget {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
// const AppBarPointsPageForRider(),
|
// const AppBarPointsPageForRider(),
|
||||||
IconButton(
|
Row(
|
||||||
onPressed: () {
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
mapPassengerController.changeWayPointSheet();
|
children: [
|
||||||
},
|
IconButton(
|
||||||
icon: const Icon(Icons.arrow_drop_down_circle_outlined),
|
onPressed: () {
|
||||||
|
mapPassengerController.changeWayPointSheet();
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.arrow_drop_down_circle_outlined),
|
||||||
|
),
|
||||||
|
GetBuilder<WayPointController>(builder: (wayPointController) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
wayPointController.addWayPoints();
|
||||||
|
},
|
||||||
|
child: const Text('Add Text Field'),
|
||||||
|
),
|
||||||
|
wayPointController.wayPoints.length > 1
|
||||||
|
? ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
print(mapPassengerController.placesCoordinate
|
||||||
|
.toString());
|
||||||
|
|
||||||
|
for (var i = 0;
|
||||||
|
i < wayPointController.wayPoints.length;
|
||||||
|
i++) {
|
||||||
|
mapPassengerController.getMapPoints(
|
||||||
|
mapPassengerController.placesCoordinate[i]
|
||||||
|
.toString(),
|
||||||
|
mapPassengerController
|
||||||
|
.placesCoordinate[i + 1]
|
||||||
|
.toString(),
|
||||||
|
i,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: const Text('Get Map'),
|
||||||
|
)
|
||||||
|
: const SizedBox()
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: Get.height * .57,
|
height: Get.height * .36,
|
||||||
child: GetBuilder<WayPointController>(
|
child: GetBuilder<WayPointController>(
|
||||||
builder: (wayPointController) {
|
builder: (wayPointController) {
|
||||||
return ReorderableListView(
|
return ReorderableListView(
|
||||||
@@ -50,7 +89,7 @@ class PointsPageForRider extends StatelessWidget {
|
|||||||
final wayPoint = entry.value;
|
final wayPoint = entry.value;
|
||||||
return Padding(
|
return Padding(
|
||||||
key: ValueKey(index),
|
key: ValueKey(index),
|
||||||
padding: const EdgeInsets.all(6),
|
padding: const EdgeInsets.all(1),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: Container(
|
leading: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@@ -86,35 +125,39 @@ class PointsPageForRider extends StatelessWidget {
|
|||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
index == 0
|
Text(mapPassengerController
|
||||||
? Text(
|
.currentLocationStringAll[index]
|
||||||
mapPassengerController
|
.toString())
|
||||||
.currentLocationString0,
|
// index == 0
|
||||||
style: AppStyle.title,
|
// ? Text(
|
||||||
)
|
// mapPassengerController
|
||||||
: index == 1
|
// .currentLocationString0,
|
||||||
? Text(
|
// style: AppStyle.title,
|
||||||
mapPassengerController
|
// )
|
||||||
.currentLocationString1,
|
// : index == 1
|
||||||
style: AppStyle.title,
|
// ? Text(
|
||||||
)
|
// mapPassengerController
|
||||||
: index == 2
|
// .currentLocationString1,
|
||||||
? Text(
|
// style: AppStyle.title,
|
||||||
mapPassengerController
|
// )
|
||||||
.currentLocationString2,
|
// : index == 2
|
||||||
style: AppStyle.title,
|
// ? Text(
|
||||||
)
|
// mapPassengerController
|
||||||
: index == 3
|
// .currentLocationString2,
|
||||||
? Text(
|
// style: AppStyle.title,
|
||||||
mapPassengerController
|
// )
|
||||||
.currentLocationString3,
|
// : index == 3
|
||||||
style: AppStyle.title,
|
// ? Text(
|
||||||
)
|
// mapPassengerController
|
||||||
: Text(
|
// .currentLocationString3,
|
||||||
mapPassengerController
|
// style: AppStyle.title,
|
||||||
.currentLocationString4,
|
// )
|
||||||
style: AppStyle.title,
|
// : Text(
|
||||||
),
|
// mapPassengerController
|
||||||
|
// .currentLocationString4,
|
||||||
|
// style: AppStyle.title,
|
||||||
|
// ),
|
||||||
|
,
|
||||||
const Icon(
|
const Icon(
|
||||||
Icons.reorder,
|
Icons.reorder,
|
||||||
size: 20,
|
size: 20,
|
||||||
@@ -148,14 +191,6 @@ class PointsPageForRider extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
GetBuilder<WayPointController>(builder: (wayPointController) {
|
|
||||||
return ElevatedButton(
|
|
||||||
onPressed: () {
|
|
||||||
wayPointController.addWayPoints();
|
|
||||||
},
|
|
||||||
child: const Text('Add Text Field'),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user