change modes
This commit is contained in:
@ -3,8 +3,12 @@ import 'package:geojson/geojson.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_state_manager/get_state_manager.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/utils/database_helper.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheet_controller.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
@ -12,6 +16,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
BottomSheetNew({ Key? key }) : super(key: key);
|
||||
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
final DestinationController destinationController = Get.find<DestinationController>();
|
||||
|
||||
Image getImage(GeoJsonFeature? gf){
|
||||
if(gf!.properties!["photos"] == null || gf.properties!["photos"] == ""){
|
||||
@ -70,6 +75,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
),
|
||||
MaterialButton(
|
||||
onPressed: () {
|
||||
print("----- next is ${indexController.currentFeature[0]} ------");
|
||||
indexController.makeNext(indexController.currentFeature[0]);
|
||||
},
|
||||
color: Colors.blue,
|
||||
@ -125,15 +131,10 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
:
|
||||
Container(width: 0.0, height: 0,),
|
||||
),
|
||||
Obx(() =>
|
||||
indexController.rog_mode.value == 0 ?
|
||||
indexController.currentAction.isNotEmpty ?
|
||||
getDoubleAction(context)
|
||||
:
|
||||
getSingleAction()
|
||||
:
|
||||
getCheckin(context),
|
||||
),
|
||||
SizedBox(height: 20.0,),
|
||||
//Obx(() =>
|
||||
wantToGo(context),
|
||||
//),
|
||||
SizedBox(height: 60.0,)
|
||||
],
|
||||
)
|
||||
@ -141,7 +142,57 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Widget wantToGo(BuildContext context){
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: (){
|
||||
},
|
||||
|
||||
child: IconButton(
|
||||
icon: Icon(Icons.favorite, color: Colors.white, semanticLabel: "want_to_go".tr,),
|
||||
onPressed: ()
|
||||
{
|
||||
GeoJsonMultiPoint mp = indexController.currentFeature[0].geometry as GeoJsonMultiPoint;
|
||||
LatLng pt = LatLng(mp.geoSerie!.geoPoints[0].latitude, mp.geoSerie!.geoPoints[0].longitude);
|
||||
|
||||
print("--- name---- ${indexController.currentFeature[0].properties!["location_name"]} -----");
|
||||
Destination dest = Destination(
|
||||
name: indexController.currentFeature[0].properties!["location_name"],
|
||||
address: indexController.currentFeature[0].properties!["address"],
|
||||
phone: indexController.currentFeature[0].properties!["phone"],
|
||||
email: indexController.currentFeature[0].properties!["email"],
|
||||
webcontents: indexController.currentFeature[0].properties!["webcontents"],
|
||||
videos: indexController.currentFeature[0].properties!["videos"],
|
||||
category: indexController.currentFeature[0].properties!["category"],
|
||||
series: 1,
|
||||
lat: pt.latitude,
|
||||
lon: pt.longitude,
|
||||
location_id: indexController.currentFeature[0].properties!["location_id"],
|
||||
list_order: 1,
|
||||
photos: indexController.currentFeature[0].properties!["photos"],
|
||||
checkin_radious: indexController.currentFeature[0].properties!["checkin_radious"],
|
||||
auto_checkin: indexController.currentFeature[0].properties!["auto_checkin"] == true ? 1 : 0
|
||||
);
|
||||
destinationController.addDestinations(dest);
|
||||
},
|
||||
)
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget getCheckin(BuildContext context){
|
||||
|
||||
print("------ currentAction ----- ${indexController.currentAction}-----");
|
||||
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
||||
@ -1,25 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter_breadcrumb/flutter_breadcrumb.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/widgets/perfecture_widget.dart';
|
||||
|
||||
class BreadCrumbWidget extends StatelessWidget {
|
||||
BreadCrumbWidget({Key? key}) : super(key: key);
|
||||
BreadCrumbWidget({Key? key, this.mapController}) : super(key: key);
|
||||
|
||||
final MapController? mapController;
|
||||
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(()=> indexController.perfectures.isNotEmpty ?
|
||||
BreadCrumb.builder(
|
||||
itemCount: indexController.perfectures.length,
|
||||
builder: (index){
|
||||
return BreadCrumbItem(
|
||||
content: PerfectureWidget(indexController: indexController, mapController: indexController.mapController!) //Text('Item$index')
|
||||
);
|
||||
}
|
||||
):
|
||||
const Text("Empty"));
|
||||
print("------ map controller is ${mapController}------------");
|
||||
return
|
||||
Obx(()=>
|
||||
indexController.perfectures.isNotEmpty && mapController != null ?
|
||||
BreadCrumb.builder(
|
||||
itemCount: indexController.perfectures.length,
|
||||
builder: (index){
|
||||
return
|
||||
BreadCrumbItem(
|
||||
content: PerfectureWidget(indexController: indexController, mapController: mapController!) //Text('Item$index')
|
||||
);
|
||||
}
|
||||
):
|
||||
const Text("Empty")
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@ import 'dart:ffi';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheet_new.dart';
|
||||
@ -19,12 +20,12 @@ class DestinationWidget extends StatelessWidget {
|
||||
final List<int> _items = List<int>.generate(50, (int index) => index);
|
||||
|
||||
Image getImage(int index){
|
||||
if(destinationController.destinations[index]["location"]["properties"]["photos"] == null || destinationController.destinations[index]["location"]["properties"]["photos"] == ""){
|
||||
if(destinationController.destinations[index].photos== null || destinationController.destinations[index].photos == ""){
|
||||
return Image(image: AssetImage('assets/images/empty_image.png'));
|
||||
}
|
||||
else{
|
||||
return Image(image: NetworkImage(
|
||||
destinationController.destinations[index]["location"]["properties"]["photos"]),
|
||||
destinationController.destinations[index].photos!),
|
||||
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
|
||||
return Image.asset("assets/images/empty_image.png");
|
||||
},
|
||||
@ -56,31 +57,34 @@ class DestinationWidget extends StatelessWidget {
|
||||
void moveUp() {
|
||||
destinationController.destination_index_data.forEach((element) {
|
||||
//print(element["index"]);
|
||||
int action_id = destinationController.destinations[element["index"]]["id"] as int;
|
||||
destinationController.makeOrder(action_id, (element["index"] as int) - 1, "up");
|
||||
//int action_id = destinationController.destinations[element["index"]]["id"] as int;
|
||||
//destinationController.makeOrder(action_id, (element["index"] as int) - 1, "up");
|
||||
});
|
||||
}
|
||||
|
||||
void moveDown() {
|
||||
destinationController.destination_index_data.forEach((element) {
|
||||
//print(element["index"]);
|
||||
int action_id = destinationController.destinations[element["index"]]["id"] as int;
|
||||
destinationController.makeOrder(action_id, (element["index"] as int) + 1, "up");
|
||||
//int action_id = destinationController.destinations[element["index"]]["id"] as int;
|
||||
//destinationController.makeOrder(action_id, (element["index"] as int) + 1, "up");
|
||||
});
|
||||
}
|
||||
|
||||
void interChange() {
|
||||
int first_index = -1;
|
||||
destinationController.destination_index_data.forEach((element) {
|
||||
//print(element["index"]);
|
||||
int action_id = destinationController.destinations[element["index"]]["id"] as int;
|
||||
destinationController.makeOrder(action_id, (element["index"] as int) + 1, "up");
|
||||
// int first_index = -1;
|
||||
// destinationController.destination_index_data.forEach((element) {
|
||||
// //print(element["index"]);
|
||||
// int action_id = destinationController.destinations[element["index"]]["id"] as int;
|
||||
// destinationController.makeOrder(action_id, (element["index"] as int) + 1, "up");
|
||||
|
||||
});
|
||||
// });
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
print("---- destinations ${destinationController.destinations[0].name} ------");
|
||||
|
||||
return
|
||||
Obx(() =>
|
||||
Stack(
|
||||
@ -119,16 +123,16 @@ class DestinationWidget extends StatelessWidget {
|
||||
child: ListTile(
|
||||
onTap: () async {
|
||||
{
|
||||
double lat = destinationController.destinations[index]["location"]["geometry"]["coordinates"][0][1] as double;
|
||||
double lon = destinationController.destinations[index]["location"]["geometry"]["coordinates"][0][0] as double;
|
||||
GeoJsonFeature? fs = await destinationController.getDEstinationForLatLong(lat, lon);
|
||||
double lat = destinationController.destinations[index].lat as double;
|
||||
double lon = destinationController.destinations[index].lon as double;
|
||||
Destination? fs = await destinationController.getDEstinationForLatLong(lat, lon);
|
||||
print("----fsf-----${fs}");
|
||||
if(fs != null){
|
||||
if(indexController.currentFeature.length > 0) {
|
||||
indexController.currentFeature.clear();
|
||||
indexController.currentDestinationFeature.clear();
|
||||
}
|
||||
indexController.currentFeature.add(fs);
|
||||
indexController.getAction();
|
||||
indexController.currentDestinationFeature.add(fs);
|
||||
//indexController.getAction();
|
||||
|
||||
showModalBottomSheet(context: context, isScrollControlled: true,
|
||||
//builder:((context) => BottomSheetWidget())
|
||||
@ -159,8 +163,8 @@ class DestinationWidget extends StatelessWidget {
|
||||
selectedTileColor: Colors.amberAccent,
|
||||
selected:getSelection(index),
|
||||
leading: getImage(index),
|
||||
title: Text(destinationController.destinations[index]["location"]["properties"]["location_name"]),
|
||||
subtitle: Text(destinationController.destinations[index]["location"]["properties"]["category"]),
|
||||
title: Text(destinationController.destinations[index].name!),
|
||||
//subtitle: Text(destinationController.destinations[index].category!),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
45
lib/widgets/fake_search.dart
Normal file
45
lib/widgets/fake_search.dart
Normal file
@ -0,0 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rogapp/pages/search/search_page.dart';
|
||||
|
||||
class FakeSearch extends StatelessWidget {
|
||||
const FakeSearch({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: (){
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => const SearchPage()));
|
||||
},
|
||||
child: Container(
|
||||
height: 35,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color:Colors.blue, width: 1.4),
|
||||
borderRadius: BorderRadius.circular(25)
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Icon(Icons.search, color: Colors.grey,),
|
||||
),
|
||||
const Text("What are you looking for", style: TextStyle(fontSize: 16, color: Colors.grey),),
|
||||
Container(
|
||||
height: 32,
|
||||
width: 75,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue,
|
||||
borderRadius: BorderRadius.circular(25),
|
||||
|
||||
),
|
||||
child: const Center(child: Text("Search", style: TextStyle(fontSize: 16, color: Colors.white),)),
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -22,6 +22,9 @@ class MapWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
print("---------- rog mode is ${indexController.rog_mode.value.toString()}----------");
|
||||
|
||||
final PopupController _popupController = PopupController();
|
||||
return Stack(
|
||||
children: [
|
||||
@ -37,6 +40,7 @@ class MapWidget extends StatelessWidget {
|
||||
indexController.mapController = c;
|
||||
|
||||
indexController.mapController!.onReady.then((_) {
|
||||
indexController.is_mapController_loaded.value = true;
|
||||
subscription = indexController.mapController!.mapEventStream.listen((MapEvent mapEvent) {
|
||||
if (mapEvent is MapEventMoveStart) {
|
||||
//print(DateTime.now().toString() + ' [MapEventMoveStart] START');
|
||||
@ -130,7 +134,7 @@ class MapWidget extends StatelessWidget {
|
||||
rotate: true,
|
||||
onMarkerTap: (marker){
|
||||
GeoJsonFeature? fs = indexController.getFeatureForLatLong(marker.point.latitude, marker.point.longitude);
|
||||
print(fs);
|
||||
//print("------- fs ${fs}------");
|
||||
if(fs != null){
|
||||
if(indexController.currentFeature.length > 0) {
|
||||
indexController.currentFeature.clear();
|
||||
|
||||
@ -9,6 +9,7 @@ class PerfectureWidget extends StatefulWidget {
|
||||
IndexController indexController;
|
||||
MapController mapController;
|
||||
|
||||
|
||||
PerfectureWidget({Key? key, required this.indexController, required this.mapController}) : super(key: key){
|
||||
//indexController.zoomtoMainPerf("9", mapController);
|
||||
}
|
||||
@ -19,6 +20,11 @@ class PerfectureWidget extends StatefulWidget {
|
||||
|
||||
class _PerfectureWidgetState extends State<PerfectureWidget> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
||||
bool isNumeric(String s) {
|
||||
if (s == null) {
|
||||
@ -93,6 +99,7 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Obx(() =>
|
||||
Row(
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user