8-17/1
This commit is contained in:
@@ -2,6 +2,7 @@ class BoxName {
|
|||||||
static const String driverID = "driverID";
|
static const String driverID = "driverID";
|
||||||
|
|
||||||
static const String lang = "lang";
|
static const String lang = "lang";
|
||||||
|
static const String passwoerd = "passwoerd";
|
||||||
static const String agreeTerms = "agreeTerms";
|
static const String agreeTerms = "agreeTerms";
|
||||||
static const String pasengerID = "pasengerID";
|
static const String pasengerID = "pasengerID";
|
||||||
static const String phone = "phone";
|
static const String phone = "phone";
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ class LoginController extends GetxController {
|
|||||||
box.write(BoxName.pasengerID, jsonDecoeded['data'][0]['id']);
|
box.write(BoxName.pasengerID, jsonDecoeded['data'][0]['id']);
|
||||||
box.write(BoxName.email, jsonDecoeded['data'][0]['email']);
|
box.write(BoxName.email, jsonDecoeded['data'][0]['email']);
|
||||||
box.write(BoxName.phone, jsonDecoeded['data'][0]['phone']);
|
box.write(BoxName.phone, jsonDecoeded['data'][0]['phone']);
|
||||||
|
saveData(BoxName.passwoerd, passwordController.text);
|
||||||
Get.offAll(() => MapPage());
|
Get.offAll(() => MapPage());
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
|
|||||||
@@ -62,9 +62,9 @@ class RegisterController extends GetxController {
|
|||||||
'token': verfyCode.text,
|
'token': verfyCode.text,
|
||||||
});
|
});
|
||||||
|
|
||||||
// if (jsondecod['status'] == 'success') {
|
if (jsonDecode(res)['status'] == 'success') {
|
||||||
Get.offAll(() => const MapPage());
|
Get.offAll(() => const MapPage());
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void register() async {
|
void register() async {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class CRUD {
|
|||||||
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// print("-----/---------" + response.body.toString());
|
// print("--------------" + response.body.toString());
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
@@ -49,7 +49,6 @@ class CRUD {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
print(response.request);
|
print(response.request);
|
||||||
print(payload);
|
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
|
|||||||
@@ -29,25 +29,34 @@ class MapController extends GetxController {
|
|||||||
final List<LatLng> carsLocationByPassenger = [];
|
final List<LatLng> carsLocationByPassenger = [];
|
||||||
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
|
||||||
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
||||||
double height = 200;
|
double height = 150;
|
||||||
final location = Location();
|
final location = Location();
|
||||||
late LocationData currentLocation;
|
late LocationData currentLocation;
|
||||||
double heightMenu = 0;
|
double heightMenu = 0;
|
||||||
double heightPickerContainer = 90;
|
double heightPickerContainer = 90;
|
||||||
|
double mainBottomMenuMap = Get.height * .2;
|
||||||
bool heightMenuBool = false;
|
bool heightMenuBool = false;
|
||||||
bool isPickerShown = false;
|
bool isPickerShown = false;
|
||||||
bool isButtomSheetShown = false;
|
bool isButtomSheetShown = false;
|
||||||
|
bool mapType = false;
|
||||||
|
bool isMainBottomMenuMap = true;
|
||||||
double heightButtomSheetShown = 240;
|
double heightButtomSheetShown = 240;
|
||||||
late final LatLng southwest;
|
late final LatLng southwest;
|
||||||
late final LatLng northeast;
|
late final LatLng northeast;
|
||||||
List<CarLocationModel> carLocations = <CarLocationModel>[];
|
List<CarLocationModel> carLocations = <CarLocationModel>[];
|
||||||
|
// final mainBottomMenuMap = GlobalKey<AnimatedContainer>();
|
||||||
void changeButtomSheetShown() {
|
void changeButtomSheetShown() {
|
||||||
isButtomSheetShown = !isButtomSheetShown;
|
isButtomSheetShown = !isButtomSheetShown;
|
||||||
heightButtomSheetShown = isButtomSheetShown == true ? 240 : 0;
|
heightButtomSheetShown = isButtomSheetShown == true ? 240 : 0;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void changeMapType() {
|
||||||
|
mapType = !mapType;
|
||||||
|
// heightButtomSheetShown = isButtomSheetShown == true ? 240 : 0;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
void getDrawerMenu() {
|
void getDrawerMenu() {
|
||||||
heightMenuBool = !heightMenuBool;
|
heightMenuBool = !heightMenuBool;
|
||||||
heightMenu = heightMenuBool == true ? 100 : 0;
|
heightMenu = heightMenuBool == true ? 100 : 0;
|
||||||
@@ -65,12 +74,19 @@ class MapController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void changeMainBottomMenuMap() {
|
||||||
|
isMainBottomMenuMap = !isMainBottomMenuMap;
|
||||||
|
mainBottomMenuMap =
|
||||||
|
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .66;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
changeHeight() {
|
changeHeight() {
|
||||||
if (places.isEmpty) {
|
if (places.isEmpty) {
|
||||||
height = 0;
|
height = 0;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
height = 200;
|
height = 150;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,9 @@ void main() async {
|
|||||||
FirebasMessagesController().getToken();
|
FirebasMessagesController().getToken();
|
||||||
await FirebasMessagesController().getTokens();
|
await FirebasMessagesController().getTokens();
|
||||||
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
||||||
FirebasMessagesController().getNotificationSettings();
|
|
||||||
FirebasMessagesController().requestPermission();
|
FirebasMessagesController().requestPermission();
|
||||||
|
FirebasMessagesController().getNotificationSettings();
|
||||||
|
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:ride/views/widgets/mycircular.dart';
|
|||||||
|
|
||||||
import '../../controller/home/menu_controller.dart';
|
import '../../controller/home/menu_controller.dart';
|
||||||
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
||||||
|
import 'map_widget.dart/main_bottom_Menu_map.dart';
|
||||||
import 'map_widget.dart/map_menu_widget.dart';
|
import 'map_widget.dart/map_menu_widget.dart';
|
||||||
import 'map_widget.dart/menu_map_page.dart';
|
import 'map_widget.dart/menu_map_page.dart';
|
||||||
import 'map_widget.dart/picker_animation_container.dart';
|
import 'map_widget.dart/picker_animation_container.dart';
|
||||||
@@ -123,7 +124,8 @@ class MapPage extends StatelessWidget {
|
|||||||
// center: controller.mylocation,
|
// center: controller.mylocation,
|
||||||
// radius: 2000)
|
// radius: 2000)
|
||||||
// },
|
// },
|
||||||
mapType: MapType.normal,
|
mapType:
|
||||||
|
controller.mapType ? MapType.satellite : MapType.normal,
|
||||||
myLocationButtonEnabled: true,
|
myLocationButtonEnabled: true,
|
||||||
indoorViewEnabled: true,
|
indoorViewEnabled: true,
|
||||||
trafficEnabled: false,
|
trafficEnabled: false,
|
||||||
@@ -138,8 +140,21 @@ class MapPage extends StatelessWidget {
|
|||||||
// liteModeEnabled: true,
|
// liteModeEnabled: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
GetBuilder<MapController>(
|
||||||
|
builder: (controller) => Positioned(
|
||||||
|
top: 80,
|
||||||
|
left: 6,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () => controller.changeMapType(),
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.satellite_alt,
|
||||||
|
size: 35,
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
const PickerIconOnMap(),
|
const PickerIconOnMap(),
|
||||||
PickerAnimtionContainerFormPlaces(),
|
PickerAnimtionContainerFormPlaces(),
|
||||||
|
// MainBottomMenuMap(),
|
||||||
const MapMenuWidget(),
|
const MapMenuWidget(),
|
||||||
const MenuIconMapPageWidget(),
|
const MenuIconMapPageWidget(),
|
||||||
buttomSheetMapPage()
|
buttomSheetMapPage()
|
||||||
|
|||||||
@@ -1,147 +1,144 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:ride/constant/table_names.dart';
|
import 'package:ride/constant/table_names.dart';
|
||||||
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
import '../../../constant/style.dart';
|
import '../../../constant/style.dart';
|
||||||
import '../../../controller/home/map_page_controller.dart';
|
import '../../../controller/home/map_page_controller.dart';
|
||||||
import '../../../main.dart';
|
import '../../../main.dart';
|
||||||
import '../../../models/db_sql.dart';
|
|
||||||
|
|
||||||
GetBuilder<MapController> formSearchPlaces() {
|
GetBuilder<MapController> formSearchPlaces() {
|
||||||
// DbSql sql = DbSql.instance;
|
// DbSql sql = DbSql.instance;
|
||||||
return GetBuilder<MapController>(
|
return GetBuilder<MapController>(
|
||||||
builder: (controller) => Positioned(
|
builder: (controller) => Column(
|
||||||
top: 5,
|
children: [
|
||||||
// width: Get.width * .8,
|
Padding(
|
||||||
left: 50,
|
padding: const EdgeInsets.all(16),
|
||||||
right: 0,
|
child: Container(
|
||||||
child: Column(
|
decoration:
|
||||||
children: [
|
const BoxDecoration(color: AppColor.secondaryColor),
|
||||||
Container(
|
child: TextField(
|
||||||
height: controller.places.isNotEmpty ? controller.height : 0,
|
decoration: InputDecoration(
|
||||||
color: AppColor.secondaryColor,
|
suffixIcon: const Icon(Icons.search),
|
||||||
child: ListView.builder(
|
hintText: 'Type here Place',
|
||||||
itemCount: controller.places.length,
|
hintMaxLines: 1,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
prefixIcon: IconButton(
|
||||||
var res = controller.places[index];
|
onPressed: () {
|
||||||
return InkWell(
|
controller.placeController.clear();
|
||||||
onTap: () {
|
controller.clearPlaces();
|
||||||
controller.changeHeight();
|
|
||||||
Get.defaultDialog(
|
|
||||||
title: 'Are You sure to ride to ${res['name']}',
|
|
||||||
middleText: '',
|
|
||||||
onConfirm: () {
|
|
||||||
controller.clearpolyline();
|
|
||||||
controller.getMap(
|
|
||||||
'${controller.mylocation.latitude.toString()},${controller.mylocation.longitude.toString()}',
|
|
||||||
"${res['geometry']['location']['lat']},${res['geometry']['location']['lng']}");
|
|
||||||
controller.places = [];
|
|
||||||
controller.placeController.clear();
|
|
||||||
Get.back();
|
|
||||||
controller.bottomSheet();
|
|
||||||
// Get.back();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
child: Padding(
|
icon: Icon(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
Icons.clear,
|
||||||
child: Column(
|
color: Colors.red[300],
|
||||||
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);
|
|
||||||
},
|
|
||||||
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,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
child: Container(
|
|
||||||
decoration:
|
|
||||||
const BoxDecoration(color: AppColor.secondaryColor),
|
|
||||||
child: TextField(
|
|
||||||
decoration: InputDecoration(
|
|
||||||
suffixIcon: const Icon(Icons.search),
|
|
||||||
hintText: 'Type here Place',
|
|
||||||
hintMaxLines: 1,
|
|
||||||
prefixIcon: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
controller.placeController.clear();
|
|
||||||
controller.clearPlaces();
|
|
||||||
},
|
|
||||||
icon: Icon(
|
|
||||||
Icons.clear,
|
|
||||||
color: Colors.red[300],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
controller: controller.placeController,
|
|
||||||
onChanged: (value) {
|
|
||||||
if (controller.placeController.text.length > 5) {
|
|
||||||
controller.getPlaces();
|
|
||||||
controller.changeHeight();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// onEditingComplete: () => controller.changeHeight(),
|
|
||||||
),
|
),
|
||||||
|
controller: controller.placeController,
|
||||||
|
onChanged: (value) {
|
||||||
|
if (controller.placeController.text.length > 5) {
|
||||||
|
controller.getPlaces();
|
||||||
|
controller.changeHeight();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// onEditingComplete: () => controller.changeHeight(),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
),
|
||||||
),
|
Container(
|
||||||
|
height: controller.places.isNotEmpty ? controller.height : 0,
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: controller.places.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
var res = controller.places[index];
|
||||||
|
return InkWell(
|
||||||
|
onTap: () {
|
||||||
|
controller.changeHeight();
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Are You sure to ride to ${res['name']}',
|
||||||
|
middleText: '',
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Confirm'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
controller.clearpolyline();
|
||||||
|
controller.getMap(
|
||||||
|
'${controller.mylocation.latitude.toString()},${controller.mylocation.longitude.toString()}',
|
||||||
|
"${res['geometry']['location']['lat']},${res['geometry']['location']['lng']}");
|
||||||
|
controller.places = [];
|
||||||
|
controller.placeController.clear();
|
||||||
|
|
||||||
|
Get.back();
|
||||||
|
controller.changeButtomSheetShown();
|
||||||
|
controller.bottomSheet();
|
||||||
|
controller.changeMainBottomMenuMap();
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
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,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
196
lib/views/home/map_widget.dart/main_bottom_Menu_map.dart
Normal file
196
lib/views/home/map_widget.dart/main_bottom_Menu_map.dart
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
import 'package:animated_text_kit/animated_text_kit.dart';
|
||||||
|
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/home/map_page_controller.dart';
|
||||||
|
import 'package:ride/main.dart';
|
||||||
|
import 'package:ride/views/home/map_widget.dart/form_search_places.dart';
|
||||||
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
|
import '../../../constant/colors.dart';
|
||||||
|
import '../../../constant/table_names.dart';
|
||||||
|
|
||||||
|
class MainBottomMenuMap extends StatelessWidget {
|
||||||
|
const MainBottomMenuMap({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
Get.put(MapController());
|
||||||
|
return GetBuilder<MapController>(
|
||||||
|
builder: (controller) => Positioned(
|
||||||
|
bottom: 3,
|
||||||
|
left: 5,
|
||||||
|
right: 5,
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: const Duration(milliseconds: 400),
|
||||||
|
height: controller.mainBottomMenuMap,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: AppColor.accentColor, offset: Offset(2, 2)),
|
||||||
|
BoxShadow(
|
||||||
|
color: AppColor.accentColor, offset: Offset(-2, -2))
|
||||||
|
],
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(15),
|
||||||
|
topRight: Radius.circular(15),
|
||||||
|
)),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(15),
|
||||||
|
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: AnimatedTextKit(
|
||||||
|
animatedTexts: [
|
||||||
|
ScaleAnimatedText(
|
||||||
|
'Where to ${box.read(BoxName.name)}'),
|
||||||
|
WavyAnimatedText(
|
||||||
|
'Where to ${box.read(BoxName.name)}'),
|
||||||
|
FlickerAnimatedText(
|
||||||
|
'Where to ${box.read(BoxName.name)}'),
|
||||||
|
WavyAnimatedText(
|
||||||
|
'Where to ${box.read(BoxName.name)}'),
|
||||||
|
],
|
||||||
|
isRepeatingAnimation: true,
|
||||||
|
onTap: () {
|
||||||
|
print("Tap Event");
|
||||||
|
controller.changeMainBottomMenuMap();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
controller.isMainBottomMenuMap
|
||||||
|
? FavioratePlacesDialogu()
|
||||||
|
: const SizedBox(),
|
||||||
|
controller.isMainBottomMenuMap
|
||||||
|
? const SizedBox()
|
||||||
|
: Text('From : Current Location',style: AppStyle.subtitle,),
|
||||||
|
controller.isMainBottomMenuMap
|
||||||
|
? const SizedBox()
|
||||||
|
: formSearchPlaces()
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class FavioratePlacesDialogu extends StatelessWidget {
|
||||||
|
FavioratePlacesDialogu({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
final controller = MapController();
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return DefaultTextStyle(
|
||||||
|
style: AppStyle.title,
|
||||||
|
child: Center(
|
||||||
|
child: AnimatedTextKit(
|
||||||
|
animatedTexts: [
|
||||||
|
TypewriterAnimatedText('Favorite Places'.tr),
|
||||||
|
ScaleAnimatedText(
|
||||||
|
'Favorite Places'.tr,
|
||||||
|
),
|
||||||
|
TyperAnimatedText(
|
||||||
|
'Favorite Places'.tr,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
isRepeatingAnimation: true,
|
||||||
|
onTap: () async {
|
||||||
|
List favoritePlaces =
|
||||||
|
await sql.getAllData(TableName.placesFavorite);
|
||||||
|
print(favoritePlaces);
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Favorite Places'.tr,
|
||||||
|
content: SizedBox(
|
||||||
|
width: Get.width * .8,
|
||||||
|
height: 300,
|
||||||
|
child: favoritePlaces.isEmpty
|
||||||
|
? Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.hourglass_empty_rounded,
|
||||||
|
size: 99,
|
||||||
|
color: AppColor.primaryColor,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'You Dont Have Any places yet !'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: ListView.builder(
|
||||||
|
itemCount: favoritePlaces.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () async {
|
||||||
|
await controller.getMap(
|
||||||
|
'${controller.mylocation.latitude},${controller.mylocation.longitude}',
|
||||||
|
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
|
||||||
|
);
|
||||||
|
controller.changePickerShown();
|
||||||
|
controller.changeButtomSheetShown();
|
||||||
|
controller.bottomSheet();
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
favoritePlaces[index]['name'],
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () async {
|
||||||
|
await sql.deleteData(TableName.placesFavorite,
|
||||||
|
favoritePlaces[index]['id']);
|
||||||
|
Get.back();
|
||||||
|
Get.snackbar('Deleted ',
|
||||||
|
'You are Delete ${favoritePlaces[index]['name']} from your list',
|
||||||
|
backgroundColor: AppColor.accentColor);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.favorite_outlined),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
cancel: MyElevatedButton(
|
||||||
|
title: 'Back'.tr, onPressed: () => Get.back()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,9 +25,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
|||||||
right: 5,
|
right: 5,
|
||||||
child: AnimatedContainer(
|
child: AnimatedContainer(
|
||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(milliseconds: 300),
|
||||||
height: controller.places.isNotEmpty
|
height: controller.heightPickerContainer,
|
||||||
? 300
|
|
||||||
: controller.heightPickerContainer,
|
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
@@ -41,7 +39,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
|||||||
topRight: Radius.circular(15),
|
topRight: Radius.circular(15),
|
||||||
)),
|
)),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
controller.isPickerShown
|
controller.isPickerShown
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
@@ -50,6 +48,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
|||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 5,
|
height: 5,
|
||||||
@@ -61,7 +60,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
|||||||
controller.changeHeight();
|
controller.changeHeight();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 4,
|
height: 7,
|
||||||
width: Get.width * .3,
|
width: Get.width * .3,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.accentColor,
|
color: AppColor.accentColor,
|
||||||
@@ -76,7 +75,7 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
|||||||
? InkWell(
|
? InkWell(
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
child: formSearchPlaces(),
|
child: formSearchPlaces(),
|
||||||
)
|
)
|
||||||
: Row(
|
: Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceEvenly,
|
MainAxisAlignment.spaceEvenly,
|
||||||
@@ -85,12 +84,10 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
controller.changePickerShown();
|
controller.changePickerShown();
|
||||||
},
|
},
|
||||||
child: Builder(builder: (context) {
|
child: Text(
|
||||||
return Text(
|
"Pick your destination from Map".tr,
|
||||||
"Pick your destination from Map".tr,
|
style: AppStyle.subtitle,
|
||||||
style: AppStyle.subtitle,
|
),
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
@@ -181,37 +178,38 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
onCancel: () {},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Builder(builder: (context) {
|
child: Text(
|
||||||
return Text(
|
"Go To Favorite Places".tr,
|
||||||
"Go To Favorite Places".tr,
|
style: AppStyle.subtitle,
|
||||||
style: AppStyle.subtitle,
|
),
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
|
if (controller.isPickerShown &&
|
||||||
|
controller.places.isEmpty)
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Go to this Target',
|
||||||
|
onPressed: () async {
|
||||||
|
await controller.getMap(
|
||||||
|
'${controller.mylocation.latitude},${controller.mylocation.longitude}',
|
||||||
|
'${controller.newMylocation.latitude},${controller.newMylocation.longitude}',
|
||||||
|
);
|
||||||
|
controller.changePickerShown();
|
||||||
|
controller.changeButtomSheetShown();
|
||||||
|
controller.bottomSheet();
|
||||||
|
// await sql
|
||||||
|
// .getAllData(TableName.placesFavorite)
|
||||||
|
// .then((value) => print(value));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
if (controller.isPickerShown &&
|
||||||
|
controller.places.isEmpty)
|
||||||
|
const SizedBox(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (controller.isPickerShown && controller.places.isEmpty)
|
|
||||||
MyElevatedButton(
|
|
||||||
title: 'Go to this Target',
|
|
||||||
onPressed: () async {
|
|
||||||
await controller.getMap(
|
|
||||||
'${controller.mylocation.latitude},${controller.mylocation.longitude}',
|
|
||||||
'${controller.newMylocation.latitude},${controller.newMylocation.longitude}',
|
|
||||||
);
|
|
||||||
controller.changePickerShown();
|
|
||||||
controller.changeButtomSheetShown();
|
|
||||||
controller.bottomSheet();
|
|
||||||
// await sql
|
|
||||||
// .getAllData(TableName.placesFavorite)
|
|
||||||
// .then((value) => print(value));
|
|
||||||
},
|
|
||||||
),
|
|
||||||
if (controller.isPickerShown && controller.places.isEmpty)
|
|
||||||
const SizedBox(),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
30
pubspec.lock
30
pubspec.lock
@@ -69,10 +69,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
|
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.17.1"
|
version: "1.17.2"
|
||||||
convert:
|
convert:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -508,18 +508,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
|
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.15"
|
version: "0.12.16"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
|
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.0"
|
version: "0.5.0"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -641,10 +641,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: source_span
|
name: source_span
|
||||||
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
|
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.1"
|
version: "1.10.0"
|
||||||
sqflite:
|
sqflite:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -713,10 +713,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
|
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.1"
|
version: "0.6.0"
|
||||||
timezone:
|
timezone:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -805,6 +805,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.4"
|
version: "2.1.4"
|
||||||
|
web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: web
|
||||||
|
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.4-beta"
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -830,5 +838,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "6.3.0"
|
version: "6.3.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.0.5 <4.0.0"
|
dart: ">=3.1.0-185.0.dev <4.0.0"
|
||||||
flutter: ">=3.10.0"
|
flutter: ">=3.10.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user