diff --git a/android/app/build.gradle b/android/app/build.gradle index 4b95c84..f1fe944 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -32,7 +32,7 @@ def keystorePropertiesFile = rootProject.file('key.properties') android { namespace "com.mobileapp.store.ride" - compileSdkVersion flutter.compileSdkVersion + compileSdkVersion 34 ndkVersion flutter.ndkVersion compileOptions { diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 386055a..0000000 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-hdpi/launcher_icon.png b/android/app/src/main/res/mipmap-hdpi/launcher_icon.png new file mode 100644 index 0000000..fd9bd39 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 1ab0c75..0000000 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-mdpi/launcher_icon.png b/android/app/src/main/res/mipmap-mdpi/launcher_icon.png new file mode 100644 index 0000000..5e604ac Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index b43445b..0000000 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png new file mode 100644 index 0000000..e129f04 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index e692ac8..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png new file mode 100644 index 0000000..339756c Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 5844738..0000000 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png new file mode 100644 index 0000000..fec760e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png differ diff --git a/assets/images/logo.png b/assets/images/logo.png index fbbd26f..3e0026b 100644 Binary files a/assets/images/logo.png and b/assets/images/logo.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..7c46123 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..8a158b1 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..a3c6d38 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..6c411d5 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..a7cbbbc Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..895df18 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..9c32eff Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..a3c6d38 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..4a9dc83 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..dc0244c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png new file mode 100644 index 0000000..9e8ee71 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png new file mode 100644 index 0000000..323679f Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png new file mode 100644 index 0000000..c7f0be7 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png new file mode 100644 index 0000000..cbf74c6 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..dc0244c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..f2ba0db Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png new file mode 100644 index 0000000..fd9bd39 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png new file mode 100644 index 0000000..339756c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..4fbdd93 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..e778f7c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..43fd07c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 579f19b..b333758 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -37,19 +37,11 @@ CFBundlePackageType APPL CFBundleShortVersionString -<<<<<<< HEAD 12 CFBundleSignature ???? CFBundleVersion 1.32 -======= - 11 - CFBundleSignature - ???? - CFBundleVersion - 1.31 ->>>>>>> origin/main LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/lib/constant/style.dart b/lib/constant/style.dart index 5b9a136..b37c5aa 100644 --- a/lib/constant/style.dart +++ b/lib/constant/style.dart @@ -8,7 +8,7 @@ class AppStyle { fontSize: 40, color: AppColor.accentColor, fontFamily: GoogleFonts.josefinSans().fontFamily); - static TextStyle headtitle2 = TextStyle( + static TextStyle headTitle2 = TextStyle( fontWeight: FontWeight.bold, fontSize: 26, color: AppColor.primaryColor, diff --git a/lib/controller/functions/location_controller.dart b/lib/controller/functions/location_controller.dart index df57ebd..b15a7f5 100644 --- a/lib/controller/functions/location_controller.dart +++ b/lib/controller/functions/location_controller.dart @@ -6,7 +6,6 @@ import 'package:location/location.dart'; import 'package:ride/constant/box_name.dart'; import 'package:ride/constant/links.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/main.dart'; @@ -26,6 +25,7 @@ class LocationController extends GetxController { super.onInit(); location = Location(); totalPoints = Get.find().totalPoints; + getLocation(); } void startLocationUpdates() async { diff --git a/lib/controller/home/map_passenger_controller.dart b/lib/controller/home/map_passenger_controller.dart index c642272..3bdd739 100644 --- a/lib/controller/home/map_passenger_controller.dart +++ b/lib/controller/home/map_passenger_controller.dart @@ -9,6 +9,7 @@ import 'package:location/location.dart'; import 'package:ride/constant/colors.dart'; import 'package:ride/constant/style.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/box_name.dart'; import '../../constant/info.dart'; @@ -27,18 +28,43 @@ class MapPassengerController extends GetxController { bool isLoading = true; TextEditingController placeDestinationController = TextEditingController(); TextEditingController placeStartController = TextEditingController(); + TextEditingController wayPoint0Controller = TextEditingController(); + TextEditingController wayPoint1Controller = TextEditingController(); + TextEditingController wayPoint2Controller = TextEditingController(); + TextEditingController wayPoint3Controller = TextEditingController(); + TextEditingController wayPoint4Controller = TextEditingController(); TextEditingController sosPhonePassengerProfile = TextEditingController(); final sosFormKey = GlobalKey(); List data = []; List bounds = []; List placesStart = []; + List allTextEditingPlaces = []; List placesDestination = []; + List wayPoint0 = []; + List wayPoint1 = []; + List wayPoint2 = []; + List wayPoint3 = []; + List wayPoint4 = []; + + List> placeListResponseAll = []; + + List placeListResponse = [ + formSearchPlaces1(), + formSearchPlaces2(), + formSearchPlaces3(), + formSearchPlaces4(), + ]; LatLngBounds? boundsdata; List markers = []; List polyLines = []; late LatLng myLocation; late LatLng newMyLocation = 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); final List polylineCoordinates = []; List carsLocationByPassenger = []; @@ -53,10 +79,17 @@ class MapPassengerController extends GetxController { double heightMenu = 0; double widthMenu = 0; double heightPickerContainer = 90; + double heightPointsPageForRider = 0; double mainBottomMenuMap = Get.height * .2; bool startLocationFromMap = false; + bool startLocationFromMap0 = false; + bool startLocationFromMap1 = false; + bool startLocationFromMap2 = false; + bool startLocationFromMap3 = false; + bool startLocationFromMap4 = false; bool heightMenuBool = false; bool isPickerShown = false; + bool isPointsPageForRider = false; bool isBottomSheetShown = false; bool mapType = false; bool mapTrafficON = false; @@ -93,6 +126,11 @@ class MapPassengerController extends GetxController { int remainingTimeTimerRideBegin = 60; String stringRemainingTimeRideBegin = ''; 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 hintTextDestinationPoint = 'Search for your destination'.tr; late String rideId; @@ -100,6 +138,11 @@ class MapPassengerController extends GetxController { bool isCashSelectedBeforeConfirmRide = false; bool isPassengerChosen = false; bool currentLocationToFormPlaces = false; + bool currentLocationToFormPlaces0 = false; + bool currentLocationToFormPlaces1 = false; + bool currentLocationToFormPlaces2 = false; + bool currentLocationToFormPlaces3 = false; + bool currentLocationToFormPlaces4 = false; late String driverToken; int carsOrder = 0; 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) { if (placesDestination.isEmpty) { hintTextDestinationPoint = 'Search for your destination'.tr; @@ -330,6 +438,36 @@ class MapPassengerController extends GetxController { 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; String? cancelNote; void selectReason(int index, String note) { @@ -684,6 +822,12 @@ class MapPassengerController extends GetxController { update(); } + void changeHeightPointsPageForRider() { + isPointsPageForRider = !isPointsPageForRider; + heightPointsPageForRider = isPointsPageForRider == true ? Get.height : 0; + update(); + } + void changeMainBottomMenuMap() { isMainBottomMenuMap = !isMainBottomMenuMap; mainBottomMenuMap = @@ -712,6 +856,51 @@ class MapPassengerController extends GetxController { 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() { height = 0; @@ -742,6 +931,61 @@ class MapPassengerController extends GetxController { 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) { List parts = location.split(','); double lat = double.parse(parts[0]); @@ -1241,6 +1485,25 @@ class MapPassengerController extends GetxController { addCustomTripIcon(); startMarkerReloading(); 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(); } } diff --git a/lib/controller/home/points_for_rider_controller.dart b/lib/controller/home/points_for_rider_controller.dart new file mode 100644 index 0000000..84e672b --- /dev/null +++ b/lib/controller/home/points_for_rider_controller.dart @@ -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 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 wayPoints = []; + List> 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 = []; + final hintTextPointList = []; + 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 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().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), + ), + ], + ); + }); + } +} diff --git a/lib/splash_screen_page.dart b/lib/splash_screen_page.dart index 91460d9..4f55ad4 100644 --- a/lib/splash_screen_page.dart +++ b/lib/splash_screen_page.dart @@ -42,7 +42,7 @@ class SplashScreen extends StatelessWidget { TypewriterAnimatedText( 'Welcome to ${AppInformation.appName}', textStyle: - AppStyle.headTitle.copyWith(color: AppColor.greenColor), + AppStyle.headTitle2.copyWith(color: AppColor.greenColor), speed: const Duration(milliseconds: 200), ), ], isRepeatingAnimation: true), diff --git a/lib/views/auth/captin/car_license_page.dart b/lib/views/auth/captin/car_license_page.dart index 480cf08..c3b6619 100644 --- a/lib/views/auth/captin/car_license_page.dart +++ b/lib/views/auth/captin/car_license_page.dart @@ -83,7 +83,7 @@ Widget buildImageWithBoundingBoxes() { ? Center( child: Text( 'No image selected yet'.tr, - style: AppStyle.headtitle2, + style: AppStyle.headTitle2, )) : Column( children: [ diff --git a/lib/views/auth/captin/login_captin.dart b/lib/views/auth/captin/login_captin.dart index 7ed65c8..83c841a 100644 --- a/lib/views/auth/captin/login_captin.dart +++ b/lib/views/auth/captin/login_captin.dart @@ -181,7 +181,7 @@ class LoginCaptin extends StatelessWidget { animatedTexts: [ TypewriterAnimatedText( 'Register Captin'.tr, - textStyle: AppStyle.headtitle2, + textStyle: AppStyle.headTitle2, speed: const Duration(milliseconds: 200), ), ], @@ -271,7 +271,7 @@ class LoginCaptin extends StatelessWidget { width: Get.width * .7, child: Text( 'Accept Ride\'s Terms & Review Privacy Notice'.tr, - style: AppStyle.headtitle2, + style: AppStyle.headTitle2, ), ), ], diff --git a/lib/views/auth/login_page.dart b/lib/views/auth/login_page.dart index c8cb376..3af6294 100644 --- a/lib/views/auth/login_page.dart +++ b/lib/views/auth/login_page.dart @@ -223,7 +223,7 @@ class LoginPage extends StatelessWidget { animatedTexts: [ TypewriterAnimatedText( 'Register'.tr, - textStyle: AppStyle.headtitle2, + textStyle: AppStyle.headTitle2, speed: const Duration(milliseconds: 200), ), ], @@ -236,7 +236,7 @@ class LoginPage extends StatelessWidget { onTap: () => Get.to(LoginCaptin()), child: Text( '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, child: Text( 'Accept Ride\'s Terms & Review Privacy Notice'.tr, - style: AppStyle.headtitle2, + style: AppStyle.headTitle2, ), ), ], diff --git a/lib/views/home/Captin/orderCaptin/order_request_page.dart b/lib/views/home/Captin/orderCaptin/order_request_page.dart index 79dfcab..ccd4dc8 100644 --- a/lib/views/home/Captin/orderCaptin/order_request_page.dart +++ b/lib/views/home/Captin/orderCaptin/order_request_page.dart @@ -64,7 +64,7 @@ class OrderRequestPage extends StatelessWidget { text: 'Passenger Name is '.tr, style: AppStyle.title, children: [ - TextSpan(text: myList[8], style: AppStyle.headtitle2), + TextSpan(text: myList[8], style: AppStyle.headTitle2), ], ), ), @@ -78,7 +78,7 @@ class OrderRequestPage extends StatelessWidget { children: [ TextSpan( text: double.parse(myList[2]).toStringAsFixed(2), - style: AppStyle.headtitle2), + style: AppStyle.headTitle2), ], ), ), @@ -92,7 +92,7 @@ class OrderRequestPage extends StatelessWidget { children: [ TextSpan( text: myList[11].toString(), - style: AppStyle.headtitle2), + style: AppStyle.headTitle2), ], ), ), @@ -106,7 +106,7 @@ class OrderRequestPage extends StatelessWidget { children: [ TextSpan( text: myList[12].toString(), - style: AppStyle.headtitle2), + style: AppStyle.headTitle2), ], ), ), @@ -134,7 +134,7 @@ class OrderRequestPage extends StatelessWidget { children: [ TextSpan( text: myList[5].toString(), - style: AppStyle.headtitle2), + style: AppStyle.headTitle2), TextSpan(text: ' KM'.tr, style: AppStyle.title), ]), ), @@ -148,7 +148,7 @@ class OrderRequestPage extends StatelessWidget { children: [ TextSpan( text: myList[4].toString(), - style: AppStyle.headtitle2), + style: AppStyle.headTitle2), TextSpan(text: ' Minutes'.tr, style: AppStyle.title), ]), ), diff --git a/lib/views/home/Captin/settings_captain.dart b/lib/views/home/Captin/settings_captain.dart index c5ad4b9..9e548e3 100644 --- a/lib/views/home/Captin/settings_captain.dart +++ b/lib/views/home/Captin/settings_captain.dart @@ -18,7 +18,7 @@ class SettingsCaptain extends StatelessWidget { leading: const Icon(Icons.language), title: Text( 'Language', - style: AppStyle.headtitle2, + style: AppStyle.headTitle2, ), onTap: () => Get.to(const Language()), ), diff --git a/lib/views/home/map_page_passenger.dart b/lib/views/home/map_page_passenger.dart index 16eaf26..fe4f4c9 100644 --- a/lib/views/home/map_page_passenger.dart +++ b/lib/views/home/map_page_passenger.dart @@ -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/menu_map_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_to_passenger_from_driver.dart'; @@ -46,6 +47,7 @@ class MapPagePassenger extends StatelessWidget { const TimerToPassengerFromDriver(), const RideBeginPassenger(), cancelRidePage(), + PointsPageForRider() ], ), ), diff --git a/lib/views/home/map_widget.dart/form_search_places.dart b/lib/views/home/map_widget.dart/form_search_places.dart index 3b00d9c..17e0e62 100644 --- a/lib/views/home/map_widget.dart/form_search_places.dart +++ b/lib/views/home/map_widget.dart/form_search_places.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:ride/constant/table_names.dart'; -import 'package:ride/views/widgets/elevated_btn.dart'; import '../../../constant/colors.dart'; import '../../../constant/style.dart'; diff --git a/lib/views/home/map_widget.dart/form_serch_multiy_point.dart b/lib/views/home/map_widget.dart/form_serch_multiy_point.dart new file mode 100644 index 0000000..30d4b3d --- /dev/null +++ b/lib/views/home/map_widget.dart/form_serch_multiy_point.dart @@ -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 formSearchPlaces0() { + // DbSql sql = DbSql.instance; + return GetBuilder( + 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 formSearchPlaces1() { + // DbSql sql = DbSql.instance; + return GetBuilder( + 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 formSearchPlaces2() { + // DbSql sql = DbSql.instance; + return GetBuilder( + 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 formSearchPlaces3() { + // DbSql sql = DbSql.instance; + return GetBuilder( + 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 formSearchPlaces4() { + // DbSql sql = DbSql.instance; + return GetBuilder( + 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, + ) + ], + ), + ), + ); + }, + ), + ) + ], + )); +} diff --git a/lib/views/home/map_widget.dart/points_page_for_rider.dart b/lib/views/home/map_widget.dart/points_page_for_rider.dart new file mode 100644 index 0000000..bb66b0e --- /dev/null +++ b/lib/views/home/map_widget.dart/points_page_for_rider.dart @@ -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(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( + // 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( + // 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, + ) + ], + ); + } +} diff --git a/lib/views/home/my_wallet/walet_captain.dart b/lib/views/home/my_wallet/walet_captain.dart index a17256b..192851f 100644 --- a/lib/views/home/my_wallet/walet_captain.dart +++ b/lib/views/home/my_wallet/walet_captain.dart @@ -45,7 +45,7 @@ class WaletCaptain extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 4), child: Text( 'Total Points is ${captainWalletController.totalPoints.toString()} 💎', - style: AppStyle.headtitle2, + style: AppStyle.headTitle2, ), ), ), diff --git a/lib/views/home/profile/passenger_profile_page.dart b/lib/views/home/profile/passenger_profile_page.dart index 5c5cc67..427b1d7 100644 --- a/lib/views/home/profile/passenger_profile_page.dart +++ b/lib/views/home/profile/passenger_profile_page.dart @@ -36,7 +36,7 @@ class PassengerProfilePage extends StatelessWidget { children: [ Text( 'Edit Profile'.tr, - style: AppStyle.headtitle2, + style: AppStyle.headTitle2, ), ListTile( title: Text( diff --git a/lib/views/home/profile/profile_captain.dart b/lib/views/home/profile/profile_captain.dart index ce1571f..0cd7f3c 100644 --- a/lib/views/home/profile/profile_captain.dart +++ b/lib/views/home/profile/profile_captain.dart @@ -61,7 +61,7 @@ class ProfileCaptain extends StatelessWidget { thickness: 2, ), const SizedBox(height: 8.0), - Text('Car Details'.tr, style: AppStyle.headtitle2), + Text('Car Details'.tr, style: AppStyle.headTitle2), const SizedBox(height: 8.0), Text('VIN is :${box.read(BoxName.vin)}', style: AppStyle.title), diff --git a/lib/views/home/profile/promos_passenger_page.dart b/lib/views/home/profile/promos_passenger_page.dart index f6e48f7..ca94f84 100644 --- a/lib/views/home/profile/promos_passenger_page.dart +++ b/lib/views/home/profile/promos_passenger_page.dart @@ -97,7 +97,7 @@ class PromosPassengerPage extends StatelessWidget { Text( 'Copy this Promo to use it in your Ride!'.tr, textAlign: TextAlign.center, - style: AppStyle.headtitle2 + style: AppStyle.headTitle2 .copyWith(color: AppColor.accentColor), ) ], diff --git a/lib/views/home/profile/taarif_page.dart b/lib/views/home/profile/taarif_page.dart index d246aea..584b40c 100644 --- a/lib/views/home/profile/taarif_page.dart +++ b/lib/views/home/profile/taarif_page.dart @@ -11,9 +11,10 @@ class TaarifPage extends StatelessWidget { return MyScafolld(isleading: true, title: 'Tariffs'.tr, body: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 4), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.stretch, + child: ListView( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.stretch, + clipBehavior: Clip.hardEdge, children: [ Table( defaultVerticalAlignment: TableCellVerticalAlignment.middle, @@ -24,45 +25,45 @@ class TaarifPage extends StatelessWidget { // decoration: AppStyle.boxDecoration, children: [ Text('Minimum fare'.tr, style: AppStyle.title), - Text('1 USD', style: AppStyle.title), + Text('1 \$', style: AppStyle.title), ], ), TableRow( children: [ Text('Maximum fare'.tr, style: AppStyle.title), - Text('200 USD', style: AppStyle.title), + Text('200 \$', style: AppStyle.title), ], ), TableRow( children: [ Text('Flag-down fee'.tr, style: AppStyle.title), - Text('0.47 USD', style: AppStyle.title), + Text('0.47 \$', style: AppStyle.title), ], ), TableRow( 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), ], ), ], ), const SizedBox(height: 10), - Text('BookingFee'.tr, style: AppStyle.headtitle2), + Text('BookingFee'.tr, style: AppStyle.headTitle2), const SizedBox(height: 10), Text('4.17%', style: AppStyle.title), const SizedBox(height: 20), - Text('Morning', style: AppStyle.headtitle2), + Text('Morning', style: AppStyle.headTitle2), const SizedBox(height: 10), Text('from 07:30 till 10:30 (Thursday, Friday, Saturday, Monday)', style: AppStyle.title), const SizedBox(height: 20), - Text('Evening', style: AppStyle.headtitle2), + Text('Evening', style: AppStyle.headTitle2), const SizedBox(height: 10), Text('from 12:00 till 15:00 (Thursday, Friday, Saturday, Monday)', style: AppStyle.title), const SizedBox(height: 20), - Text('Night', style: AppStyle.headtitle2), + Text('Night', style: AppStyle.headTitle2), const SizedBox(height: 10), Text('from 23:59 till 05:30', style: AppStyle.title), ], diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png index 0c1180b..7c46123 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png index de571ad..f3071c6 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png index de5f9ea..e2add38 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png index fe5c00d..38858e5 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png index d132c2e..16e881b 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png index 48024c9..2743bb8 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png index b3eb23a..913776c 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/pubspec.lock b/pubspec.lock index 39ba5fe..798efda 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1878,5 +1878,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" - flutter: ">=3.13.0" + dart: ">=3.2.0 <4.0.0" + flutter: ">=3.16.0" diff --git a/web/favicon.png b/web/favicon.png index de5f9ea..e2add38 100644 Binary files a/web/favicon.png and b/web/favicon.png differ diff --git a/web/icons/Icon-192.png b/web/icons/Icon-192.png index 72abca2..fec760e 100644 Binary files a/web/icons/Icon-192.png and b/web/icons/Icon-192.png differ diff --git a/web/icons/Icon-512.png b/web/icons/Icon-512.png index 48024c9..2743bb8 100644 Binary files a/web/icons/Icon-512.png and b/web/icons/Icon-512.png differ diff --git a/web/icons/Icon-maskable-192.png b/web/icons/Icon-maskable-192.png index 72abca2..fec760e 100644 Binary files a/web/icons/Icon-maskable-192.png and b/web/icons/Icon-maskable-192.png differ diff --git a/web/icons/Icon-maskable-512.png b/web/icons/Icon-maskable-512.png index 48024c9..2743bb8 100644 Binary files a/web/icons/Icon-maskable-512.png and b/web/icons/Icon-maskable-512.png differ diff --git a/windows/runner/resources/app_icon.ico b/windows/runner/resources/app_icon.ico index 9e50b4f..4cca494 100644 Binary files a/windows/runner/resources/app_icon.ico and b/windows/runner/resources/app_icon.ico differ