8-10/2
This commit is contained in:
@@ -28,7 +28,7 @@ class MapController extends GetxController {
|
||||
double height = 200;
|
||||
final location = Location();
|
||||
late LocationData currentLocation;
|
||||
double heightMenu = 70;
|
||||
double heightMenu = 0;
|
||||
double heightPickerContainer = 90;
|
||||
bool heightMenuBool = false;
|
||||
bool isPickerShown = false;
|
||||
@@ -76,7 +76,7 @@ class MapController extends GetxController {
|
||||
Future getPlaces() async {
|
||||
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?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: {});
|
||||
|
||||
@@ -239,12 +239,19 @@ class MapController extends GetxController {
|
||||
late double averageDuration;
|
||||
late double costDuration;
|
||||
late double cost;
|
||||
late double distance;
|
||||
late double duration;
|
||||
DateTime currentTime = DateTime.now();
|
||||
late Duration durationToAdd;
|
||||
late DateTime newTime;
|
||||
void bottomSheet() {
|
||||
if (data.isNotEmpty) {
|
||||
String distanceText = data[0]['distance']['text'];
|
||||
String durationText = data[0]['duration']['text'];
|
||||
double distance = getDistanceFromText(distanceText);
|
||||
double duration = getDistanceFromText(durationText);
|
||||
distance = getDistanceFromText(distanceText);
|
||||
duration = getDistanceFromText(durationText);
|
||||
durationToAdd = Duration(minutes: duration.toInt());
|
||||
newTime = currentTime.add(durationToAdd);
|
||||
|
||||
if (distanceText.contains('km')) {
|
||||
cost = distance * 0.21;
|
||||
|
||||
@@ -1,36 +1,14 @@
|
||||
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/my_scafold.dart';
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
const HomePage({super.key});
|
||||
|
||||
@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,
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
'Home'.tr,
|
||||
style: AppStyle.title.copyWith(fontSize: 30),
|
||||
),
|
||||
),
|
||||
body: Center(
|
||||
child: CircleContainer(child: const Icon(Icons.clear)),
|
||||
),
|
||||
);
|
||||
return MyScafolld(
|
||||
title: 'Home Page',
|
||||
body: Center(child: CircleContainer(child: const Icon(Icons.clear))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
@@ -40,15 +41,30 @@ GetBuilder<MapController> buttomSheetMapPage() {
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(15))),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
'assets/images/jeep.png',
|
||||
width: Get.width * .2,
|
||||
width: 88,
|
||||
fit: BoxFit.fill,
|
||||
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:get/get.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
class PassengerProfilePage extends StatelessWidget {
|
||||
const PassengerProfilePage({super.key});
|
||||
|
||||
@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,
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
'My Profile'.tr,
|
||||
style: AppStyle.title.copyWith(fontSize: 30),
|
||||
),
|
||||
),
|
||||
body: Container(),
|
||||
);
|
||||
return const MyScafolld(
|
||||
title: 'My Profile', body: Center(child: Text('ddd')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,30 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
|
||||
import '../widgets/my_scafold.dart';
|
||||
|
||||
class NotificationPage extends StatelessWidget {
|
||||
const NotificationPage({super.key});
|
||||
|
||||
@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,
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
'Notificatios'.tr,
|
||||
style: AppStyle.title.copyWith(fontSize: 30),
|
||||
return MyScafolld(
|
||||
title: 'Notifications',
|
||||
action: IconButton(
|
||||
onPressed: () {},
|
||||
icon: const Icon(
|
||||
Icons.add,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
),
|
||||
body: Center(
|
||||
child: TextButton(
|
||||
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