12/31/1
This commit is contained in:
@@ -9,7 +9,6 @@ import '../../../controller/admin/captain_admin_controller.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import '../../widgets/my_textField.dart';
|
||||
import '../../widgets/mycircular.dart';
|
||||
import '../passenger/form_passenger.dart';
|
||||
import 'form_captain.dart';
|
||||
|
||||
class Captain extends StatelessWidget {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
import 'package:ride/views/widgets/mycircular.dart';
|
||||
import 'package:syncfusion_flutter_charts/charts.dart';
|
||||
|
||||
import '../../../controller/admin/ride_admin_controller.dart';
|
||||
|
||||
@@ -19,136 +19,136 @@ class Rides extends StatelessWidget {
|
||||
? const Center(child: MyCircularProgressIndicator())
|
||||
: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: Get.height * .4,
|
||||
child: LineChart(
|
||||
duration: const Duration(milliseconds: 150),
|
||||
curve: Curves.ease,
|
||||
LineChartData(
|
||||
lineBarsData: [
|
||||
LineChartBarData(
|
||||
spots: rideAdminController.chartData,
|
||||
isCurved: true,
|
||||
color: Colors.deepPurpleAccent, // Custom color
|
||||
barWidth: 3, // Thinner line
|
||||
dotData: const FlDotData(
|
||||
show: true), // Show dots on each point
|
||||
belowBarData: BarAreaData(
|
||||
// Add gradient fill below the line
|
||||
show: true,
|
||||
color: AppColor.deepPurpleAccent,
|
||||
),
|
||||
isStrokeJoinRound: true,
|
||||
shadow: const BoxShadow(
|
||||
color: AppColor.yellowColor,
|
||||
blurRadius: 4,
|
||||
offset: Offset(2, 2),
|
||||
),
|
||||
),
|
||||
],
|
||||
showingTooltipIndicators: const [],
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
topTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Days',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30, showTitles: true)),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Total Trips on month'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30, showTitles: true)),
|
||||
leftTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Counts of Trips on month'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30, showTitles: true)),
|
||||
),
|
||||
gridData: const FlGridData(
|
||||
show: true,
|
||||
),
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: const Border(
|
||||
bottom: BorderSide(color: AppColor.accentColor),
|
||||
left: BorderSide(color: AppColor.accentColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// SizedBox(
|
||||
// height: Get.height * .4,
|
||||
// child: LineChart(
|
||||
// duration: const Duration(milliseconds: 150),
|
||||
// curve: Curves.ease,
|
||||
// LineChartData(
|
||||
// lineBarsData: [
|
||||
// LineChartBarData(
|
||||
// spots: rideAdminController.chartData,
|
||||
// isCurved: true,
|
||||
// color: Colors.deepPurpleAccent, // Custom color
|
||||
// barWidth: 3, // Thinner line
|
||||
// dotData: const FlDotData(
|
||||
// show: true), // Show dots on each point
|
||||
// belowBarData: BarAreaData(
|
||||
// // Add gradient fill below the line
|
||||
// show: true,
|
||||
// color: AppColor.deepPurpleAccent,
|
||||
// child: PieChart(
|
||||
// PieChartData(
|
||||
// sectionsSpace: 4, // Adjust spacing between sections
|
||||
// centerSpaceRadius:
|
||||
// 40, // Adjust radius of center space
|
||||
// sections: [
|
||||
// for (final rideData in rideAdminController.rideData)
|
||||
// PieChartSectionData(
|
||||
// value: rideData.ridesCount.toDouble(),
|
||||
// title: '${rideData.day}', showTitle: true,
|
||||
// titleStyle:
|
||||
// AppStyle.subtitle, // Display day as title
|
||||
// radius: 60, // Adjust radius of each section
|
||||
// color:
|
||||
// AppColor.deepPurpleAccent, // Custom color
|
||||
// ),
|
||||
// isStrokeJoinRound: true,
|
||||
// shadow: const BoxShadow(
|
||||
// color: AppColor.yellowColor,
|
||||
// blurRadius: 4,
|
||||
// offset: Offset(2, 2),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// showingTooltipIndicators: const [],
|
||||
// titlesData: FlTitlesData(
|
||||
// show: true,
|
||||
// topTitles: AxisTitles(
|
||||
// axisNameWidget: Text(
|
||||
// 'Days',
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// axisNameSize: 30,
|
||||
// sideTitles: const SideTitles(
|
||||
// reservedSize: 30, showTitles: true)),
|
||||
// bottomTitles: AxisTitles(
|
||||
// axisNameWidget: Text(
|
||||
// 'Total Trips on month'.tr,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// axisNameSize: 30,
|
||||
// sideTitles: const SideTitles(
|
||||
// reservedSize: 30, showTitles: true)),
|
||||
// leftTitles: AxisTitles(
|
||||
// axisNameWidget: Text(
|
||||
// 'Counts of Trips on month'.tr,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// axisNameSize: 30,
|
||||
// sideTitles: const SideTitles(
|
||||
// reservedSize: 30, showTitles: true)),
|
||||
// ),
|
||||
// gridData: const FlGridData(
|
||||
// show: true,
|
||||
// ),
|
||||
// borderData: FlBorderData(
|
||||
// show: true,
|
||||
// border: const Border(
|
||||
// bottom: BorderSide(color: AppColor.accentColor),
|
||||
// left: BorderSide(color: AppColor.accentColor),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// // SizedBox(
|
||||
// // height: Get.height * .4,
|
||||
// // child: PieChart(
|
||||
// // PieChartData(
|
||||
// // sectionsSpace: 4, // Adjust spacing between sections
|
||||
// // centerSpaceRadius:
|
||||
// // 40, // Adjust radius of center space
|
||||
// // sections: [
|
||||
// // for (final rideData in rideAdminController.rideData)
|
||||
// // PieChartSectionData(
|
||||
// // value: rideData.ridesCount.toDouble(),
|
||||
// // title: '${rideData.day}', showTitle: true,
|
||||
// // titleStyle:
|
||||
// // AppStyle.subtitle, // Display day as title
|
||||
// // radius: 60, // Adjust radius of each section
|
||||
// // color:
|
||||
// // AppColor.deepPurpleAccent, // Custom color
|
||||
// // ),
|
||||
// // ],
|
||||
// // ),
|
||||
// // ),
|
||||
// // ),
|
||||
|
||||
SizedBox(
|
||||
// height: 400,
|
||||
child: SfCartesianChart(
|
||||
legend: const Legend(
|
||||
isVisible: true,
|
||||
position: LegendPosition.bottom,
|
||||
overflowMode: LegendItemOverflowMode.wrap,
|
||||
textStyle: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
borderWidth: 2,
|
||||
borderColor: AppColor.blueColor,
|
||||
plotAreaBorderColor: AppColor.deepPurpleAccent,
|
||||
enableAxisAnimation: true,
|
||||
primaryXAxis: CategoryAxis(
|
||||
borderColor: AppColor.accentColor, borderWidth: 2,
|
||||
title: AxisTitle(
|
||||
text: 'Total Trips on month'.tr,
|
||||
textStyle: AppStyle.title,
|
||||
),
|
||||
// labelRotation: 45,
|
||||
majorGridLines: const MajorGridLines(width: 0),
|
||||
),
|
||||
primaryYAxis: const NumericAxis(isVisible: false),
|
||||
series: <LineSeries<ChartDataS, String>>[
|
||||
LineSeries<ChartDataS, String>(
|
||||
dataSource: rideAdminController.chartDatasync,
|
||||
xValueMapper: (ChartDataS data, _) => '${data.day}',
|
||||
yValueMapper: (ChartDataS data, _) =>
|
||||
data.ridesCount,
|
||||
dataLabelSettings:
|
||||
const DataLabelSettings(isVisible: true),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// SizedBox(
|
||||
// // height: 400,
|
||||
// child: SfCartesianChart(
|
||||
// legend: const Legend(
|
||||
// isVisible: true,
|
||||
// position: LegendPosition.bottom,
|
||||
// overflowMode: LegendItemOverflowMode.wrap,
|
||||
// textStyle: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 12,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// ),
|
||||
// borderWidth: 2,
|
||||
// borderColor: AppColor.blueColor,
|
||||
// plotAreaBorderColor: AppColor.deepPurpleAccent,
|
||||
// enableAxisAnimation: true,
|
||||
// primaryXAxis: CategoryAxis(
|
||||
// borderColor: AppColor.accentColor, borderWidth: 2,
|
||||
// title: AxisTitle(
|
||||
// text: 'Total Trips on month'.tr,
|
||||
// textStyle: AppStyle.title,
|
||||
// ),
|
||||
// // labelRotation: 45,
|
||||
// majorGridLines: const MajorGridLines(width: 0),
|
||||
// ),
|
||||
// primaryYAxis: const NumericAxis(isVisible: false),
|
||||
// series: <LineSeries<ChartDataS, String>>[
|
||||
// LineSeries<ChartDataS, String>(
|
||||
// dataSource: rideAdminController.chartDatasync,
|
||||
// xValueMapper: (ChartDataS data, _) => '${data.day}',
|
||||
// yValueMapper: (ChartDataS data, _) =>
|
||||
// data.ridesCount,
|
||||
// dataLabelSettings:
|
||||
// const DataLabelSettings(isVisible: true),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
|
||||
@@ -2,9 +2,12 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
class Wallet extends StatelessWidget {
|
||||
const Wallet({super.key});
|
||||
import '../../../controller/admin/wallet_admin_controller.dart';
|
||||
|
||||
class Wallet extends StatelessWidget {
|
||||
Wallet({super.key});
|
||||
WalletAdminController walletAdminController =
|
||||
Get.put(WalletAdminController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(title: 'Wallet'.tr, body: [], isleading: true);
|
||||
|
||||
@@ -29,13 +29,13 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
|
||||
width: 2,
|
||||
)),
|
||||
suffixIcon: const Icon(Icons.search),
|
||||
hintText: 'Search for your destination'.tr,
|
||||
hintText: controller.hintTextDestinationPoint,
|
||||
hintStyle: AppStyle.title,
|
||||
hintMaxLines: 1,
|
||||
prefixIcon: IconButton(
|
||||
onPressed: () {
|
||||
controller.placeController.clear();
|
||||
controller.clearPlaces();
|
||||
controller.placeDestinationController.clear();
|
||||
controller.clearPlacesDestination();
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.clear,
|
||||
@@ -43,18 +43,19 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
|
||||
),
|
||||
),
|
||||
),
|
||||
controller: controller.placeController,
|
||||
controller: controller.placeDestinationController,
|
||||
onChanged: (value) {
|
||||
if (controller.placeController.text.length > 5) {
|
||||
if (controller.placeDestinationController.text.length >
|
||||
5) {
|
||||
controller.getPlaces();
|
||||
controller.changeHeight();
|
||||
controller.changeHeightPlaces();
|
||||
}
|
||||
},
|
||||
// onEditingComplete: () => controller.changeHeight(),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.places.isEmpty
|
||||
controller.placesDestination.isEmpty
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
controller.changeMainBottomMenuMap();
|
||||
@@ -68,37 +69,25 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
|
||||
)
|
||||
: const SizedBox(),
|
||||
Container(
|
||||
height: controller.places.isNotEmpty ? controller.height : 0,
|
||||
height: controller.placesDestination.isNotEmpty
|
||||
? controller.height
|
||||
: 0,
|
||||
color: AppColor.secondaryColor,
|
||||
child: ListView.builder(
|
||||
itemCount: controller.places.length,
|
||||
itemCount: controller.placesDestination.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var res = controller.places[index];
|
||||
var res = controller.placesDestination[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
controller.changeHeight();
|
||||
Get.defaultDialog(
|
||||
title:
|
||||
'${'Are You sure to ride to'.tr} ${res['name']}',
|
||||
middleText: '',
|
||||
titleStyle: AppStyle.title,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Confirm'.tr,
|
||||
onPressed: () async {
|
||||
controller.clearPolyline();
|
||||
controller.data = [];
|
||||
await controller.getMap(
|
||||
'${controller.myLocation.latitude.toString()},${controller.myLocation.longitude.toString()}',
|
||||
"${res['geometry']['location']['lat']},${res['geometry']['location']['lng']}");
|
||||
controller.places = [];
|
||||
controller.placeController.clear();
|
||||
onTap: () async {
|
||||
controller.changeHeightPlaces();
|
||||
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
controller.showBottomSheet1();
|
||||
controller.changeMainBottomMenuMap();
|
||||
}),
|
||||
);
|
||||
controller.changeHeightPlaces();
|
||||
|
||||
controller.myLocation = controller.newMyLocation;
|
||||
controller.convertHintTextDestinationNewPlaces(index);
|
||||
|
||||
controller.placesDestination = [];
|
||||
controller.placeDestinationController.clear();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
|
||||
165
lib/views/home/map_widget.dart/form_search_start.dart
Normal file
165
lib/views/home/map_widget.dart/form_search_start.dart
Normal file
@@ -0,0 +1,165 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/table_names.dart';
|
||||
import 'package:ride/views/widgets/my_textField.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../main.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> formSearchPlacesStart() {
|
||||
// DbSql sql = DbSql.instance;
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Container(
|
||||
decoration:
|
||||
const BoxDecoration(color: AppColor.secondaryColor),
|
||||
child: TextField(
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.only(),
|
||||
gapPadding: 4,
|
||||
borderSide: BorderSide(
|
||||
color: AppColor.redColor,
|
||||
width: 2,
|
||||
)),
|
||||
suffixIcon: const Icon(Icons.search),
|
||||
hintText: controller.hintTextStartPoint,
|
||||
hintStyle: AppStyle.title,
|
||||
hintMaxLines: 1,
|
||||
prefixIcon: IconButton(
|
||||
onPressed: () {
|
||||
controller.placeStartController.clear();
|
||||
controller.clearPlacesStart();
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.clear,
|
||||
color: Colors.red[300],
|
||||
),
|
||||
),
|
||||
),
|
||||
controller: controller.placeStartController,
|
||||
onChanged: (value) {
|
||||
if (controller.placeStartController.text.length > 5) {
|
||||
controller.getPlacesStart();
|
||||
controller.changeHeightStartPlaces();
|
||||
}
|
||||
},
|
||||
// onEditingComplete: () => controller.changeHeight(),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.placesDestination.isEmpty
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
controller.startLocationFromMap = true;
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.changePickerShown();
|
||||
},
|
||||
child: Text(
|
||||
'Choose from Map'.tr,
|
||||
style:
|
||||
AppStyle.title.copyWith(color: AppColor.blueColor),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
Container(
|
||||
height:
|
||||
controller.placesStart.isNotEmpty ? controller.height : 0,
|
||||
color: AppColor.secondaryColor,
|
||||
child: ListView.builder(
|
||||
itemCount: controller.placesStart.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var res = controller.placesStart[index];
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
controller.changeHeightPlaces();
|
||||
// if (controller.currentLocationToFormPlaces == true) {
|
||||
// controller.newStartPointLocation =
|
||||
// controller.myLocation;
|
||||
// } else {
|
||||
// controller.myLocation =
|
||||
// controller.newStartPointLocation;
|
||||
// }
|
||||
|
||||
controller.convertHintTextStartNewPlaces(index);
|
||||
controller.currentLocationString = res['name'];
|
||||
controller.placesStart = [];
|
||||
controller.placeStartController.clear();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Image.network(
|
||||
res['icon'],
|
||||
width: 20,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await sql.insertData({
|
||||
'latitude': res['geometry']
|
||||
['location']['lat'],
|
||||
'longitude': res['geometry']
|
||||
['location']['lng'],
|
||||
'name': res['name'].toString(),
|
||||
'rate': res['rating'].toString(),
|
||||
}, TableName.placesFavorite);
|
||||
Toast.show(
|
||||
context,
|
||||
'${res['name']} ${'Saved Sucssefully'.tr}',
|
||||
AppColor.primaryColor);
|
||||
},
|
||||
icon: const Icon(Icons.favorite_border),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
res['name'].toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
res['vicinity'].toString(),
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'rate',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
res['rating'].toString(),
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
thickness: 1,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
@@ -149,9 +149,24 @@ class GoogleMapPassengerWidget extends StatelessWidget {
|
||||
markerId: MarkerId(carLocation.toString())),
|
||||
Marker(
|
||||
markerId: MarkerId('MyLocation'.tr),
|
||||
position: controller.myLocation,
|
||||
position: controller.newStartPointLocation,
|
||||
draggable: true,
|
||||
icon: controller.markerIcon,
|
||||
icon: controller.tripIcon,
|
||||
infoWindow: const InfoWindow(
|
||||
title: 'Time',
|
||||
// snippet: controller.durationFromDriverToPassenger
|
||||
// .toString(),
|
||||
),
|
||||
onDragEnd: (value) {
|
||||
print(value);
|
||||
},
|
||||
// infoWindow: InfoWindow(title: 'my location'.tr),
|
||||
),
|
||||
Marker(
|
||||
markerId: MarkerId('Destination'.tr),
|
||||
position: controller.newMyLocation,
|
||||
draggable: true,
|
||||
icon: controller.tripIcon,
|
||||
infoWindow: const InfoWindow(
|
||||
title: 'Time',
|
||||
// snippet: controller.durationFromDriverToPassenger
|
||||
@@ -230,7 +245,11 @@ class GoogleMapPassengerWidget extends StatelessWidget {
|
||||
buildingsEnabled: true,
|
||||
mapToolbarEnabled: true,
|
||||
onCameraMove: (position) {
|
||||
if (controller.startLocationFromMap == true) {
|
||||
controller.newStartPointLocation = position.target;
|
||||
}
|
||||
controller.newMyLocation = position.target;
|
||||
|
||||
// print('my' + controller.mylocation.toString());
|
||||
// print('new' + controller.newMylocation.toString());
|
||||
},
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/table_names.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import 'form_search_start.dart';
|
||||
|
||||
class MainBottomMenuMap extends StatelessWidget {
|
||||
const MainBottomMenuMap({super.key});
|
||||
@@ -37,185 +38,245 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
topLeft: Radius.circular(15),
|
||||
topRight: Radius.circular(15),
|
||||
)),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: InkWell(
|
||||
onTap: () => controller.changeMainBottomMenuMap(),
|
||||
child: Container(
|
||||
width: Get.width * .8,
|
||||
height: Get.height * .1,
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 5,
|
||||
offset: Offset(2, 4)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 5,
|
||||
offset: Offset(-2, -2))
|
||||
],
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.elliptical(15, 30),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: InkWell(
|
||||
onTap: () => controller.changeMainBottomMenuMap(),
|
||||
child: Container(
|
||||
width: Get.width * .8,
|
||||
height: Get.height * .1,
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 5,
|
||||
offset: Offset(2, 4)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 5,
|
||||
offset: Offset(-2, -2))
|
||||
],
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.elliptical(15, 30),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: DefaultTextStyle(
|
||||
style: AppStyle.title,
|
||||
child: Center(
|
||||
child: controller.isPickerShown
|
||||
? TextButton(
|
||||
onPressed: () async {
|
||||
controller.clearPolyline();
|
||||
controller.data = [];
|
||||
await controller.getMap(
|
||||
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
|
||||
'${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
||||
);
|
||||
controller.places = [];
|
||||
controller.placeController.clear();
|
||||
child: DefaultTextStyle(
|
||||
style: AppStyle.title,
|
||||
child: Center(
|
||||
child: controller.isPickerShown
|
||||
? TextButton(
|
||||
onPressed: () async {
|
||||
controller.clearPolyline();
|
||||
controller.data = [];
|
||||
if (controller
|
||||
.startLocationFromMap ==
|
||||
true) {
|
||||
controller.newMyLocation =
|
||||
controller
|
||||
.newStartPointLocation;
|
||||
controller.startLocationFromMap =
|
||||
false;
|
||||
controller.isPickerShown = false;
|
||||
print(controller.myLocation);
|
||||
print(controller
|
||||
.newStartPointLocation);
|
||||
} else {
|
||||
controller.newMyLocation =
|
||||
controller.newMyLocation;
|
||||
controller.isPickerShown = false;
|
||||
print(controller.myLocation);
|
||||
print(controller.newMyLocation);
|
||||
}
|
||||
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
controller.showBottomSheet1();
|
||||
// controller.changeMainBottomMenuMap();
|
||||
},
|
||||
child: Row(
|
||||
// await controller.getMap(
|
||||
// '${controller.myLocation.latitude},${controller.myLocation.longitude}',
|
||||
// '${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
||||
// );
|
||||
controller.placesDestination = [];
|
||||
controller
|
||||
.placeDestinationController
|
||||
.clear();
|
||||
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
controller.showBottomSheet1();
|
||||
controller
|
||||
.changeMainBottomMenuMap();
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeMainBottomMenuMap();
|
||||
},
|
||||
icon: controller
|
||||
.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons
|
||||
.arrow_circle_up_rounded,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
Icons
|
||||
.arrow_circle_down_rounded,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Click here point".tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
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,
|
||||
SizedBox(
|
||||
height: 30,
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeMainBottomMenuMap();
|
||||
},
|
||||
icon: controller
|
||||
.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons
|
||||
.arrow_circle_up_rounded,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
Icons
|
||||
.arrow_circle_down_rounded,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
],
|
||||
)),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
controller.noCarString == false
|
||||
? Text(
|
||||
'Nearest Car for you about '
|
||||
.tr)
|
||||
: Container(
|
||||
decoration:
|
||||
BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(12),
|
||||
color:
|
||||
AppColor.redColor,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Click here to go to this location"
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
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(),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30,
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeMainBottomMenuMap();
|
||||
},
|
||||
icon: controller
|
||||
.isMainBottomMenuMap
|
||||
? const Icon(
|
||||
Icons
|
||||
.arrow_circle_up_rounded,
|
||||
size: 35,
|
||||
)
|
||||
: const Icon(
|
||||
Icons
|
||||
.arrow_circle_down_rounded,
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${'Where to'.tr} ${box.read(BoxName.name)}'),
|
||||
],
|
||||
)),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
controller.noCarString == false
|
||||
? Text(
|
||||
'Nearest Car for you about '
|
||||
.tr)
|
||||
: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(12),
|
||||
color:
|
||||
AppColor.redColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(6),
|
||||
child: Text(
|
||||
'No Car in your site. Sorry!'
|
||||
.tr,
|
||||
style: AppStyle.title
|
||||
.copyWith(
|
||||
color: AppColor
|
||||
.secondaryColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.noCarString == false
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor
|
||||
.redColor,
|
||||
width: 3)),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(4),
|
||||
child: Text((controller
|
||||
.nearestCar !=
|
||||
null
|
||||
? controller
|
||||
.durationByPassenger
|
||||
.toString()
|
||||
: 'N/A')),
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.isMainBottomMenuMap
|
||||
? const FavioratePlacesDialogu()
|
||||
: const SizedBox(),
|
||||
controller.isMainBottomMenuMap
|
||||
? const SizedBox()
|
||||
: Text(
|
||||
'From : Current Location'.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
controller.isMainBottomMenuMap
|
||||
? const SizedBox()
|
||||
: formSearchPlaces()
|
||||
],
|
||||
controller.isMainBottomMenuMap
|
||||
? const FavioratePlacesDialogu()
|
||||
: const SizedBox(),
|
||||
controller.isMainBottomMenuMap
|
||||
? const SizedBox()
|
||||
: InkWell(
|
||||
onTap: () async {
|
||||
controller.getCurrentLocationFormString();
|
||||
},
|
||||
child: Text(
|
||||
'From : ${controller.currentLocationString}'.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
controller.isMainBottomMenuMap
|
||||
? const SizedBox()
|
||||
: Column(
|
||||
children: [
|
||||
controller.currentLocationToFormPlaces
|
||||
? const SizedBox()
|
||||
: formSearchPlacesStart(),
|
||||
formSearchPlaces(),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Go to Ride',
|
||||
onPressed: () async {
|
||||
controller.changeMainBottomMenuMap();
|
||||
|
||||
await controller.getMap(
|
||||
'${controller.newStartPointLocation.latitude},${controller.newStartPointLocation.longitude}',
|
||||
'${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
|
||||
);
|
||||
controller.currentLocationToFormPlaces =
|
||||
false;
|
||||
controller.placesDestination = [];
|
||||
controller.clearPlacesStart();
|
||||
controller.clearPlacesDestination();
|
||||
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
controller.showBottomSheet1();
|
||||
})
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
@@ -270,13 +331,15 @@ class FavioratePlacesDialogu extends StatelessWidget {
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
await controller.getLocation();
|
||||
await controller.getMap(
|
||||
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
|
||||
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
|
||||
);
|
||||
// controller.changePickerShown();
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
|
||||
controller.showBottomSheet1();
|
||||
},
|
||||
child: Text(
|
||||
|
||||
@@ -56,7 +56,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
||||
? InkWell(
|
||||
onTapDown: (details) {
|
||||
controller.changePickerShown();
|
||||
controller.changeHeight();
|
||||
controller.changeHeightPlaces();
|
||||
},
|
||||
child: Container(
|
||||
height: 7,
|
||||
@@ -188,7 +188,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
if (controller.isPickerShown &&
|
||||
controller.places.isEmpty)
|
||||
controller.placesDestination.isEmpty)
|
||||
MyElevatedButton(
|
||||
title: 'Go to this Target'.tr,
|
||||
onPressed: () async {
|
||||
@@ -205,7 +205,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
if (controller.isPickerShown &&
|
||||
controller.places.isEmpty)
|
||||
controller.placesDestination.isEmpty)
|
||||
const SizedBox(),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user