8-10/2
This commit is contained in:
@@ -28,7 +28,7 @@ class MapController extends GetxController {
|
|||||||
double height = 200;
|
double height = 200;
|
||||||
final location = Location();
|
final location = Location();
|
||||||
late LocationData currentLocation;
|
late LocationData currentLocation;
|
||||||
double heightMenu = 70;
|
double heightMenu = 0;
|
||||||
double heightPickerContainer = 90;
|
double heightPickerContainer = 90;
|
||||||
bool heightMenuBool = false;
|
bool heightMenuBool = false;
|
||||||
bool isPickerShown = false;
|
bool isPickerShown = false;
|
||||||
@@ -76,7 +76,7 @@ class MapController extends GetxController {
|
|||||||
Future getPlaces() async {
|
Future getPlaces() async {
|
||||||
var url =
|
var url =
|
||||||
// '${AppLink.googleMapsLink}place/nearbysearch/json?location=${mylocation.longitude}&radius=25000&language=ar&keyword=&key=${placeController.text}${AppCredintials.mapAPIKEY}';
|
// '${AppLink.googleMapsLink}place/nearbysearch/json?location=${mylocation.longitude}&radius=25000&language=ar&keyword=&key=${placeController.text}${AppCredintials.mapAPIKEY}';
|
||||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${placeController.text}&location=32.111946,${mylocation.longitude}&radius=10000&language=ar&key=${AppCredintials.mapAPIKEY}';
|
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${placeController.text}&location=${mylocation.latitude},${mylocation.longitude}&radius=50000&language=ar&key=${AppCredintials.mapAPIKEY}';
|
||||||
|
|
||||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
|
||||||
@@ -239,12 +239,19 @@ class MapController extends GetxController {
|
|||||||
late double averageDuration;
|
late double averageDuration;
|
||||||
late double costDuration;
|
late double costDuration;
|
||||||
late double cost;
|
late double cost;
|
||||||
|
late double distance;
|
||||||
|
late double duration;
|
||||||
|
DateTime currentTime = DateTime.now();
|
||||||
|
late Duration durationToAdd;
|
||||||
|
late DateTime newTime;
|
||||||
void bottomSheet() {
|
void bottomSheet() {
|
||||||
if (data.isNotEmpty) {
|
if (data.isNotEmpty) {
|
||||||
String distanceText = data[0]['distance']['text'];
|
String distanceText = data[0]['distance']['text'];
|
||||||
String durationText = data[0]['duration']['text'];
|
String durationText = data[0]['duration']['text'];
|
||||||
double distance = getDistanceFromText(distanceText);
|
distance = getDistanceFromText(distanceText);
|
||||||
double duration = getDistanceFromText(durationText);
|
duration = getDistanceFromText(durationText);
|
||||||
|
durationToAdd = Duration(minutes: duration.toInt());
|
||||||
|
newTime = currentTime.add(durationToAdd);
|
||||||
|
|
||||||
if (distanceText.contains('km')) {
|
if (distanceText.contains('km')) {
|
||||||
cost = distance * 0.21;
|
cost = distance * 0.21;
|
||||||
|
|||||||
@@ -1,36 +1,14 @@
|
|||||||
import 'package:flutter/material.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/circle_container.dart';
|
import 'package:ride/views/widgets/circle_container.dart';
|
||||||
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
class HomePage extends StatelessWidget {
|
class HomePage extends StatelessWidget {
|
||||||
const HomePage({super.key});
|
const HomePage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return MyScafolld(
|
||||||
backgroundColor: AppColor.secondaryColor,
|
title: 'Home Page',
|
||||||
appBar: AppBar(
|
body: Center(child: CircleContainer(child: const Icon(Icons.clear))));
|
||||||
backgroundColor: AppColor.secondaryColor,
|
|
||||||
elevation: 0,
|
|
||||||
leading: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.arrow_back_ios_new,
|
|
||||||
color: AppColor.primaryColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'Home'.tr,
|
|
||||||
style: AppStyle.title.copyWith(fontSize: 30),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
body: Center(
|
|
||||||
child: CircleContainer(child: const Icon(Icons.clear)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
import '../../../constant/style.dart';
|
import '../../../constant/style.dart';
|
||||||
@@ -40,15 +41,30 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
|||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(15))),
|
Radius.circular(15))),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/images/jeep.png',
|
'assets/images/jeep.png',
|
||||||
width: Get.width * .2,
|
width: 88,
|
||||||
|
fit: BoxFit.fill,
|
||||||
repeat: ImageRepeat.repeatX,
|
repeat: ImageRepeat.repeatX,
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${'Your Ride Duration is '.tr}${controller.duration} minutes'),
|
||||||
|
Text(
|
||||||
|
'You will be thier in ${DateFormat('h:mm a').format(controller.newTime)}')
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Fee is \n${controller.totalPassenger.toStringAsFixed(2)}',
|
||||||
|
style: AppStyle.subtitle,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,34 +1,12 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
|
||||||
import '../../../constant/style.dart';
|
|
||||||
|
|
||||||
class PassengerProfilePage extends StatelessWidget {
|
class PassengerProfilePage extends StatelessWidget {
|
||||||
const PassengerProfilePage({super.key});
|
const PassengerProfilePage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return const MyScafolld(
|
||||||
backgroundColor: AppColor.secondaryColor,
|
title: 'My Profile', body: Center(child: Text('ddd')));
|
||||||
appBar: AppBar(
|
|
||||||
backgroundColor: AppColor.secondaryColor,
|
|
||||||
elevation: 0,
|
|
||||||
leading: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.arrow_back_ios_new,
|
|
||||||
color: AppColor.primaryColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
'My Profile'.tr,
|
|
||||||
style: AppStyle.title.copyWith(fontSize: 30),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
body: Container(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,30 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:ride/constant/colors.dart';
|
import 'package:ride/constant/colors.dart';
|
||||||
import 'package:ride/constant/style.dart';
|
|
||||||
|
import '../widgets/my_scafold.dart';
|
||||||
|
|
||||||
class NotificationPage extends StatelessWidget {
|
class NotificationPage extends StatelessWidget {
|
||||||
const NotificationPage({super.key});
|
const NotificationPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return MyScafolld(
|
||||||
backgroundColor: AppColor.secondaryColor,
|
title: 'Notifications',
|
||||||
appBar: AppBar(
|
action: IconButton(
|
||||||
backgroundColor: AppColor.secondaryColor,
|
onPressed: () {},
|
||||||
elevation: 0,
|
|
||||||
leading: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.arrow_back_ios_new,
|
Icons.add,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
title: Text(
|
body: Center(
|
||||||
'Notificatios'.tr,
|
child: TextButton(
|
||||||
style: AppStyle.title.copyWith(fontSize: 30),
|
onPressed: () {},
|
||||||
|
child: Text(
|
||||||
|
"Text Button",
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
|
||||||
child: Center(
|
|
||||||
child: null,
|
|
||||||
)),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
43
lib/views/widgets/my_scafold.dart
Normal file
43
lib/views/widgets/my_scafold.dart
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../constant/colors.dart';
|
||||||
|
import '../../constant/style.dart';
|
||||||
|
|
||||||
|
class MyScafolld extends StatelessWidget {
|
||||||
|
const MyScafolld({
|
||||||
|
super.key,
|
||||||
|
required this.title,
|
||||||
|
required this.body,
|
||||||
|
this.action = const Icon(Icons.clear),
|
||||||
|
});
|
||||||
|
|
||||||
|
final String title;
|
||||||
|
final Widget body;
|
||||||
|
final Widget action;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColor.secondaryColor,
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: AppColor.secondaryColor,
|
||||||
|
elevation: 0,
|
||||||
|
leading: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.arrow_back_ios_new,
|
||||||
|
color: AppColor.primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [action],
|
||||||
|
title: Text(
|
||||||
|
title,
|
||||||
|
style: AppStyle.title.copyWith(fontSize: 30),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: SafeArea(child: Stack(children: [body])));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user