2/4/1
This commit is contained in:
@@ -2,10 +2,9 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/firebase/firbase_messge.dart';
|
||||
import 'package:ride/controller/home/map_passenger_controller.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/home/map_widget.dart/form_search_places.dart';
|
||||
import 'package:ride/views/home/map_widget.dart/form_search_places_destenation.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
@@ -69,18 +68,53 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
controller.newMyLocation =
|
||||
controller
|
||||
.newStartPointLocation;
|
||||
controller.hintTextStartPoint =
|
||||
'${controller.newStartPointLocation.latitude.toStringAsFixed(4)} , ${controller.newStartPointLocation.longitude.toStringAsFixed(4)}';
|
||||
controller.startLocationFromMap =
|
||||
false;
|
||||
controller.isPickerShown = false;
|
||||
// print(controller.myLocation);
|
||||
// print(controller
|
||||
// .newStartPointLocation);
|
||||
} else {
|
||||
} else if (controller
|
||||
.workLocationFromMap ==
|
||||
true) {
|
||||
controller
|
||||
.hintTextDestinationPoint =
|
||||
'To Work'.tr;
|
||||
box.write(BoxName.addWork,
|
||||
'${controller.newMyLocation.latitude.toStringAsFixed(4)} , ${controller.newMyLocation.longitude.toStringAsFixed(4)}');
|
||||
controller.newMyLocation =
|
||||
controller.newMyLocation;
|
||||
controller.isPickerShown = false;
|
||||
controller.workLocationFromMap =
|
||||
false;
|
||||
Toast.show(
|
||||
context,
|
||||
'Work Saved'.tr,
|
||||
AppColor.greenColor);
|
||||
} else if (controller
|
||||
.homeLocationFromMap ==
|
||||
true) {
|
||||
controller
|
||||
.hintTextDestinationPoint =
|
||||
'To Home'.tr;
|
||||
box.write(BoxName.addHome,
|
||||
'${controller.newMyLocation.latitude.toStringAsFixed(4)} , ${controller.newMyLocation.longitude.toStringAsFixed(4)}');
|
||||
controller.newMyLocation =
|
||||
controller.newMyLocation;
|
||||
controller.isPickerShown = false;
|
||||
controller.homeLocationFromMap =
|
||||
false;
|
||||
controller.update();
|
||||
Toast.show(
|
||||
context,
|
||||
'Home Saved'.tr,
|
||||
AppColor.greenColor);
|
||||
} else {
|
||||
controller
|
||||
.hintTextDestinationPoint =
|
||||
'${controller.newMyLocation.latitude.toStringAsFixed(4)} , ${controller.newMyLocation.longitude.toStringAsFixed(4)}';
|
||||
controller.newMyLocation =
|
||||
controller.newMyLocation;
|
||||
controller.isPickerShown = false;
|
||||
// print(controller.myLocation);
|
||||
// print(controller.newMyLocation);
|
||||
}
|
||||
|
||||
controller.placesDestination = [];
|
||||
@@ -121,94 +155,96 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
)
|
||||
: Column(
|
||||
: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30,
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeMainBottomMenuMap();
|
||||
},
|
||||
icon: controller
|
||||
.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons
|
||||
.arrow_circle_up_rounded,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
Icons
|
||||
.arrow_circle_down_rounded,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
],
|
||||
)),
|
||||
Row(
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeMainBottomMenuMap();
|
||||
},
|
||||
icon:
|
||||
controller.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons
|
||||
.arrow_circle_up_rounded,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
Icons
|
||||
.arrow_circle_down_rounded,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
controller.noCarString == false
|
||||
? Text(
|
||||
'Nearest Car for you about '
|
||||
.tr)
|
||||
: Container(
|
||||
decoration:
|
||||
BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(12),
|
||||
color:
|
||||
AppColor.redColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(6),
|
||||
child: Text(
|
||||
'No Car in your site. Sorry!'
|
||||
.tr,
|
||||
style: AppStyle
|
||||
.title
|
||||
.copyWith(
|
||||
color: AppColor
|
||||
.secondaryColor),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
child: Text(
|
||||
'${'Where to'.tr} ${box.read(BoxName.name)}')),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
controller.noCarString ==
|
||||
false
|
||||
? Text(
|
||||
'Nearest Car for you about '
|
||||
.tr)
|
||||
: Container(
|
||||
decoration:
|
||||
BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
12),
|
||||
color: AppColor
|
||||
.redColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(6),
|
||||
child: Text(
|
||||
'No Car in your site. Sorry!'
|
||||
.tr,
|
||||
style: AppStyle
|
||||
.title
|
||||
.copyWith(
|
||||
color: AppColor
|
||||
.secondaryColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.noCarString == false
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor
|
||||
.redColor,
|
||||
width: 3)),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(4),
|
||||
child: Text((controller
|
||||
.nearestCar !=
|
||||
null
|
||||
? controller
|
||||
.durationByPassenger
|
||||
.toString()
|
||||
: 'N/A')),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
controller.noCarString ==
|
||||
false
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor
|
||||
.redColor,
|
||||
width: 3)),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(4),
|
||||
child: Text((controller
|
||||
.nearestCar !=
|
||||
null
|
||||
? controller
|
||||
.durationByPassenger
|
||||
.toString()
|
||||
: 'N/A')),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -236,12 +272,12 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
controller.currentLocationToFormPlaces
|
||||
? const SizedBox()
|
||||
: formSearchPlacesStart(),
|
||||
formSearchPlaces(),
|
||||
formSearchPlacesDestenation(),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
height: 10,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Get Direction of Trip'.tr,
|
||||
title: 'Get Details of Trip'.tr,
|
||||
onPressed: () async {
|
||||
controller.changeMainBottomMenuMap();
|
||||
|
||||
@@ -269,20 +305,6 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
// IconButton(
|
||||
// onPressed: () {
|
||||
// FirebaseMessagesController()
|
||||
// .sendNotificationToAnyWithoutData(
|
||||
// 'title',
|
||||
// 'body',
|
||||
// // 'e5IXztYGS1W9zFvv-gmMRL:APA91bF7-fFzksCRXIk0Fm7IfQuhHL0df-vnDW8DNNKa3sWea649j3Obc8PhyJo9UOxKBtrvoJxYcbjclFKpvycAuhG0lv_e4hkavy-LZ6SsAu5J5bYrPz6-0BbyLdLUHoBuOFlNMvmN');
|
||||
// 'eoV61-RSFUxLrCa88xaSG2:APA91bFmgGVTVH0mhjGhFqrB2_rMf0l0udBUzEUW-V2XlxtnYeDTnpESYRRCI_tMQnbDqQ3PK7pFMzW0-CZolS-pURSkwbwvnbVtV9VHB2UuOrKG3MYpGFsWfmjUdyRIOe30nx-eVkOu');
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// Icons.add,
|
||||
// color: AppColor.blueColor,
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
)
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user