1/8/1
@@ -32,7 +32,7 @@ def keystorePropertiesFile = rootProject.file('key.properties')
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "com.mobileapp.store.ride"
|
namespace "com.mobileapp.store.ride"
|
||||||
compileSdkVersion flutter.compileSdkVersion
|
compileSdkVersion 34
|
||||||
ndkVersion flutter.ndkVersion
|
ndkVersion flutter.ndkVersion
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.1 KiB |
BIN
android/app/src/main/res/mipmap-hdpi/launcher_icon.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
BIN
android/app/src/main/res/mipmap-mdpi/launcher_icon.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
BIN
android/app/src/main/res/mipmap-xhdpi/launcher_icon.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
BIN
android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 6.5 KiB |
BIN
android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 396 B |
|
After Width: | Height: | Size: 875 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 603 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 875 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
@@ -37,19 +37,11 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<<<<<<< HEAD
|
|
||||||
<string>12</string>
|
<string>12</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.32</string>
|
<string>1.32</string>
|
||||||
=======
|
|
||||||
<string>11</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1.31</string>
|
|
||||||
>>>>>>> origin/main
|
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class AppStyle {
|
|||||||
fontSize: 40,
|
fontSize: 40,
|
||||||
color: AppColor.accentColor,
|
color: AppColor.accentColor,
|
||||||
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
fontFamily: GoogleFonts.josefinSans().fontFamily);
|
||||||
static TextStyle headtitle2 = TextStyle(
|
static TextStyle headTitle2 = TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 26,
|
fontSize: 26,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import 'package:location/location.dart';
|
|||||||
import 'package:ride/constant/box_name.dart';
|
import 'package:ride/constant/box_name.dart';
|
||||||
import 'package:ride/constant/links.dart';
|
import 'package:ride/constant/links.dart';
|
||||||
import 'package:ride/controller/functions/crud.dart';
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
import 'package:ride/controller/home/captin/home_captain_controller.dart';
|
|
||||||
import 'package:ride/controller/home/payment/captain_wallet_controller.dart';
|
import 'package:ride/controller/home/payment/captain_wallet_controller.dart';
|
||||||
import 'package:ride/main.dart';
|
import 'package:ride/main.dart';
|
||||||
|
|
||||||
@@ -26,6 +25,7 @@ class LocationController extends GetxController {
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
location = Location();
|
location = Location();
|
||||||
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
||||||
|
getLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
void startLocationUpdates() async {
|
void startLocationUpdates() async {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import 'package:location/location.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/home/map_page_passenger.dart';
|
import 'package:ride/views/home/map_page_passenger.dart';
|
||||||
|
import 'package:ride/views/home/map_widget.dart/form_serch_multiy_point.dart';
|
||||||
import '../../constant/api_key.dart';
|
import '../../constant/api_key.dart';
|
||||||
import '../../constant/box_name.dart';
|
import '../../constant/box_name.dart';
|
||||||
import '../../constant/info.dart';
|
import '../../constant/info.dart';
|
||||||
@@ -27,18 +28,43 @@ class MapPassengerController extends GetxController {
|
|||||||
bool isLoading = true;
|
bool isLoading = true;
|
||||||
TextEditingController placeDestinationController = TextEditingController();
|
TextEditingController placeDestinationController = TextEditingController();
|
||||||
TextEditingController placeStartController = TextEditingController();
|
TextEditingController placeStartController = TextEditingController();
|
||||||
|
TextEditingController wayPoint0Controller = TextEditingController();
|
||||||
|
TextEditingController wayPoint1Controller = TextEditingController();
|
||||||
|
TextEditingController wayPoint2Controller = TextEditingController();
|
||||||
|
TextEditingController wayPoint3Controller = TextEditingController();
|
||||||
|
TextEditingController wayPoint4Controller = 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 placesStart = [];
|
List placesStart = [];
|
||||||
|
List<TextEditingController> allTextEditingPlaces = [];
|
||||||
List placesDestination = [];
|
List placesDestination = [];
|
||||||
|
List wayPoint0 = [];
|
||||||
|
List wayPoint1 = [];
|
||||||
|
List wayPoint2 = [];
|
||||||
|
List wayPoint3 = [];
|
||||||
|
List wayPoint4 = [];
|
||||||
|
|
||||||
|
List<List<dynamic>> placeListResponseAll = [];
|
||||||
|
|
||||||
|
List<Widget> placeListResponse = [
|
||||||
|
formSearchPlaces1(),
|
||||||
|
formSearchPlaces2(),
|
||||||
|
formSearchPlaces3(),
|
||||||
|
formSearchPlaces4(),
|
||||||
|
];
|
||||||
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);
|
late LatLng newStartPointLocation = const LatLng(32.115295, 36.064773);
|
||||||
|
late LatLng newPointLocation0 = const LatLng(32.115295, 36.064773);
|
||||||
|
late LatLng newPointLocation1 = const LatLng(32.115295, 36.064773);
|
||||||
|
late LatLng newPointLocation2 = const LatLng(32.115295, 36.064773);
|
||||||
|
late LatLng newPointLocation3 = 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 = [];
|
||||||
List<LatLng> carsLocationByPassenger = [];
|
List<LatLng> carsLocationByPassenger = [];
|
||||||
@@ -53,10 +79,17 @@ class MapPassengerController extends GetxController {
|
|||||||
double heightMenu = 0;
|
double heightMenu = 0;
|
||||||
double widthMenu = 0;
|
double widthMenu = 0;
|
||||||
double heightPickerContainer = 90;
|
double heightPickerContainer = 90;
|
||||||
|
double heightPointsPageForRider = 0;
|
||||||
double mainBottomMenuMap = Get.height * .2;
|
double mainBottomMenuMap = Get.height * .2;
|
||||||
bool startLocationFromMap = false;
|
bool startLocationFromMap = false;
|
||||||
|
bool startLocationFromMap0 = false;
|
||||||
|
bool startLocationFromMap1 = false;
|
||||||
|
bool startLocationFromMap2 = false;
|
||||||
|
bool startLocationFromMap3 = false;
|
||||||
|
bool startLocationFromMap4 = false;
|
||||||
bool heightMenuBool = false;
|
bool heightMenuBool = false;
|
||||||
bool isPickerShown = false;
|
bool isPickerShown = false;
|
||||||
|
bool isPointsPageForRider = false;
|
||||||
bool isBottomSheetShown = false;
|
bool isBottomSheetShown = false;
|
||||||
bool mapType = false;
|
bool mapType = false;
|
||||||
bool mapTrafficON = false;
|
bool mapTrafficON = false;
|
||||||
@@ -93,6 +126,11 @@ class MapPassengerController extends GetxController {
|
|||||||
int remainingTimeTimerRideBegin = 60;
|
int remainingTimeTimerRideBegin = 60;
|
||||||
String stringRemainingTimeRideBegin = '';
|
String stringRemainingTimeRideBegin = '';
|
||||||
String hintTextStartPoint = 'Search for your Start point'.tr;
|
String hintTextStartPoint = 'Search for your Start point'.tr;
|
||||||
|
String hintTextwayPoint0 = 'Search for waypoint'.tr;
|
||||||
|
String hintTextwayPoint1 = 'Search for waypoint'.tr;
|
||||||
|
String hintTextwayPoint2 = 'Search for waypoint'.tr;
|
||||||
|
String hintTextwayPoint3 = 'Search for waypoint'.tr;
|
||||||
|
String hintTextwayPoint4 = 'Search for waypoint'.tr;
|
||||||
String currentLocationString = 'Current Location'.tr;
|
String currentLocationString = 'Current Location'.tr;
|
||||||
String hintTextDestinationPoint = 'Search for your destination'.tr;
|
String hintTextDestinationPoint = 'Search for your destination'.tr;
|
||||||
late String rideId;
|
late String rideId;
|
||||||
@@ -100,6 +138,11 @@ class MapPassengerController extends GetxController {
|
|||||||
bool isCashSelectedBeforeConfirmRide = false;
|
bool isCashSelectedBeforeConfirmRide = false;
|
||||||
bool isPassengerChosen = false;
|
bool isPassengerChosen = false;
|
||||||
bool currentLocationToFormPlaces = false;
|
bool currentLocationToFormPlaces = false;
|
||||||
|
bool currentLocationToFormPlaces0 = false;
|
||||||
|
bool currentLocationToFormPlaces1 = false;
|
||||||
|
bool currentLocationToFormPlaces2 = false;
|
||||||
|
bool currentLocationToFormPlaces3 = false;
|
||||||
|
bool currentLocationToFormPlaces4 = false;
|
||||||
late String driverToken;
|
late String driverToken;
|
||||||
int carsOrder = 0;
|
int carsOrder = 0;
|
||||||
String? mapAPIKEY;
|
String? mapAPIKEY;
|
||||||
@@ -148,6 +191,71 @@ class MapPassengerController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void convertHintTextPlaces0(int index) {
|
||||||
|
if (wayPoint0.isEmpty) {
|
||||||
|
hintTextwayPoint0 = 'Search for your Start point'.tr;
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
hintTextwayPoint0 = wayPoint0[index]['name'];
|
||||||
|
double lat = wayPoint0[index]['geometry']['location']['lat'];
|
||||||
|
double lng = wayPoint0[index]['geometry']['location']['lng'];
|
||||||
|
newPointLocation0 = LatLng(lat, lng);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void convertHintTextPlaces1(int index) {
|
||||||
|
if (wayPoint1.isEmpty) {
|
||||||
|
hintTextwayPoint1 = 'Search for your Start point'.tr;
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
hintTextwayPoint1 = wayPoint1[index]['name'];
|
||||||
|
double lat = wayPoint1[index]['geometry']['location']['lat'];
|
||||||
|
double lng = wayPoint1[index]['geometry']['location']['lng'];
|
||||||
|
newPointLocation1 = LatLng(lat, lng);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void convertHintTextPlaces2(int index) {
|
||||||
|
if (wayPoint1.isEmpty) {
|
||||||
|
hintTextwayPoint2 = 'Search for your Start point'.tr;
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
hintTextwayPoint2 = wayPoint2[index]['name'];
|
||||||
|
double lat = wayPoint2[index]['geometry']['location']['lat'];
|
||||||
|
double lng = wayPoint2[index]['geometry']['location']['lng'];
|
||||||
|
newPointLocation2 = LatLng(lat, lng);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void convertHintTextPlaces3(int index) {
|
||||||
|
if (wayPoint1.isEmpty) {
|
||||||
|
hintTextwayPoint3 = 'Search for your Start point'.tr;
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
hintTextwayPoint3 = wayPoint3[index]['name'];
|
||||||
|
double lat = wayPoint3[index]['geometry']['location']['lat'];
|
||||||
|
double lng = wayPoint3[index]['geometry']['location']['lng'];
|
||||||
|
newPointLocation3 = LatLng(lat, lng);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void convertHintTextPlaces4(int index) {
|
||||||
|
if (wayPoint1.isEmpty) {
|
||||||
|
hintTextwayPoint4 = 'Search for your Start point'.tr;
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
hintTextwayPoint4 = wayPoint4[index]['name'];
|
||||||
|
double lat = wayPoint4[index]['geometry']['location']['lat'];
|
||||||
|
double lng = wayPoint4[index]['geometry']['location']['lng'];
|
||||||
|
newPointLocation4 = LatLng(lat, lng);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void convertHintTextDestinationNewPlaces(int index) {
|
void convertHintTextDestinationNewPlaces(int index) {
|
||||||
if (placesDestination.isEmpty) {
|
if (placesDestination.isEmpty) {
|
||||||
hintTextDestinationPoint = 'Search for your destination'.tr;
|
hintTextDestinationPoint = 'Search for your destination'.tr;
|
||||||
@@ -330,6 +438,36 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clearPlaces0() {
|
||||||
|
wayPoint0 = [];
|
||||||
|
hintTextwayPoint0 = 'Search for waypoint'.tr;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void clearPlaces1() {
|
||||||
|
wayPoint1 = [];
|
||||||
|
hintTextwayPoint1 = 'Search for waypoint'.tr;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void clearPlaces2() {
|
||||||
|
wayPoint2 = [];
|
||||||
|
hintTextwayPoint2 = 'Search for waypoint'.tr;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void clearPlaces3() {
|
||||||
|
wayPoint3 = [];
|
||||||
|
hintTextwayPoint3 = 'Search for waypoint'.tr;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void clearPlaces4() {
|
||||||
|
wayPoint4 = [];
|
||||||
|
hintTextwayPoint4 = 'Search for waypoint'.tr;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
int selectedReason = -1;
|
int selectedReason = -1;
|
||||||
String? cancelNote;
|
String? cancelNote;
|
||||||
void selectReason(int index, String note) {
|
void selectReason(int index, String note) {
|
||||||
@@ -684,6 +822,12 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void changeHeightPointsPageForRider() {
|
||||||
|
isPointsPageForRider = !isPointsPageForRider;
|
||||||
|
heightPointsPageForRider = isPointsPageForRider == true ? Get.height : 0;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
void changeMainBottomMenuMap() {
|
void changeMainBottomMenuMap() {
|
||||||
isMainBottomMenuMap = !isMainBottomMenuMap;
|
isMainBottomMenuMap = !isMainBottomMenuMap;
|
||||||
mainBottomMenuMap =
|
mainBottomMenuMap =
|
||||||
@@ -712,6 +856,51 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeHeightPlaces0() {
|
||||||
|
if (wayPoint0.isEmpty) {
|
||||||
|
height = 0;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
height = 150;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
changeHeightPlaces1() {
|
||||||
|
if (wayPoint1.isEmpty) {
|
||||||
|
height = 0;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
height = 150;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
changeHeightPlaces2() {
|
||||||
|
if (wayPoint2.isEmpty) {
|
||||||
|
height = 0;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
height = 150;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
changeHeightPlaces3() {
|
||||||
|
if (wayPoint3.isEmpty) {
|
||||||
|
height = 0;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
height = 150;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
changeHeightPlaces4() {
|
||||||
|
if (wayPoint4.isEmpty) {
|
||||||
|
height = 0;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
height = 150;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
hidePlaces() {
|
hidePlaces() {
|
||||||
height = 0;
|
height = 0;
|
||||||
|
|
||||||
@@ -742,6 +931,61 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future getPlacesListsWayPoint0() async {
|
||||||
|
var url =
|
||||||
|
'${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: {});
|
||||||
|
|
||||||
|
wayPoint0 = response['results'];
|
||||||
|
print(wayPoint0);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getPlacesListsWayPoint1() async {
|
||||||
|
var url =
|
||||||
|
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint1Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||||
|
|
||||||
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
|
||||||
|
wayPoint1 = response['results'];
|
||||||
|
print(wayPoint1);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getPlacesListsWayPoint2() async {
|
||||||
|
var url =
|
||||||
|
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint2Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||||
|
|
||||||
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
|
||||||
|
wayPoint2 = response['results'];
|
||||||
|
print(wayPoint2);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getPlacesListsWayPoint3() async {
|
||||||
|
var url =
|
||||||
|
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint3Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||||
|
|
||||||
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
|
||||||
|
wayPoint3 = response['results'];
|
||||||
|
print(wayPoint3);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getPlacesListsWayPoint4() async {
|
||||||
|
var url =
|
||||||
|
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint4Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||||
|
|
||||||
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
|
||||||
|
wayPoint4 = response['results'];
|
||||||
|
print(wayPoint4);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
LatLng fromString(String location) {
|
LatLng fromString(String location) {
|
||||||
List<String> parts = location.split(',');
|
List<String> parts = location.split(',');
|
||||||
double lat = double.parse(parts[0]);
|
double lat = double.parse(parts[0]);
|
||||||
@@ -1241,6 +1485,25 @@ class MapPassengerController extends GetxController {
|
|||||||
addCustomTripIcon();
|
addCustomTripIcon();
|
||||||
startMarkerReloading();
|
startMarkerReloading();
|
||||||
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
|
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
|
||||||
|
allTextEditingPlaces = [
|
||||||
|
wayPoint0Controller,
|
||||||
|
wayPoint1Controller,
|
||||||
|
wayPoint2Controller,
|
||||||
|
wayPoint3Controller,
|
||||||
|
wayPoint4Controller,
|
||||||
|
];
|
||||||
|
placeListResponseAll = [
|
||||||
|
wayPoint0,
|
||||||
|
wayPoint1,
|
||||||
|
wayPoint2,
|
||||||
|
wayPoint3,
|
||||||
|
wayPoint4
|
||||||
|
];
|
||||||
|
// placeListResponse.add(wayPoint0);
|
||||||
|
// placeListResponse.add(wayPoint1);
|
||||||
|
// placeListResponse.add(wayPoint2);
|
||||||
|
// placeListResponse.add(wayPoint3);
|
||||||
|
// placeListResponse.add(wayPoint4);
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
152
lib/controller/home/points_for_rider_controller.dart
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
|
import 'package:ride/constant/style.dart';
|
||||||
|
|
||||||
|
import '../../constant/api_key.dart';
|
||||||
|
import '../../constant/links.dart';
|
||||||
|
import '../functions/crud.dart';
|
||||||
|
import '../functions/location_controller.dart';
|
||||||
|
|
||||||
|
class PointsForRiderController extends GetxController {
|
||||||
|
List<String> locations = [];
|
||||||
|
String hintTextDestinationPoint = 'Search for your destination'.tr;
|
||||||
|
TextEditingController placeStartController = TextEditingController();
|
||||||
|
|
||||||
|
void addLocation(String location) {
|
||||||
|
locations.add(location);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void getTextFromList(String location) {
|
||||||
|
locations.add(location);
|
||||||
|
update();
|
||||||
|
Get.back();
|
||||||
|
}
|
||||||
|
|
||||||
|
void removeLocation(int index) {
|
||||||
|
print(index);
|
||||||
|
locations.removeAt(index);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void onReorder(int oldIndex, int newIndex) {
|
||||||
|
if (newIndex > oldIndex) {
|
||||||
|
newIndex -= 1;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
final item = locations.removeAt(oldIndex);
|
||||||
|
locations.insert(newIndex, item);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class LocationModel {
|
||||||
|
String name;
|
||||||
|
double lat, lon;
|
||||||
|
|
||||||
|
LocationModel({required this.name, required this.lat, required this.lon});
|
||||||
|
}
|
||||||
|
|
||||||
|
class WayPointController extends GetxController {
|
||||||
|
// A list of text editing controllers for each text field
|
||||||
|
// final textFields = [TextEditingController()].obs;
|
||||||
|
List<String> wayPoints = [];
|
||||||
|
List<List<dynamic>> placeListResponse = [];
|
||||||
|
double wayPointHeight = 400;
|
||||||
|
String hintTextDestinationPoint = 'Search for your destination'.tr;
|
||||||
|
TextEditingController textSearchCotroller = TextEditingController();
|
||||||
|
// A list of places corresponding to each text field
|
||||||
|
final places = <String>[];
|
||||||
|
final hintTextPointList = <String>[];
|
||||||
|
late LatLng myLocation;
|
||||||
|
|
||||||
|
void addWayPoints() {
|
||||||
|
String wayPoint = 'Add a Stop'.tr;
|
||||||
|
|
||||||
|
if (wayPoints.length < 5) {
|
||||||
|
wayPoints.add(wayPoint);
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'This is most WayPoints', titleStyle: AppStyle.title);
|
||||||
|
}
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void removeTextField(int index) {
|
||||||
|
wayPoints.removeAt(index);
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
// A method to reorder the text fields and the places
|
||||||
|
void reorderTextFields(int oldIndex, int newIndex) {
|
||||||
|
if (newIndex > oldIndex) {
|
||||||
|
newIndex -= 1;
|
||||||
|
}
|
||||||
|
final wayPoint = wayPoints.removeAt(oldIndex);
|
||||||
|
wayPoints.insert(newIndex, wayPoint);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void updatePlace(int index, String input) async {
|
||||||
|
print(myLocation);
|
||||||
|
print(index);
|
||||||
|
print(input);
|
||||||
|
var url =
|
||||||
|
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=$input&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||||
|
print(url);
|
||||||
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
// final place = input;
|
||||||
|
// print(response);
|
||||||
|
// if (index == 0) {
|
||||||
|
List<dynamic> newList = [];
|
||||||
|
placeListResponse.add(newList);
|
||||||
|
newList = response['results'];
|
||||||
|
print(newList);
|
||||||
|
placeListResponse[index].add(newList);
|
||||||
|
update();
|
||||||
|
// }
|
||||||
|
|
||||||
|
print(placeListResponse[index]);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
Get.put(LocationController());
|
||||||
|
addWayPoints();
|
||||||
|
myLocation = Get.find<LocationController>().myLocation;
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PlaceList extends StatelessWidget {
|
||||||
|
// Get the controller instance
|
||||||
|
final controller = Get.put(WayPointController());
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// Use the Obx widget to rebuild the widget when the controller changes
|
||||||
|
return Obx(() {
|
||||||
|
// Use the ListView widget to display the list of places
|
||||||
|
return ListView(
|
||||||
|
// The children of the list are the places
|
||||||
|
children: [
|
||||||
|
// Loop through the places in the controller
|
||||||
|
for (final place in controller.places)
|
||||||
|
// Create a text widget for each place
|
||||||
|
Text(
|
||||||
|
// Use the place as the text
|
||||||
|
place,
|
||||||
|
|
||||||
|
// Add some style and padding
|
||||||
|
style: const TextStyle(fontSize: 18.0),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -42,7 +42,7 @@ class SplashScreen extends StatelessWidget {
|
|||||||
TypewriterAnimatedText(
|
TypewriterAnimatedText(
|
||||||
'Welcome to ${AppInformation.appName}',
|
'Welcome to ${AppInformation.appName}',
|
||||||
textStyle:
|
textStyle:
|
||||||
AppStyle.headTitle.copyWith(color: AppColor.greenColor),
|
AppStyle.headTitle2.copyWith(color: AppColor.greenColor),
|
||||||
speed: const Duration(milliseconds: 200),
|
speed: const Duration(milliseconds: 200),
|
||||||
),
|
),
|
||||||
], isRepeatingAnimation: true),
|
], isRepeatingAnimation: true),
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ Widget buildImageWithBoundingBoxes() {
|
|||||||
? Center(
|
? Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'No image selected yet'.tr,
|
'No image selected yet'.tr,
|
||||||
style: AppStyle.headtitle2,
|
style: AppStyle.headTitle2,
|
||||||
))
|
))
|
||||||
: Column(
|
: Column(
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
animatedTexts: [
|
animatedTexts: [
|
||||||
TypewriterAnimatedText(
|
TypewriterAnimatedText(
|
||||||
'Register Captin'.tr,
|
'Register Captin'.tr,
|
||||||
textStyle: AppStyle.headtitle2,
|
textStyle: AppStyle.headTitle2,
|
||||||
speed: const Duration(milliseconds: 200),
|
speed: const Duration(milliseconds: 200),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -271,7 +271,7 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
width: Get.width * .7,
|
width: Get.width * .7,
|
||||||
child: Text(
|
child: Text(
|
||||||
'Accept Ride\'s Terms & Review Privacy Notice'.tr,
|
'Accept Ride\'s Terms & Review Privacy Notice'.tr,
|
||||||
style: AppStyle.headtitle2,
|
style: AppStyle.headTitle2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ class LoginPage extends StatelessWidget {
|
|||||||
animatedTexts: [
|
animatedTexts: [
|
||||||
TypewriterAnimatedText(
|
TypewriterAnimatedText(
|
||||||
'Register'.tr,
|
'Register'.tr,
|
||||||
textStyle: AppStyle.headtitle2,
|
textStyle: AppStyle.headTitle2,
|
||||||
speed: const Duration(milliseconds: 200),
|
speed: const Duration(milliseconds: 200),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -236,7 +236,7 @@ class LoginPage extends StatelessWidget {
|
|||||||
onTap: () => Get.to(LoginCaptin()),
|
onTap: () => Get.to(LoginCaptin()),
|
||||||
child: Text(
|
child: Text(
|
||||||
'If You Want be Captin Click Here.'.tr,
|
'If You Want be Captin Click Here.'.tr,
|
||||||
style: AppStyle.headtitle2,
|
style: AppStyle.headTitle2,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@@ -264,7 +264,7 @@ class LoginPage extends StatelessWidget {
|
|||||||
width: Get.width * .7,
|
width: Get.width * .7,
|
||||||
child: Text(
|
child: Text(
|
||||||
'Accept Ride\'s Terms & Review Privacy Notice'.tr,
|
'Accept Ride\'s Terms & Review Privacy Notice'.tr,
|
||||||
style: AppStyle.headtitle2,
|
style: AppStyle.headTitle2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
text: 'Passenger Name is '.tr,
|
text: 'Passenger Name is '.tr,
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
children: [
|
children: [
|
||||||
TextSpan(text: myList[8], style: AppStyle.headtitle2),
|
TextSpan(text: myList[8], style: AppStyle.headTitle2),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -78,7 +78,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: double.parse(myList[2]).toStringAsFixed(2),
|
text: double.parse(myList[2]).toStringAsFixed(2),
|
||||||
style: AppStyle.headtitle2),
|
style: AppStyle.headTitle2),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -92,7 +92,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: myList[11].toString(),
|
text: myList[11].toString(),
|
||||||
style: AppStyle.headtitle2),
|
style: AppStyle.headTitle2),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -106,7 +106,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: myList[12].toString(),
|
text: myList[12].toString(),
|
||||||
style: AppStyle.headtitle2),
|
style: AppStyle.headTitle2),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -134,7 +134,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: myList[5].toString(),
|
text: myList[5].toString(),
|
||||||
style: AppStyle.headtitle2),
|
style: AppStyle.headTitle2),
|
||||||
TextSpan(text: ' KM'.tr, style: AppStyle.title),
|
TextSpan(text: ' KM'.tr, style: AppStyle.title),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
@@ -148,7 +148,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: myList[4].toString(),
|
text: myList[4].toString(),
|
||||||
style: AppStyle.headtitle2),
|
style: AppStyle.headTitle2),
|
||||||
TextSpan(text: ' Minutes'.tr, style: AppStyle.title),
|
TextSpan(text: ' Minutes'.tr, style: AppStyle.title),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class SettingsCaptain extends StatelessWidget {
|
|||||||
leading: const Icon(Icons.language),
|
leading: const Icon(Icons.language),
|
||||||
title: Text(
|
title: Text(
|
||||||
'Language',
|
'Language',
|
||||||
style: AppStyle.headtitle2,
|
style: AppStyle.headTitle2,
|
||||||
),
|
),
|
||||||
onTap: () => Get.to(const Language()),
|
onTap: () => Get.to(const Language()),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import 'map_widget.dart/main_bottom_menu_map.dart';
|
|||||||
import 'map_widget.dart/map_menu_widget.dart';
|
import 'map_widget.dart/map_menu_widget.dart';
|
||||||
import 'map_widget.dart/menu_map_page.dart';
|
import 'map_widget.dart/menu_map_page.dart';
|
||||||
import 'map_widget.dart/payment_method.page.dart';
|
import 'map_widget.dart/payment_method.page.dart';
|
||||||
|
import 'map_widget.dart/points_page_for_rider.dart';
|
||||||
import 'map_widget.dart/timer_for_cancell_trip_from_passenger.dart';
|
import 'map_widget.dart/timer_for_cancell_trip_from_passenger.dart';
|
||||||
import 'map_widget.dart/timer_to_passenger_from_driver.dart';
|
import 'map_widget.dart/timer_to_passenger_from_driver.dart';
|
||||||
|
|
||||||
@@ -46,6 +47,7 @@ class MapPagePassenger extends StatelessWidget {
|
|||||||
const TimerToPassengerFromDriver(),
|
const TimerToPassengerFromDriver(),
|
||||||
const RideBeginPassenger(),
|
const RideBeginPassenger(),
|
||||||
cancelRidePage(),
|
cancelRidePage(),
|
||||||
|
PointsPageForRider()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:ride/constant/table_names.dart';
|
import 'package:ride/constant/table_names.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
import '../../../constant/style.dart';
|
import '../../../constant/style.dart';
|
||||||
|
|||||||
779
lib/views/home/map_widget.dart/form_serch_multiy_point.dart
Normal file
@@ -0,0 +1,779 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/constant/table_names.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> formSearchPlaces0() {
|
||||||
|
// 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: 'Search for waypoint'.tr,
|
||||||
|
hintStyle: AppStyle.title,
|
||||||
|
hintMaxLines: 1,
|
||||||
|
prefixIcon: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
controller.wayPoint0Controller.clear();
|
||||||
|
controller.clearPlaces0();
|
||||||
|
},
|
||||||
|
icon: Icon(
|
||||||
|
Icons.clear,
|
||||||
|
color: Colors.red[300],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
controller: controller.wayPoint0Controller,
|
||||||
|
onChanged: (value) {
|
||||||
|
if (controller.wayPoint0Controller.text.length > 5) {
|
||||||
|
controller.getPlacesListsWayPoint0();
|
||||||
|
controller.changeHeightPlaces0();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// onEditingComplete: () => controller.changeHeight(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
controller.wayPoint0.isEmpty
|
||||||
|
? InkWell(
|
||||||
|
onTap: () {
|
||||||
|
controller.startLocationFromMap0 = true;
|
||||||
|
controller.changeMainBottomMenuMap();
|
||||||
|
controller.changePickerShown();
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
'Choose from Map'.tr,
|
||||||
|
style:
|
||||||
|
AppStyle.title.copyWith(color: AppColor.blueColor),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
|
Container(
|
||||||
|
height: controller.wayPoint0.isNotEmpty ? controller.height : 0,
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: controller.wayPoint0.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
var res = controller.wayPoint0[index];
|
||||||
|
return InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
controller.changeHeightPlaces();
|
||||||
|
if (controller.currentLocationToFormPlaces0 == true) {
|
||||||
|
controller.newStartPointLocation =
|
||||||
|
controller.myLocation;
|
||||||
|
} else {
|
||||||
|
controller.myLocation =
|
||||||
|
controller.newStartPointLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
controller.convertHintTextPlaces0(index);
|
||||||
|
controller.currentLocationString = res['name'];
|
||||||
|
controller.wayPoint0 = [];
|
||||||
|
controller.wayPoint0Controller.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,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
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: 'Search for waypoint'.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.currentLocationString = res['name'];
|
||||||
|
controller.wayPoint1 = [];
|
||||||
|
controller.wayPoint1Controller.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,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
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: 'Search for waypoint'.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.currentLocationString = res['name'];
|
||||||
|
controller.wayPoint2 = [];
|
||||||
|
controller.wayPoint2Controller.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,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
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: 'Search for waypoint'.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.currentLocationString = res['name'];
|
||||||
|
controller.wayPoint3 = [];
|
||||||
|
controller.wayPoint3Controller.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,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
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: 'Search for waypoint'.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.currentLocationString = res['name'];
|
||||||
|
controller.wayPoint4 = [];
|
||||||
|
controller.wayPoint4Controller.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,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
293
lib/views/home/map_widget.dart/points_page_for_rider.dart
Normal file
@@ -0,0 +1,293 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/constant/style.dart';
|
||||||
|
import 'package:ride/views/admin/captain/form_captain.dart';
|
||||||
|
|
||||||
|
import '../../../constant/colors.dart';
|
||||||
|
import '../../../controller/home/map_passenger_controller.dart';
|
||||||
|
import '../../../controller/home/points_for_rider_controller.dart';
|
||||||
|
|
||||||
|
class PointsPageForRider extends StatelessWidget {
|
||||||
|
PointsPageForRider({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
MapPassengerController mapPassengerController =
|
||||||
|
Get.put(MapPassengerController());
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
Get.put(WayPointController());
|
||||||
|
|
||||||
|
return GetBuilder<WayPointController>(builder: (wayPointController) {
|
||||||
|
return Container(
|
||||||
|
decoration: AppStyle.boxDecoration,
|
||||||
|
height: wayPointController.wayPointHeight,
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
const AppBarPointsPageForRider(),
|
||||||
|
SizedBox(
|
||||||
|
height: 300,
|
||||||
|
child: ReorderableListView(
|
||||||
|
// The children of the list are the text fields
|
||||||
|
children:
|
||||||
|
wayPointController.wayPoints.asMap().entries.map((entry) {
|
||||||
|
final index = entry.key;
|
||||||
|
final wayPoint = entry.value;
|
||||||
|
return Padding(
|
||||||
|
key: ValueKey(index),
|
||||||
|
padding: const EdgeInsets.all(6),
|
||||||
|
child: ListTile(
|
||||||
|
leading: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.deepPurpleAccent,
|
||||||
|
border: Border.all(),
|
||||||
|
shape: BoxShape.rectangle),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(2),
|
||||||
|
child: Text(
|
||||||
|
index.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
title: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
// showAddLocationDialog(context);
|
||||||
|
Get.defaultDialog(
|
||||||
|
content: SizedBox(
|
||||||
|
width: Get.width,
|
||||||
|
height: 400,
|
||||||
|
child: mapPassengerController
|
||||||
|
.placeListResponse[index]),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(),
|
||||||
|
color: AppColor.accentColor.withOpacity(.5)),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
index == 0
|
||||||
|
? Text(
|
||||||
|
'Current Location',
|
||||||
|
style: AppStyle.title,
|
||||||
|
)
|
||||||
|
: Text(
|
||||||
|
'$wayPoint$index',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
const Icon(
|
||||||
|
Icons.reorder,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
trailing: index > 0
|
||||||
|
? IconButton(
|
||||||
|
icon: const Icon(Icons.close),
|
||||||
|
onPressed: () {
|
||||||
|
wayPointController.removeTextField(index);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: IconButton(
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.close,
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
),
|
||||||
|
onPressed: () {},
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
|
||||||
|
// The callback when the user reorders the text fields
|
||||||
|
onReorder: (int oldIndex, int newIndex) {
|
||||||
|
wayPointController.reorderTextFields(oldIndex, newIndex);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
wayPointController.addWayPoints();
|
||||||
|
},
|
||||||
|
child: const Text('Add Text Field'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetBuilder<PointsForRiderController>(
|
||||||
|
// builder: (controller) => Container(
|
||||||
|
// decoration: AppStyle.boxDecoration,
|
||||||
|
// height: Get.height *
|
||||||
|
// .5, // height: controller.heightPointsPageForRider,
|
||||||
|
// width: Get.width,
|
||||||
|
// child: Column(
|
||||||
|
// children: [
|
||||||
|
// SizedBox(
|
||||||
|
// height: 300,
|
||||||
|
// child: ReorderableListView(
|
||||||
|
// onReorder: (oldIndex, newIndex) {
|
||||||
|
// if (oldIndex < newIndex) {
|
||||||
|
// newIndex -= 1;
|
||||||
|
// }
|
||||||
|
// pointsForRiderController.locations.insert(
|
||||||
|
// newIndex,
|
||||||
|
// pointsForRiderController.locations
|
||||||
|
// .removeAt(oldIndex));
|
||||||
|
// },
|
||||||
|
// children: [
|
||||||
|
// for (int i = 0;
|
||||||
|
// i < pointsForRiderController.locations.length;
|
||||||
|
// i++)
|
||||||
|
// ListTile(
|
||||||
|
// key: Key('$i'),
|
||||||
|
// title: DragTarget<int>(
|
||||||
|
// onAccept: (int data) {
|
||||||
|
// pointsForRiderController.locations
|
||||||
|
// .insert(i, 'New Text Field');
|
||||||
|
// },
|
||||||
|
// builder: (context, candidateData, rejectedData) {
|
||||||
|
// return Row(
|
||||||
|
// children: [
|
||||||
|
// SizedBox(
|
||||||
|
// width: 300,
|
||||||
|
// child: TextField(
|
||||||
|
// controller: TextEditingController(
|
||||||
|
// text: pointsForRiderController
|
||||||
|
// .locations[i]),
|
||||||
|
// onChanged: (value) {
|
||||||
|
// pointsForRiderController
|
||||||
|
// .locations[i] = value;
|
||||||
|
// },
|
||||||
|
// decoration: InputDecoration(
|
||||||
|
// prefixIcon: IconButton(
|
||||||
|
// onPressed: () {
|
||||||
|
// pointsForRiderController
|
||||||
|
// .removeLocation(i);
|
||||||
|
// },
|
||||||
|
// icon: const Icon(Icons.delete),
|
||||||
|
// ),
|
||||||
|
// labelText: 'Text Field ${i + 1}',
|
||||||
|
// border: const OutlineInputBorder(),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// IconButton(
|
||||||
|
// onPressed: () {
|
||||||
|
// // pointsForRiderController.onReorder(
|
||||||
|
// // index, newIndex);
|
||||||
|
// },
|
||||||
|
// icon: const Icon(Icons.reorder),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ElevatedButton(
|
||||||
|
// onPressed: () {
|
||||||
|
// pointsForRiderController.addLocation('location');
|
||||||
|
// },
|
||||||
|
// child: const Text('Add Text Field'),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ));
|
||||||
|
}
|
||||||
|
|
||||||
|
void showAddLocationDialog(BuildContext context, int index) {
|
||||||
|
final TextEditingController locationController = TextEditingController();
|
||||||
|
// Get.put(WayPointController());
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return Dialog.fullscreen(
|
||||||
|
// title: const Text('Add Location'),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.close,
|
||||||
|
size: 40,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Add Location'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
const Icon(
|
||||||
|
Icons.clear,
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: Get.width,
|
||||||
|
child: formSearchCaptain(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class AppBarPointsPageForRider extends StatelessWidget {
|
||||||
|
const AppBarPointsPageForRider({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.arrow_back_ios_new_rounded,
|
||||||
|
color: AppColor.primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
const CircleAvatar(
|
||||||
|
backgroundColor: AppColor.primaryColor,
|
||||||
|
maxRadius: 15,
|
||||||
|
child: Icon(
|
||||||
|
Icons.person,
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {},
|
||||||
|
child: Text(
|
||||||
|
"Switch Rider".tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Icon(
|
||||||
|
Icons.clear,
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,7 +45,7 @@ class WaletCaptain extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Total Points is ${captainWalletController.totalPoints.toString()} 💎',
|
'Total Points is ${captainWalletController.totalPoints.toString()} 💎',
|
||||||
style: AppStyle.headtitle2,
|
style: AppStyle.headTitle2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class PassengerProfilePage extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Edit Profile'.tr,
|
'Edit Profile'.tr,
|
||||||
style: AppStyle.headtitle2,
|
style: AppStyle.headTitle2,
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class ProfileCaptain extends StatelessWidget {
|
|||||||
thickness: 2,
|
thickness: 2,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
Text('Car Details'.tr, style: AppStyle.headtitle2),
|
Text('Car Details'.tr, style: AppStyle.headTitle2),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
Text('VIN is :${box.read(BoxName.vin)}',
|
Text('VIN is :${box.read(BoxName.vin)}',
|
||||||
style: AppStyle.title),
|
style: AppStyle.title),
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class PromosPassengerPage extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
'Copy this Promo to use it in your Ride!'.tr,
|
'Copy this Promo to use it in your Ride!'.tr,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppStyle.headtitle2
|
style: AppStyle.headTitle2
|
||||||
.copyWith(color: AppColor.accentColor),
|
.copyWith(color: AppColor.accentColor),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -11,9 +11,10 @@ class TaarifPage extends StatelessWidget {
|
|||||||
return MyScafolld(isleading: true, title: 'Tariffs'.tr, body: [
|
return MyScafolld(isleading: true, title: 'Tariffs'.tr, body: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||||
child: Column(
|
child: ListView(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
// mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
// crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
clipBehavior: Clip.hardEdge,
|
||||||
children: [
|
children: [
|
||||||
Table(
|
Table(
|
||||||
defaultVerticalAlignment: TableCellVerticalAlignment.middle,
|
defaultVerticalAlignment: TableCellVerticalAlignment.middle,
|
||||||
@@ -24,45 +25,45 @@ class TaarifPage extends StatelessWidget {
|
|||||||
// decoration: AppStyle.boxDecoration,
|
// decoration: AppStyle.boxDecoration,
|
||||||
children: [
|
children: [
|
||||||
Text('Minimum fare'.tr, style: AppStyle.title),
|
Text('Minimum fare'.tr, style: AppStyle.title),
|
||||||
Text('1 USD', style: AppStyle.title),
|
Text('1 \$', style: AppStyle.title),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
TableRow(
|
TableRow(
|
||||||
children: [
|
children: [
|
||||||
Text('Maximum fare'.tr, style: AppStyle.title),
|
Text('Maximum fare'.tr, style: AppStyle.title),
|
||||||
Text('200 USD', style: AppStyle.title),
|
Text('200 \$', style: AppStyle.title),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
TableRow(
|
TableRow(
|
||||||
children: [
|
children: [
|
||||||
Text('Flag-down fee'.tr, style: AppStyle.title),
|
Text('Flag-down fee'.tr, style: AppStyle.title),
|
||||||
Text('0.47 USD', style: AppStyle.title),
|
Text('0.47 \$', style: AppStyle.title),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
TableRow(
|
TableRow(
|
||||||
children: [
|
children: [
|
||||||
Text('0.05 USD/min and 0.21 USD/km', style: AppStyle.title),
|
Text('0.05 \$/min and 0.21 \$/km', style: AppStyle.title),
|
||||||
Text('Including Tax', style: AppStyle.title),
|
Text('Including Tax', style: AppStyle.title),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text('BookingFee'.tr, style: AppStyle.headtitle2),
|
Text('BookingFee'.tr, style: AppStyle.headTitle2),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text('4.17%', style: AppStyle.title),
|
Text('4.17%', style: AppStyle.title),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text('Morning', style: AppStyle.headtitle2),
|
Text('Morning', style: AppStyle.headTitle2),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text('from 07:30 till 10:30 (Thursday, Friday, Saturday, Monday)',
|
Text('from 07:30 till 10:30 (Thursday, Friday, Saturday, Monday)',
|
||||||
style: AppStyle.title),
|
style: AppStyle.title),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text('Evening', style: AppStyle.headtitle2),
|
Text('Evening', style: AppStyle.headTitle2),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text('from 12:00 till 15:00 (Thursday, Friday, Saturday, Monday)',
|
Text('from 12:00 till 15:00 (Thursday, Friday, Saturday, Monday)',
|
||||||
style: AppStyle.title),
|
style: AppStyle.title),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text('Night', style: AppStyle.headtitle2),
|
Text('Night', style: AppStyle.headTitle2),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text('from 23:59 till 05:30', style: AppStyle.title),
|
Text('from 23:59 till 05:30', style: AppStyle.title),
|
||||||
],
|
],
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 370 B After Width: | Height: | Size: 292 B |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 630 B After Width: | Height: | Size: 695 B |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -1878,5 +1878,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.2"
|
version: "3.1.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.2.0-194.0.dev <4.0.0"
|
dart: ">=3.2.0 <4.0.0"
|
||||||
flutter: ">=3.13.0"
|
flutter: ">=3.16.0"
|
||||||
|
|||||||
BIN
web/favicon.png
|
Before Width: | Height: | Size: 370 B After Width: | Height: | Size: 292 B |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 967 B After Width: | Height: | Size: 1.0 KiB |