update for flutter_map

This commit is contained in:
Mohamed Nouffer
2022-12-13 18:19:16 +05:30
parent 244b7eb9ac
commit e9bf50fc14
51 changed files with 2701 additions and 4007 deletions

View File

@ -1,22 +1,22 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter_map/flutter_map.dart';
class BaseLayer extends StatelessWidget {
const BaseLayer({Key? key}) : super(key: key);
// class BaseLayer extends StatelessWidget {
// const BaseLayer({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return TileLayerWidget(
options: TileLayerOptions(
backgroundColor: Colors.transparent,
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
//urlTemplate: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
subdomains: ['a', 'b', 'c'],
),
);
}
}
// @override
// Widget build(BuildContext context) {
// return TileLayerWidget(
// options: TileLayerOptions(
// backgroundColor: Colors.transparent,
// urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
// //urlTemplate: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
// subdomains: ['a', 'b', 'c'],
// ),
// );
// }
// }
// var Esri_WorldImagery = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
// attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
// });
// // var Esri_WorldImagery = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
// // attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
// // });

View File

@ -1,11 +1,11 @@
import 'package:geojson/geojson.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
// import 'package:geojson/geojson.dart';
// import 'package:get/get_state_manager/get_state_manager.dart';
class BottomSheetController extends GetxController{
// class BottomSheetController extends GetxController{
List<GeoJsonFeature>? currentFeature = <GeoJsonFeature>[];
// List<GeoJsonFeature>? currentFeature = <GeoJsonFeature>[];
BottomSheetController({this.currentFeature});
}
// BottomSheetController({this.currentFeature});
// }

File diff suppressed because it is too large Load Diff

View File

@ -1,380 +1,380 @@
import 'dart:io';
// import 'dart:io';
import 'package:flutter/material.dart';
import 'package:geojson/geojson.dart';
import 'package:get/get.dart';
import 'package:image_picker/image_picker.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/routes/app_pages.dart';
import 'package:url_launcher/url_launcher.dart';
// import 'package:flutter/material.dart';
// import 'package:geojson/geojson.dart';
// import 'package:get/get.dart';
// import 'package:image_picker/image_picker.dart';
// import 'package:rogapp/pages/index/index_controller.dart';
// import 'package:rogapp/routes/app_pages.dart';
// import 'package:url_launcher/url_launcher.dart';
class BottomSheetWidget extends StatelessWidget {
//const BottomSheetWidget({ Key? key }, GeoJsonFeature? pt) : super(key: key);
// class BottomSheetWidget extends StatelessWidget {
// //const BottomSheetWidget({ Key? key }, GeoJsonFeature? pt) : super(key: key);
final IndexController indexController = Get.find<IndexController>();
// final IndexController indexController = Get.find<IndexController>();
Image getImage(GeoJsonFeature? gf){
if(gf!.properties!["photos"] == null || gf.properties!["photos"] == ""){
return Image(image: AssetImage('assets/images/empty_image.png'));
}
else{
return Image(image: NetworkImage(
gf.properties!["photos"],
),
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Image.asset("assets/images/empty_image.png");
},
);
}
}
// Image getImage(GeoJsonFeature? gf){
// if(gf!.properties!["photos"] == null || gf.properties!["photos"] == ""){
// return Image(image: AssetImage('assets/images/empty_image.png'));
// }
// else{
// return Image(image: NetworkImage(
// gf.properties!["photos"],
// ),
// errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
// return Image.asset("assets/images/empty_image.png");
// },
// );
// }
// }
void _launchURL(url) async {
if (!await launch(url)) throw 'Could not launch $url';
}
// void _launchURL(url) async {
// if (!await launch(url)) throw 'Could not launch $url';
// }
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 5.0,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
MaterialButton(
onPressed: () {
indexController.makePrevious(indexController.currentFeature[0]);
},
color: Colors.blue,
textColor: Colors.white,
child: Icon(
Icons.arrow_back_ios,
size: 14,
),
padding: EdgeInsets.all(14),
shape: CircleBorder(),
),
Expanded(
child: Container(
alignment: Alignment.center,
child: Obx(() =>
Text(indexController.currentFeature[0].properties!["location_name"], style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
)
),
),
),
MaterialButton(
onPressed: () {
indexController.makeNext(indexController.currentFeature[0]);
},
color: Colors.blue,
textColor: Colors.white,
child: Icon(
Icons.arrow_forward_ios,
size: 14,
),
padding: EdgeInsets.all(14),
shape: CircleBorder(),
),
],
),
Row(
children: [
Expanded(
child: SizedBox(
height: 260.0,
child: Obx(() => getImage(indexController.currentFeature[0])),
)
),
],
),
Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
children: [
indexController.currentFeature[0].properties!["address"] != null ?
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Container(
alignment: Alignment.topRight,
child: Text("address".tr, style: TextStyle(fontWeight: FontWeight.bold),)),
),
SizedBox(width: 12.0,),
Expanded(
child: Container(
alignment: Alignment.topLeft,
child: Obx(() => Text(indexController.currentFeature[0].properties!["address"] ?? '',
style: TextStyle(color: Colors.blue,),
softWrap: true,
overflow: TextOverflow.ellipsis,)
),
),
)
],
): Container(width: 0.0, height: 0,),
indexController.currentFeature[0].properties!["phone"] != null ?
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child: Container(
alignment: Alignment.topRight,
child: Text("telephone".tr, style: TextStyle(fontWeight: FontWeight.bold),))),
SizedBox(width: 12.0,),
Expanded(
child: Container(
alignment: Alignment.topLeft,
child: Obx(() => Text(indexController.currentFeature[0].properties!["phone"] ?? '',
style: TextStyle(color: Colors.blue,),
overflow: TextOverflow.ellipsis,)
),
),
)
],
): Container(width: 0, height: 0,),
indexController.currentFeature[0].properties!["email"] != null ?
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child: Container(
alignment: Alignment.topRight,
child: Text("email".tr, style: TextStyle(fontWeight: FontWeight.bold),))),
SizedBox(width: 12.0,),
Expanded(
child: Container(
alignment: Alignment.topLeft,
child: Obx(() => Text(indexController.currentFeature[0].properties!["email"] ?? '',
style: TextStyle(color: Colors.blue,),
overflow: TextOverflow.ellipsis,)
),
),
)
],
): Container(width: 0, height: 0,),
indexController.currentFeature[0].properties!["webcontents"] != null ?
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child: Container(
alignment: Alignment.topRight,
child: Text(
"web".tr, style: TextStyle(fontWeight: FontWeight.bold)))),
SizedBox(width: 12.0,),
Expanded(
child: Container(
alignment: Alignment.topLeft,
child: Obx(() => InkWell(
onTap: (){
_launchURL(indexController.currentFeature[0].properties!["webcontents"]);
},
child: Text(indexController.currentFeature[0].properties!["webcontents"] ?? '',
style: TextStyle(color: Colors.blue,),
softWrap: false,
overflow: TextOverflow.fade,),
)),
),
)
],
): Container(width: 0.0, height: 0.0,),
indexController.currentFeature[0].properties!["videos"] != null ?
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child: Container(
alignment: Alignment.topRight,
child: Text("video".tr, style: TextStyle(fontWeight: FontWeight.bold)))),
SizedBox(width: 12.0,),
Expanded(
child: Container(
alignment: Alignment.topLeft,
child: Obx(() => Text(indexController.currentFeature[0].properties!["videos"] ?? '',
style: TextStyle(color: Colors.blue,),
overflow: TextOverflow.ellipsis,)
),
),
)
],
): Container(width: 0.0, height: 0.0,),
],
),
),
),
],
),
SizedBox(height: 20.0,),
Obx(() =>
indexController.currentAction.isNotEmpty ?
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
indexController.rog_mode.value == 0 ?
// @override
// Widget build(BuildContext context) {
// return SingleChildScrollView(
// child: Column(
// children: [
// SizedBox(height: 5.0,),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// MaterialButton(
// onPressed: () {
// indexController.makePrevious(indexController.currentFeature[0]);
// },
// color: Colors.blue,
// textColor: Colors.white,
// child: Icon(
// Icons.arrow_back_ios,
// size: 14,
// ),
// padding: EdgeInsets.all(14),
// shape: CircleBorder(),
// ),
// Expanded(
// child: Container(
// alignment: Alignment.center,
// child: Obx(() =>
// Text(indexController.currentFeature[0].properties!["location_name"], style: TextStyle(
// fontSize: 15.0,
// fontWeight: FontWeight.bold,
// ),
// )
// ),
// ),
// ),
// MaterialButton(
// onPressed: () {
// indexController.makeNext(indexController.currentFeature[0]);
// },
// color: Colors.blue,
// textColor: Colors.white,
// child: Icon(
// Icons.arrow_forward_ios,
// size: 14,
// ),
// padding: EdgeInsets.all(14),
// shape: CircleBorder(),
// ),
// ],
// ),
// Row(
// children: [
// Expanded(
// child: SizedBox(
// height: 260.0,
// child: Obx(() => getImage(indexController.currentFeature[0])),
// )
// ),
// ],
// ),
// Row(
// children: [
// Expanded(
// child: Padding(
// padding: const EdgeInsets.symmetric(horizontal: 10.0),
// child: Column(
// children: [
// indexController.currentFeature[0].properties!["address"] != null ?
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Expanded(
// child: Container(
// alignment: Alignment.topRight,
// child: Text("address".tr, style: TextStyle(fontWeight: FontWeight.bold),)),
// ),
// SizedBox(width: 12.0,),
// Expanded(
// child: Container(
// alignment: Alignment.topLeft,
// child: Obx(() => Text(indexController.currentFeature[0].properties!["address"] ?? '',
// style: TextStyle(color: Colors.blue,),
// softWrap: true,
// overflow: TextOverflow.ellipsis,)
// ),
// ),
// )
// ],
// ): Container(width: 0.0, height: 0,),
// indexController.currentFeature[0].properties!["phone"] != null ?
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Expanded(child: Container(
// alignment: Alignment.topRight,
// child: Text("telephone".tr, style: TextStyle(fontWeight: FontWeight.bold),))),
// SizedBox(width: 12.0,),
// Expanded(
// child: Container(
// alignment: Alignment.topLeft,
// child: Obx(() => Text(indexController.currentFeature[0].properties!["phone"] ?? '',
// style: TextStyle(color: Colors.blue,),
// overflow: TextOverflow.ellipsis,)
// ),
// ),
// )
// ],
// ): Container(width: 0, height: 0,),
// indexController.currentFeature[0].properties!["email"] != null ?
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Expanded(child: Container(
// alignment: Alignment.topRight,
// child: Text("email".tr, style: TextStyle(fontWeight: FontWeight.bold),))),
// SizedBox(width: 12.0,),
// Expanded(
// child: Container(
// alignment: Alignment.topLeft,
// child: Obx(() => Text(indexController.currentFeature[0].properties!["email"] ?? '',
// style: TextStyle(color: Colors.blue,),
// overflow: TextOverflow.ellipsis,)
// ),
// ),
// )
// ],
// ): Container(width: 0, height: 0,),
// indexController.currentFeature[0].properties!["webcontents"] != null ?
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Expanded(child: Container(
// alignment: Alignment.topRight,
// child: Text(
// "web".tr, style: TextStyle(fontWeight: FontWeight.bold)))),
// SizedBox(width: 12.0,),
// Expanded(
// child: Container(
// alignment: Alignment.topLeft,
// child: Obx(() => InkWell(
// onTap: (){
// _launchURL(indexController.currentFeature[0].properties!["webcontents"]);
// },
// child: Text(indexController.currentFeature[0].properties!["webcontents"] ?? '',
// style: TextStyle(color: Colors.blue,),
// softWrap: false,
// overflow: TextOverflow.fade,),
// )),
// ),
// )
// ],
// ): Container(width: 0.0, height: 0.0,),
// indexController.currentFeature[0].properties!["videos"] != null ?
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Expanded(child: Container(
// alignment: Alignment.topRight,
// child: Text("video".tr, style: TextStyle(fontWeight: FontWeight.bold)))),
// SizedBox(width: 12.0,),
// Expanded(
// child: Container(
// alignment: Alignment.topLeft,
// child: Obx(() => Text(indexController.currentFeature[0].properties!["videos"] ?? '',
// style: TextStyle(color: Colors.blue,),
// overflow: TextOverflow.ellipsis,)
// ),
// ),
// )
// ],
// ): Container(width: 0.0, height: 0.0,),
// ],
// ),
// ),
// ),
// ],
// ),
// SizedBox(height: 20.0,),
// Obx(() =>
// indexController.currentAction.isNotEmpty ?
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: [
// indexController.rog_mode.value == 0 ?
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
children: [
indexController.currentAction[0][0]["wanttogo"] == false ?
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["wanttogo"] = true;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
child: Text("want_to_go".tr)
) :
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["wanttogo"] = false;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
// Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// indexController.currentAction[0][0]["wanttogo"] == false ?
// ElevatedButton(
// onPressed: (){
// if(indexController.currentAction.isNotEmpty){
// print(indexController.currentAction[0]);
// indexController.currentAction[0][0]["wanttogo"] = true;
// Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
// indexController.currentAction.clear();
// print("---temp---${temp}");
// indexController.currentAction.add([temp]);
// }
// indexController.makeAction(context);
// },
// child: Text("want_to_go".tr)
// ) :
// ElevatedButton(
// onPressed: (){
// if(indexController.currentAction.isNotEmpty){
// print(indexController.currentAction[0]);
// indexController.currentAction[0][0]["wanttogo"] = false;
// Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
// indexController.currentAction.clear();
// print("---temp---${temp}");
// indexController.currentAction.add([temp]);
// }
// indexController.makeAction(context);
// },
child: IconButton(
icon: Icon(Icons.favorite, color: Colors.red, semanticLabel: "want_to_go".tr,), onPressed: () {
// child: IconButton(
// icon: Icon(Icons.favorite, color: Colors.red, semanticLabel: "want_to_go".tr,), onPressed: () {
},
// },
)
),
indexController.currentAction[0][0]["like"] == false ?
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["like"] = true;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
child: Text("like".tr)
) :
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["like"] = false;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
// )
// ),
// indexController.currentAction[0][0]["like"] == false ?
// ElevatedButton(
// onPressed: (){
// if(indexController.currentAction.isNotEmpty){
// print(indexController.currentAction[0]);
// indexController.currentAction[0][0]["like"] = true;
// Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
// indexController.currentAction.clear();
// print("---temp---${temp}");
// indexController.currentAction.add([temp]);
// }
// indexController.makeAction(context);
// },
// child: Text("like".tr)
// ) :
// ElevatedButton(
// onPressed: (){
// if(indexController.currentAction.isNotEmpty){
// print(indexController.currentAction[0]);
// indexController.currentAction[0][0]["like"] = false;
// Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
// indexController.currentAction.clear();
// print("---temp---${temp}");
// indexController.currentAction.add([temp]);
// }
// indexController.makeAction(context);
// },
child: IconButton(
icon: Icon(Icons.favorite, color: Colors.red, semanticLabel: "like".tr,), onPressed: () {
// child: IconButton(
// icon: Icon(Icons.favorite, color: Colors.red, semanticLabel: "like".tr,), onPressed: () {
},
// },
)
),
],
)
// )
// ),
// ],
// )
:
Container(width: 0, height: 0,),
indexController.rog_mode.value == 1 ?
indexController.currentAction[0][0]["checkin"] == false ?
Column(
children: [
Row(
mainAxisSize: MainAxisSize.max,
children: [
ElevatedButton(
child: Text("Image"), onPressed: (){
final ImagePicker _picker = ImagePicker();
_picker.pickImage(source: ImageSource.camera).then((value){
print("----- image---- ${value!.path}");
});
},
)
],
),
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["checkin"] = true;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
child: Text("checkin".tr)
)
],
)
:
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["checkin"] = false;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
// :
// Container(width: 0, height: 0,),
// indexController.rog_mode.value == 1 ?
// indexController.currentAction[0][0]["checkin"] == false ?
// Column(
// children: [
// Row(
// mainAxisSize: MainAxisSize.max,
// children: [
// ElevatedButton(
// child: Text("Image"), onPressed: (){
// final ImagePicker _picker = ImagePicker();
// _picker.pickImage(source: ImageSource.camera).then((value){
// print("----- image---- ${value!.path}");
// });
// },
// )
// ],
// ),
// ElevatedButton(
// onPressed: (){
// if(indexController.currentAction.isNotEmpty){
// print(indexController.currentAction[0]);
// indexController.currentAction[0][0]["checkin"] = true;
// Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
// indexController.currentAction.clear();
// print("---temp---${temp}");
// indexController.currentAction.add([temp]);
// }
// indexController.makeAction(context);
// },
// child: Text("checkin".tr)
// )
// ],
// )
// :
// ElevatedButton(
// onPressed: (){
// if(indexController.currentAction.isNotEmpty){
// print(indexController.currentAction[0]);
// indexController.currentAction[0][0]["checkin"] = false;
// Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
// indexController.currentAction.clear();
// print("---temp---${temp}");
// indexController.currentAction.add([temp]);
// }
// indexController.makeAction(context);
// },
child: Icon(
Icons.favorite, color: Colors.red)
// child: Icon(
// Icons.favorite, color: Colors.red)
,
):
Container(width: 0, height: 0,),
],
): Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
onPressed: (){
Get.toNamed(AppPages.LOGIN);
},
child: Flexible(child: Text("その他のオプションについてはログインしてください")))
],
),
),
Row(
children: [
SizedBox(height: 60.0,),
],
)
],
),
);
}
}
// ,
// ):
// Container(width: 0, height: 0,),
// ],
// ): Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// TextButton(
// onPressed: (){
// Get.toNamed(AppPages.LOGIN);
// },
// child: Flexible(child: Text("その他のオプションについてはログインしてください")))
// ],
// ),
// ),
// Row(
// children: [
// SizedBox(height: 60.0,),
// ],
// )
// ],
// ),
// );
// }
// }

View File

@ -1,34 +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';
// 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, this.mapController}) : super(key: key);
// class BreadCrumbWidget extends StatelessWidget {
// BreadCrumbWidget({Key? key, this.mapController}) : super(key: key);
final MapController? mapController;
// final MapController? mapController;
final IndexController indexController = Get.find<IndexController>();
// final IndexController indexController = Get.find<IndexController>();
@override
Widget build(BuildContext context) {
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")
);
}
}
// @override
// Widget build(BuildContext context) {
// 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")
// );
// }
// }

View File

@ -1,50 +1,50 @@
import 'package:flutter/material.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/services/location_service.dart';
// import 'package:flutter/material.dart';
// import 'package:rogapp/pages/index/index_controller.dart';
// import 'package:rogapp/services/location_service.dart';
class CatWidget extends StatefulWidget {
CatWidget({ Key? key, required this.indexController, }) : super(key: key);
// class CatWidget extends StatefulWidget {
// CatWidget({ Key? key, required this.indexController, }) : super(key: key);
IndexController indexController;
// IndexController indexController;
@override
State<CatWidget> createState() => _CatWidgetState();
}
// @override
// State<CatWidget> createState() => _CatWidgetState();
// }
class _CatWidgetState extends State<CatWidget> {
String defaultValue = "---";
// class _CatWidgetState extends State<CatWidget> {
// String defaultValue = "---";
@override
Widget build(BuildContext context) {
return
PopupMenuButton(
onSelected: (value) {
widget.indexController.currentCat.clear();
widget.indexController.currentCat.add(value.toString());
widget.indexController.refreshLocationForCat();
setState(() {
print(value);
//widget.indexController.is_loading.value = true;
defaultValue = value.toString();
});
},
itemBuilder: (BuildContext context){
List<PopupMenuItem> itms = <PopupMenuItem>[];
for(dynamic d in widget.indexController.cats[0]){
PopupMenuItem itm = PopupMenuItem(child: Text(d['category'].toString()), value: d['category'].toString());
itms.add(itm);
}
return itms;
}
// @override
// Widget build(BuildContext context) {
// return
// PopupMenuButton(
// onSelected: (value) {
// widget.indexController.currentCat.clear();
// widget.indexController.currentCat.add(value.toString());
// widget.indexController.refreshLocationForCat();
// setState(() {
// print(value);
// //widget.indexController.is_loading.value = true;
// defaultValue = value.toString();
// });
// },
// itemBuilder: (BuildContext context){
// List<PopupMenuItem> itms = <PopupMenuItem>[];
// for(dynamic d in widget.indexController.cats[0]){
// PopupMenuItem itm = PopupMenuItem(child: Text(d['category'].toString()), value: d['category'].toString());
// itms.add(itm);
// }
// return itms;
// }
);
}
}
// );
// }
// }
// widget.indexController.cats.map((e) =>
// PopupMenuItem(
// value: defaultValue,
// child: Text(e[0]['category'].toString()),
// )
// ).toList(),
// // widget.indexController.cats.map((e) =>
// // PopupMenuItem(
// // value: defaultValue,
// // child: Text(e[0]['category'].toString()),
// // )
// // ).toList(),

View File

@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:latlong2/latlong.dart';
class CollapsedWidget extends StatelessWidget {
void Function()? addIncident;
CollapsedWidget({ this.addIncident, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
onPressed: addIncident,
icon: Icon(Icons.add_circle_outline_rounded, size: 30,)),
],
),
)
],
),
);
}
}

View File

@ -1,219 +1,219 @@
import 'dart:ffi';
// 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';
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
import 'package:timeline_tile/timeline_tile.dart';
// 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';
// import 'package:rogapp/widgets/bottom_sheet_widget.dart';
// import 'package:timeline_tile/timeline_tile.dart';
class DestinationWidget extends StatelessWidget {
DestinationWidget({ Key? key }) : super(key: key);
// class DestinationWidget extends StatelessWidget {
// DestinationWidget({ Key? key }) : super(key: key);
final DestinationController destinationController = Get.find<DestinationController>();
// final DestinationController destinationController = Get.find<DestinationController>();
final IndexController indexController = Get.find<IndexController>();
// final IndexController indexController = Get.find<IndexController>();
final List<int> _items = List<int>.generate(50, (int index) => index);
// final List<int> _items = List<int>.generate(50, (int index) => index);
Image getImage(int index){
if(destinationController.destinations[index].photos== null || destinationController.destinations[index].photos == ""){
return Image(image: AssetImage('assets/images/empty_image.png'));
}
else{
print("------- image is ${destinationController.destinations[index].photos!}------");
return Image(image: NetworkImage(
destinationController.destinations[index].photos!),
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Image.asset("assets/images/empty_image.png");
},
);
}
}
// Image getImage(int index){
// if(destinationController.destinations[index].photos== null || destinationController.destinations[index].photos == ""){
// return Image(image: AssetImage('assets/images/empty_image.png'));
// }
// else{
// print("------- image is ${destinationController.destinations[index].photos!}------");
// return Image(image: NetworkImage(
// destinationController.destinations[index].photos!),
// errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
// return Image.asset("assets/images/empty_image.png");
// },
// );
// }
// }
bool getSelection(int index){
bool ret = false;
destinationController.destination_index_data.forEach((element) {
if(index == element["index"]){
if(element["selected"] == true){
ret = true;
return;
}
}
});
return ret;
}
// bool getSelection(int index){
// bool ret = false;
// destinationController.destination_index_data.forEach((element) {
// if(index == element["index"]){
// if(element["selected"] == true){
// ret = true;
// return;
// }
// }
// });
// return ret;
// }
void doDelete() {
destinationController.currentSelectedDestinations.forEach((element) {
destinationController.deleteDestination(element);
});
// destinationController.destination_index_data.forEach((element) {
// //print(element["index"]);
// destinationController.deleteDestination(element["index"]);
// });
// destinationController.destination_index_data.clear();
}
// void doDelete() {
// destinationController.currentSelectedDestinations.forEach((element) {
// destinationController.deleteDestination(element);
// });
// // destinationController.destination_index_data.forEach((element) {
// // //print(element["index"]);
// // destinationController.deleteDestination(element["index"]);
// // });
// // destinationController.destination_index_data.clear();
// }
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");
});
}
// 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");
// });
// }
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");
});
}
// 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");
// });
// }
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");
// 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");
// });
}
// // });
// }
@override
Widget build(BuildContext context) {
// @override
// Widget build(BuildContext context) {
print("------ destination widget------ ${destinationController.destinationCount.value} ----------");
// print("------ destination widget------ ${destinationController.destinationCount.value} ----------");
return
Obx(() =>
Stack(
children: [
Padding(
padding: const EdgeInsets.only(top:45.0),
child: ListView.builder(
itemCount: destinationController.destinationCount.value,
// return
// Obx(() =>
// Stack(
// children: [
// Padding(
// padding: const EdgeInsets.only(top:45.0),
// child: ListView.builder(
// itemCount: destinationController.destinationCount.value,
itemBuilder: (BuildContext context, int index) {
return
TimelineTile(
alignment: TimelineAlign.manual,
lineXY: 0.2,
isFirst: index == 0 ? true : false,
indicatorStyle: IndicatorStyle(
color: index == 0 ? (Colors.red) : (Colors.grey[400])!
),
key: Key(index.toString()),
endChild: Card(
child: Container(
constraints: const BoxConstraints(
minHeight: 80,
),
child: ListTile(
onTap: () async {
{
Destination? fs = destinationController.destinations[index];
print("----fsf-----${fs}");
if(fs != null){
// itemBuilder: (BuildContext context, int index) {
// return
// TimelineTile(
// alignment: TimelineAlign.manual,
// lineXY: 0.2,
// isFirst: index == 0 ? true : false,
// indicatorStyle: IndicatorStyle(
// color: index == 0 ? (Colors.red) : (Colors.grey[400])!
// ),
// key: Key(index.toString()),
// endChild: Card(
// child: Container(
// constraints: const BoxConstraints(
// minHeight: 80,
// ),
// child: ListTile(
// onTap: () async {
// {
// Destination? fs = destinationController.destinations[index];
// print("----fsf-----${fs}");
// if(fs != null){
if(indexController.currentDestinationFeature.length > 0) {
indexController.currentDestinationFeature.clear();
}
indexController.currentDestinationFeature.add(fs);
//indexController.getAction();
// if(indexController.currentDestinationFeature.length > 0) {
// indexController.currentDestinationFeature.clear();
// }
// indexController.currentDestinationFeature.add(fs);
// //indexController.getAction();
showModalBottomSheet(context: context, isScrollControlled: true,
//builder:((context) => BottomSheetWidget())
builder:((context) => BottomSheetNew())
);
}
};
},
onLongPress: (){
// showModalBottomSheet(context: context, isScrollControlled: true,
// //builder:((context) => BottomSheetWidget())
// builder:((context) => BottomSheetNew())
// );
// }
// };
// },
// onLongPress: (){
Destination? match_element = null;
destinationController.currentSelectedDestinations.forEach((element) {
if(element.location_id == destinationController.destinations[index].location_id){
match_element = element;
return;
}
});
// Destination? match_element = null;
// destinationController.currentSelectedDestinations.forEach((element) {
// if(element.location_id == destinationController.destinations[index].location_id){
// match_element = element;
// return;
// }
// });
if(match_element != null){
destinationController.currentSelectedDestinations.remove(destinationController.destinations[index]);
}
// if(match_element != null){
// destinationController.currentSelectedDestinations.remove(destinationController.destinations[index]);
// }
destinationController.currentSelectedDestinations.add(destinationController.destinations[index]);
// destinationController.currentSelectedDestinations.add(destinationController.destinations[index]);
destinationController.PopulateDestinations();
// destinationController.PopulateDestinations();
},
selectedTileColor: Colors.amberAccent,
selected:destinationController.destinations[index].selected!,
leading: getImage(index),
title: Text(destinationController.destinations[index].name!),
subtitle: Text(destinationController.destinations[index].category!),
),
),
),
startChild:
destinationController.matrix["rows"][0]["elements"] != null ?
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
//Text(destinationController.matrix["rows"][0]["elements"][index]["distance"]["text"].toString()),
//Text(destinationController.matrix["rows"][0]["elements"][index]["duration"]["text"].toString())
],
):
Container()
,
);
// },
// selectedTileColor: Colors.amberAccent,
// selected:destinationController.destinations[index].selected!,
// leading: getImage(index),
// title: Text(destinationController.destinations[index].name!),
// subtitle: Text(destinationController.destinations[index].category!),
// ),
// ),
// ),
// startChild:
// destinationController.matrix["rows"][0]["elements"] != null ?
// Column(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// children: [
// //Text(destinationController.matrix["rows"][0]["elements"][index]["distance"]["text"].toString()),
// //Text(destinationController.matrix["rows"][0]["elements"][index]["duration"]["text"].toString())
// ],
// ):
// Container()
// ,
// );
}
),
),
Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
spreadRadius: 5,
blurRadius: 3,
offset: Offset(0, 7), // changes position of shadow
),
],
),
height: 44.0,
width: MediaQuery.of(context).size.width,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
IconButton(
icon:Icon(Icons.cancel),
//onPressed: (){doDelete();},
onPressed: destinationController.currentSelectedDestinations.length > 0 ? doDelete : null,
),
IconButton(
icon:Icon(Icons.move_up),
onPressed: destinationController.destination_index_data.length > 0 ? moveUp : null,
),
IconButton(
icon:Icon(Icons.move_down),
onPressed: destinationController.destination_index_data.length > 0 ? moveDown : null,
),
IconButton(
icon:Icon(Icons.sync),
onPressed: destinationController.destination_index_data.length == 2 ? interChange : null,
),
],
),
)
],
)
);
}
}
// }
// ),
// ),
// Container(
// decoration: BoxDecoration(
// boxShadow: [
// BoxShadow(
// color: Colors.grey.withOpacity(0.3),
// spreadRadius: 5,
// blurRadius: 3,
// offset: Offset(0, 7), // changes position of shadow
// ),
// ],
// ),
// height: 44.0,
// width: MediaQuery.of(context).size.width,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// IconButton(
// icon:Icon(Icons.cancel),
// //onPressed: (){doDelete();},
// onPressed: destinationController.currentSelectedDestinations.length > 0 ? doDelete : null,
// ),
// IconButton(
// icon:Icon(Icons.move_up),
// onPressed: destinationController.destination_index_data.length > 0 ? moveUp : null,
// ),
// IconButton(
// icon:Icon(Icons.move_down),
// onPressed: destinationController.destination_index_data.length > 0 ? moveDown : null,
// ),
// IconButton(
// icon:Icon(Icons.sync),
// onPressed: destinationController.destination_index_data.length == 2 ? interChange : null,
// ),
// ],
// ),
// )
// ],
// )
// );
// }
// }

View File

@ -1,45 +1,45 @@
import 'package:flutter/material.dart';
import 'package:rogapp/pages/search/search_page.dart';
// import 'package:flutter/material.dart';
// import 'package:rogapp/pages/search/search_page.dart';
class FakeSearch extends StatelessWidget {
const FakeSearch({
Key? key,
}) : super(key: key);
// 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) => 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),
// @override
// Widget build(BuildContext context) {
// return InkWell(
// onTap: (){
// Navigator.push(context, MaterialPageRoute(builder: (context) => 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),)),
)
// ),
// child: const Center(child: Text("Search", style: TextStyle(fontSize: 16, color: Colors.white),)),
// )
],
),
),
);
}
}
// ],
// ),
// ),
// );
// }
// }

View File

@ -1,63 +1,63 @@
import 'package:flutter/material.dart';
import 'package:geojson/geojson.dart';
import 'package:get/get.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/widgets/bottom_sheet_new.dart';
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
// import 'package:flutter/material.dart';
// import 'package:geojson/geojson.dart';
// import 'package:get/get.dart';
// import 'package:rogapp/pages/index/index_controller.dart';
// import 'package:rogapp/widgets/bottom_sheet_new.dart';
// import 'package:rogapp/widgets/bottom_sheet_widget.dart';
class ListWidget extends StatelessWidget {
ListWidget({ Key? key }) : super(key: key);
// class ListWidget extends StatelessWidget {
// ListWidget({ Key? key }) : super(key: key);
final IndexController indexController = Get.find<IndexController>();
// final IndexController indexController = Get.find<IndexController>();
Image getImage(int index){
if(indexController.locations[0].collection[index].properties!["photos"] == null || indexController.locations[0].collection[index].properties!["photos"] == ""){
return Image(image: AssetImage('assets/images/empty_image.png'));
}
else{
return Image(
image: NetworkImage(indexController.locations[0].collection[index].properties!["photos"]),
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Image.asset("assets/images/empty_image.png");
},
);
}
}
// Image getImage(int index){
// if(indexController.locations[0].collection[index].properties!["photos"] == null || indexController.locations[0].collection[index].properties!["photos"] == ""){
// return Image(image: AssetImage('assets/images/empty_image.png'));
// }
// else{
// return Image(
// image: NetworkImage(indexController.locations[0].collection[index].properties!["photos"]),
// errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
// return Image.asset("assets/images/empty_image.png");
// },
// );
// }
// }
void changeCurrentFeature(GeoJsonFeature fs){
if(indexController.currentFeature.length > 0){
indexController.currentFeature.clear();
}
indexController.currentFeature.add(fs);
}
// void changeCurrentFeature(GeoJsonFeature fs){
// if(indexController.currentFeature.length > 0){
// indexController.currentFeature.clear();
// }
// indexController.currentFeature.add(fs);
// }
@override
Widget build(BuildContext context) {
return Obx(() =>
indexController.locations.length > 0 ?
ListView.builder(
itemCount: indexController.locations[0].collection.length,
shrinkWrap: true,
itemBuilder: (_, index){
return Card(
child: ListTile(
onTap: (){
GeoJsonFeature gf = indexController.locations[0].collection[index];
changeCurrentFeature(gf);
showModalBottomSheet(
isScrollControlled: true,
context: context,
//builder: (context) => BottomSheetWidget(),
builder:((context) => BottomSheetNew())
);
},
leading: getImage(index),
title: indexController.locations[0].collection[index].properties!['location_name'] != null ? Text(indexController.locations[0].collection[index].properties!['location_name'].toString()) : Text(""),
subtitle: indexController.locations[0].collection[index].properties!['category'] != null ? Text(indexController.locations[0].collection[index].properties!['category']) : Text(""),
),
);
},
) : Container(width: 0, height: 0,),
);
}
}
// @override
// Widget build(BuildContext context) {
// return Obx(() =>
// indexController.locations.length > 0 ?
// ListView.builder(
// itemCount: indexController.locations[0].collection.length,
// shrinkWrap: true,
// itemBuilder: (_, index){
// return Card(
// child: ListTile(
// onTap: (){
// GeoJsonFeature gf = indexController.locations[0].collection[index];
// changeCurrentFeature(gf);
// showModalBottomSheet(
// isScrollControlled: true,
// context: context,
// //builder: (context) => BottomSheetWidget(),
// builder:((context) => BottomSheetNew())
// );
// },
// leading: getImage(index),
// title: indexController.locations[0].collection[index].properties!['location_name'] != null ? Text(indexController.locations[0].collection[index].properties!['location_name'].toString()) : Text(""),
// subtitle: indexController.locations[0].collection[index].properties!['category'] != null ? Text(indexController.locations[0].collection[index].properties!['category']) : Text(""),
// ),
// );
// },
// ) : Container(width: 0, height: 0,),
// );
// }
// }

View File

@ -1,150 +1,150 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_map/plugin_api.dart';
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
import 'package:flutter_map_marker_cluster/flutter_map_marker_cluster.dart';2
import 'package:get/get.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:latlong2/latlong.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/widgets/base_layer_widget.dart';
import 'package:rogapp/widgets/bottom_sheet_new.dart';
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
// import 'dart:async';
// import 'package:flutter/material.dart';
// import 'package:flutter_map/plugin_api.dart';
// import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
// import 'package:flutter_map_marker_cluster/flutter_map_marker_cluster.dart';2
// import 'package:get/get.dart';
// import 'package:get/get_state_manager/get_state_manager.dart';
// import 'package:latlong2/latlong.dart';
// import 'package:rogapp/pages/index/index_controller.dart';
// import 'package:rogapp/widgets/base_layer_widget.dart';
// import 'package:rogapp/widgets/bottom_sheet_new.dart';
// import 'package:rogapp/widgets/bottom_sheet_widget.dart';
class MapWidget extends StatelessWidget {
// class MapWidget extends StatelessWidget {
final IndexController indexController = Get.find<IndexController>();
// final IndexController indexController = Get.find<IndexController>();
MapWidget({ Key? key}) : super(key: key);
// MapWidget({ Key? key}) : super(key: key);
StreamSubscription? subscription;
// StreamSubscription? subscription;
@override
Widget build(BuildContext context) {
// @override
// Widget build(BuildContext context) {
print("---------- rog mode is ${indexController.rog_mode.value.toString()}----------");
// print("---------- rog mode is ${indexController.rog_mode.value.toString()}----------");
final PopupController _popupController = PopupController();
return Stack(
children: [
Obx(() =>
indexController.is_loading == true ? Padding(
padding: const EdgeInsets.only(top: 60.0),
child: CircularProgressIndicator(),
):
FlutterMap(
//mapController: mapController,
options: MapOptions(
onMapCreated: (c){
indexController.mapController = c;
// final PopupController _popupController = PopupController();
// return Stack(
// children: [
// Obx(() =>
// indexController.is_loading == true ? Padding(
// padding: const EdgeInsets.only(top: 60.0),
// child: CircularProgressIndicator(),
// ):
// FlutterMap(
// //mapController: mapController,
// options: MapOptions(
// onMapCreated: (c){
// 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');
// do something
}
if (mapEvent is MapEventMoveEnd) {
//print(DateTime.now().toString() + ' [MapEventMoveStart] END');
indexController.loadLocationsBound();
}
});
});
// 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');
// // do something
// }
// if (mapEvent is MapEventMoveEnd) {
// //print(DateTime.now().toString() + ' [MapEventMoveStart] END');
// indexController.loadLocationsBound();
// }
// });
// });
},
//center: LatLng(37.15319600454702, 139.58765950528198),
bounds: indexController.currentBound.length > 0 ? indexController.currentBound[0]: LatLngBounds.fromPoints([LatLng(35.03999881162295, 136.40587119778962), LatLng(36.642756778706904, 137.95226720406063)]),
zoom: 1,
maxZoom: 24,
interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag,
plugins: [
MarkerClusterPlugin(),
],
// },
// //center: LatLng(37.15319600454702, 139.58765950528198),
// bounds: indexController.currentBound.length > 0 ? indexController.currentBound[0]: LatLngBounds.fromPoints([LatLng(35.03999881162295, 136.40587119778962), LatLng(36.642756778706904, 137.95226720406063)]),
// zoom: 1,
// maxZoom: 24,
// interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag,
// plugins: [
// MarkerClusterPlugin(),
// ],
onPositionChanged: (MapPosition pos, isvalue){
},
onTap: (_, __) =>
_popupController
.hideAllPopups(), // Hide popup when the map is tapped.
),
children: [
BaseLayer(),
LocationMarkerLayerWidget(),
// onPositionChanged: (MapPosition pos, isvalue){
// },
// onTap: (_, __) =>
// _popupController
// .hideAllPopups(), // Hide popup when the map is tapped.
// ),
// children: [
// BaseLayer(),
// LocationMarkerLayerWidget(),
indexController.locations.length > 0 ?
MarkerClusterLayerWidget(
options: MarkerClusterLayerOptions(
spiderfyCircleRadius: 0,
spiderfySpiralDistanceMultiplier: 2,
circleSpiralSwitchover: 12,
maxClusterRadius: 0,
rotate: true,
onMarkerTap: (marker){
GeoJsonFeature? fs = indexController.getFeatureForLatLong(marker.point.latitude, marker.point.longitude);
//print("------- fs ${fs}------");
if(fs != null){
indexController.currentFeature.clear();
indexController.currentFeature.add(fs);
//print("----- fs is ${fs.properties!['photos']}");
indexController.getAction();
// indexController.locations.length > 0 ?
// MarkerClusterLayerWidget(
// options: MarkerClusterLayerOptions(
// spiderfyCircleRadius: 0,
// spiderfySpiralDistanceMultiplier: 2,
// circleSpiralSwitchover: 12,
// maxClusterRadius: 0,
// rotate: true,
// onMarkerTap: (marker){
// GeoJsonFeature? fs = indexController.getFeatureForLatLong(marker.point.latitude, marker.point.longitude);
// //print("------- fs ${fs}------");
// if(fs != null){
// indexController.currentFeature.clear();
// indexController.currentFeature.add(fs);
// //print("----- fs is ${fs.properties!['photos']}");
// indexController.getAction();
showModalBottomSheet(
context: context,
isScrollControlled: true,
isDismissible: true,
builder:((context) => BottomSheetNew())
//builder:((context) => BottomSheetWidget())
);
}
// showModalBottomSheet(
// context: context,
// isScrollControlled: true,
// isDismissible: true,
// builder:((context) => BottomSheetNew())
// //builder:((context) => BottomSheetWidget())
// );
// }
},
// },
size: Size(40, 40),
anchor: AnchorPos.align(AnchorAlign.center),
fitBoundsOptions: const FitBoundsOptions(
padding: EdgeInsets.all(50),
maxZoom: 265,
),
markers:indexController.locations[0].collection.map((i) {
print("i si ${i.properties!['location_id']}");
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
print("lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
return Marker(
anchorPos: AnchorPos.align(AnchorAlign.center),
height: 22.0,
width: 22.0,
point: LatLng(p.geoSerie!.geoPoints[0].latitude, p.geoSerie!.geoPoints[0].longitude),
builder: (ctx) => Icon(Icons.pin_drop),
// builder: (ctx) => i.properties!["category"] != null ?
// ImageIcon(
// AssetImage("assets/images/${i.properties!["category"]}.png"),
// color: Color(0xFF3A5A98),
// size:12.0,
// )
// : Icon(Icons.pin_drop),
// size: Size(40, 40),
// anchor: AnchorPos.align(AnchorAlign.center),
// fitBoundsOptions: const FitBoundsOptions(
// padding: EdgeInsets.all(50),
// maxZoom: 265,
// ),
// markers:indexController.locations[0].collection.map((i) {
// print("i si ${i.properties!['location_id']}");
// GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
// print("lat is ${p.geoSerie!.geoPoints[0].latitude} and lon is ${p.geoSerie!.geoPoints[0].longitude}");
// return Marker(
// anchorPos: AnchorPos.align(AnchorAlign.center),
// height: 22.0,
// width: 22.0,
// point: LatLng(p.geoSerie!.geoPoints[0].latitude, p.geoSerie!.geoPoints[0].longitude),
// builder: (ctx) => Icon(Icons.pin_drop),
// // builder: (ctx) => i.properties!["category"] != null ?
// // ImageIcon(
// // AssetImage("assets/images/${i.properties!["category"]}.png"),
// // color: Color(0xFF3A5A98),
// // size:12.0,
// // )
// // : Icon(Icons.pin_drop),
);
}).toList(),
builder: (context, markers) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.0),
color: Colors.blue),
child: Center(
child: Text(
markers.length.toString(),
style: TextStyle(color: Colors.white),
),
),
);
},
),
): Container(height:0,width: 0),
],
)
)
],
);
}
}
// );
// }).toList(),
// builder: (context, markers) {
// return Container(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(20.0),
// color: Colors.blue),
// child: Center(
// child: Text(
// markers.length.toString(),
// style: TextStyle(color: Colors.white),
// ),
// ),
// );
// },
// ),
// ): Container(height:0,width: 0),
// ],
// )
// )
// ],
// );
// }
// }

View File

@ -1,265 +1,44 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:get/get.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/widgets/cat_widget.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter_map/flutter_map.dart';
// import 'package:get/get.dart';
// import 'package:rogapp/pages/index/index_controller.dart';
// import 'package:rogapp/widgets/cat_widget.dart';
class PerfectureWidget extends StatefulWidget {
// class PerfectureWidget extends StatefulWidget {
IndexController indexController;
MapController mapController;
PerfectureWidget({Key? key, required this.indexController, required this.mapController}) : super(key: key){
//indexController.zoomtoMainPerf("9", mapController);
}
@override
State<PerfectureWidget> createState() => _PerfectureWidgetState();
}
class _PerfectureWidgetState extends State<PerfectureWidget> {
@override
void initState() {
super.initState();
}
bool isNumeric(String s) {
if (s == null) {
return false;
}
return double.tryParse(s) != null;
}
List<DropdownMenuItem<String>> getDropdownItems() {
List<DropdownMenuItem<String>> dropDownItems = [];
for (Map<String, dynamic> currency in widget.indexController.perfectures[0]) {
//print(currency["id"].toString());
var newDropdown = DropdownMenuItem(
child: Text(currency["adm1_ja"].toString()),
value: currency["id"].toString(),
);
dropDownItems.add(newDropdown);
}
return dropDownItems;
}
List<DropdownMenuItem<String>> getSubDropdownItems() {
List<DropdownMenuItem<String>> dropDownItems = [];
if(widget.indexController.subPerfs.isNotEmpty){
for (Map<String, dynamic> currency in widget.indexController.subPerfs[0]) {
var newDropdown = DropdownMenuItem(
child: Text(currency["adm2_ja"].toString()),
value: currency["id"].toString(),
);
dropDownItems.add(newDropdown);
}
}
return dropDownItems;
}
List<DropdownMenuItem<String>> getCustomArea(){
List<DropdownMenuItem<String>> dropDownItems = [];
if(widget.indexController.areas.isNotEmpty){
for (Map<String, dynamic> currency in widget.indexController.areas[0]) {
var newDropdown = DropdownMenuItem(
child: Text(currency["area_nm"].toString()),
value: currency["id"].toString(),
);
dropDownItems.add(newDropdown);
}
}
if(widget.indexController.customAreas.isNotEmpty){
for (Map<String, dynamic> currency in widget.indexController.customAreas[0]) {
var newDropdown = DropdownMenuItem(
child: Text(currency["event_name"].toString()),
value: currency["event_name"].toString(),
);
dropDownItems.add(newDropdown);
}
}
return dropDownItems;
}
List<DropdownMenuItem<String>> getCategory(){
List<DropdownMenuItem<String>> dropDownItems = [];
dropDownItems.clear();
//print("--------cats ------############### ${widget.indexController.cats.toString()} -------------");
for(dynamic d in widget.indexController.cats){
//print("-------- ddd ------############### ${d} --------dddd-----");
var newDropdown = DropdownMenuItem(child: Text(d['category'].toString()), value: d['category'].toString());
//print("--------cats ------############### ${d['category'].toString()} -------------");
dropDownItems.add(newDropdown);
}
//return [];
return dropDownItems;
}
@override
Widget build(BuildContext context) {
return Obx(() =>
Row(
children: [
DropdownButton<String>(
value: widget.indexController.dropdownValue,
icon: const Icon(Icons.arrow_downward),
elevation: 16,
style: const TextStyle(color: Colors.deepPurple),
underline: Container(
height: 2,
color: Colors.deepPurpleAccent,
),
onChanged: (String? newValue) {
//setState(() {
if(newValue != null){
widget.indexController.is_loading.value = true;
widget.indexController.dropdownValue = newValue;
widget.indexController.populateForPerf(newValue, widget.mapController);
}
//});
},
items: getDropdownItems()
),
// Gifu areas
widget.indexController.areas.isNotEmpty ?
DropdownButton<String>(
value: widget.indexController.areaDropdownValue,
icon: const Icon(Icons.arrow_downward),
elevation: 16,
style: const TextStyle(color: Colors.deepPurple),
hint: const Text("select"),
underline: Container(
height: 2,
color: Colors.deepPurpleAccent,
),
onChanged: (String? newValue) {
if (isNumeric(newValue!)){
widget.indexController.is_custom_area_selected.value = false;
}
else{
widget.indexController.loadCustomLocation(newValue);
widget.indexController.is_custom_area_selected.value = true;
widget.indexController.subPerfs.clear();
widget.indexController.cats.clear();
}
setState(() {
widget.indexController.locations.clear();
if(newValue != null){
widget.indexController.is_loading.value = true;
widget.indexController.areaDropdownValue = newValue;
widget.indexController.populateSubPerForArea(newValue, widget.mapController);
}
});
},
items: getCustomArea(),
): const Text(""),
widget.indexController.subPerfs.isNotEmpty ?
DropdownButton<String>(
value: widget.indexController.subDropdownValue,
icon: const Icon(Icons.arrow_downward),
elevation: 16,
style: const TextStyle(color: Colors.deepPurple),
hint: const Text("select"),
underline: Container(
height: 2,
color: Colors.deepPurpleAccent,
),
onChanged: (String? newValue) {
setState(() {
if(newValue != null){
//widget.indexController.is_loading.value = true;
//widget.indexController.populateForSubPerf(newValue, widget.mapController);
//widget.indexController.loadLocationforSubPerf(newValue, widget.mapController);
widget.indexController.subDropdownValue = newValue;
widget.indexController.loadCatForCity(newValue);
}
});
},
items:
getSubDropdownItems()
) :
const Text(""),
//CatWidget(indexController: widget.indexController,),
widget.indexController.cats.length > 0 ?
DropdownButton<String>(
value: widget.indexController.cateogory,
icon: const Icon(Icons.arrow_downward),
elevation: 16,
style: const TextStyle(color: Colors.deepPurple),
hint: const Text("select"),
underline: Container(
height: 2,
color: Colors.deepPurpleAccent,
),
onChanged: (String? newValue) {
setState(() {
if(newValue != null){
widget.indexController.is_loading.value = true;
widget.indexController.cateogory = newValue;
widget.indexController.currentCat.clear();
widget.indexController.currentCat.add(newValue);
widget.indexController.populateForSubPerf(widget.indexController.subDropdownValue, widget.mapController);
//widget.indexController.loadLocationforSubPerf(newValue, widget.mapController);
//widget.indexController.subDropdownValue = newValue;
}
});
},
items:
getCategory(),
)
:
Container(),
],
),
);
}
}
// class PerfectureWidget extends StatefulWidget {
// HomeController homeController;
// IndexController indexController;
// MapController mapController;
// PerfectureWidget({required this.homeController, required this.mapController});
// PerfectureWidget({Key? key, required this.indexController, required this.mapController}) : super(key: key){
// //indexController.zoomtoMainPerf("9", mapController);
// }
// @override
// State<PerfectureWidget> createState() => _PerfectureWidgetState();
// }
// class _PerfectureWidgetState extends State<PerfectureWidget> {
// String dropdownValue = "9";
// @override
// void initState() {
// super.initState();
// }
// bool isNumeric(String s) {
// if (s == null) {
// return false;
// }
// return double.tryParse(s) != null;
// }
// List<DropdownMenuItem<String>> getDropdownItems() {
// List<DropdownMenuItem<String>> dropDownItems = [];
// for (Map<String, dynamic> currency in widget.homeController.perfectures[0]) {
// for (Map<String, dynamic> currency in widget.indexController.perfectures[0]) {
// //print(currency["id"].toString());
// var newDropdown = DropdownMenuItem(
// child: Text(currency["adm1_ja"].toString()),
@ -274,9 +53,9 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
// List<DropdownMenuItem<String>> getSubDropdownItems() {
// List<DropdownMenuItem<String>> dropDownItems = [];
// if(widget.homeController.subPerfs.length > 0){
// if(widget.indexController.subPerfs.isNotEmpty){
// for (Map<String, dynamic> currency in widget.homeController.subPerfs[0]) {
// for (Map<String, dynamic> currency in widget.indexController.subPerfs[0]) {
// var newDropdown = DropdownMenuItem(
// child: Text(currency["adm2_ja"].toString()),
// value: currency["id"].toString(),
@ -288,13 +67,55 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
// return dropDownItems;
// }
// @override
// void initState() {
// super.initState();
// widget.homeController.loadSubPerfFor("9");
// widget.homeController.zoomtoMainPerf("9", widget.mapController);
// List<DropdownMenuItem<String>> getCustomArea(){
// List<DropdownMenuItem<String>> dropDownItems = [];
// if(widget.indexController.areas.isNotEmpty){
// for (Map<String, dynamic> currency in widget.indexController.areas[0]) {
// var newDropdown = DropdownMenuItem(
// child: Text(currency["area_nm"].toString()),
// value: currency["id"].toString(),
// );
// dropDownItems.add(newDropdown);
// }
// }
// if(widget.indexController.customAreas.isNotEmpty){
// for (Map<String, dynamic> currency in widget.indexController.customAreas[0]) {
// var newDropdown = DropdownMenuItem(
// child: Text(currency["event_name"].toString()),
// value: currency["event_name"].toString(),
// );
// dropDownItems.add(newDropdown);
// }
// }
// return dropDownItems;
// }
// List<DropdownMenuItem<String>> getCategory(){
// List<DropdownMenuItem<String>> dropDownItems = [];
// dropDownItems.clear();
// //print("--------cats ------############### ${widget.indexController.cats.toString()} -------------");
// for(dynamic d in widget.indexController.cats){
// //print("-------- ddd ------############### ${d} --------dddd-----");
// var newDropdown = DropdownMenuItem(child: Text(d['category'].toString()), value: d['category'].toString());
// //print("--------cats ------############### ${d['category'].toString()} -------------");
// dropDownItems.add(newDropdown);
// }
// //return [];
// return dropDownItems;
// }
// @override
// Widget build(BuildContext context) {
@ -302,7 +123,7 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
// Row(
// children: [
// DropdownButton<String>(
// value: dropdownValue,
// value: widget.indexController.dropdownValue,
// icon: const Icon(Icons.arrow_downward),
// elevation: 16,
// style: const TextStyle(color: Colors.deepPurple),
@ -313,45 +134,105 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
// onChanged: (String? newValue) {
// //setState(() {
// if(newValue != null){
// dropdownValue = newValue;
// widget.homeController.loadLocationforPerf(newValue, widget.mapController);
// widget.homeController.loadSubPerfFor(newValue);
// //SubDropdownValue = widget.homeController.getSubInitialVal();
// //widget.mapController.fitBounds(widget.homeController.currentBound[0]);
// widget.homeController.zoomtoMainPerf(newValue, widget.mapController);
// widget.indexController.is_loading.value = true;
// widget.indexController.dropdownValue = newValue;
// widget.indexController.populateForPerf(newValue, widget.mapController);
// }
// //});
// },
// items: getDropdownItems()
// ),
// widget.homeController.subPerfs.length > 0 ?
// // Gifu areas
// widget.indexController.areas.isNotEmpty ?
// DropdownButton<String>(
// value: widget.homeController.SubDropdownValue,
// value: widget.indexController.areaDropdownValue,
// icon: const Icon(Icons.arrow_downward),
// elevation: 16,
// style: const TextStyle(color: Colors.deepPurple),
// hint: const Text("select"),
// underline: Container(
// height: 2,
// color: Colors.deepPurpleAccent,
// ),
// onChanged: (String? newValue) {
// if (isNumeric(newValue!)){
// widget.indexController.is_custom_area_selected.value = false;
// }
// else{
// widget.indexController.loadCustomLocation(newValue);
// widget.indexController.is_custom_area_selected.value = true;
// widget.indexController.subPerfs.clear();
// widget.indexController.cats.clear();
// }
// setState(() {
// widget.indexController.locations.clear();
// if(newValue != null){
// widget.indexController.is_loading.value = true;
// widget.indexController.areaDropdownValue = newValue;
// widget.indexController.populateSubPerForArea(newValue, widget.mapController);
// }
// });
// },
// items: getCustomArea(),
// ): const Text(""),
// widget.indexController.subPerfs.isNotEmpty ?
// DropdownButton<String>(
// value: widget.indexController.subDropdownValue,
// icon: const Icon(Icons.arrow_downward),
// elevation: 16,
// style: const TextStyle(color: Colors.deepPurple),
// hint: Container(
// child: Text("select"),
// ),
// hint: const Text("select"),
// underline: Container(
// height: 2,
// color: Colors.deepPurpleAccent,
// ),
// onChanged: (String? newValue) {
// //setState(() {
// setState(() {
// if(newValue != null){
// widget.homeController.loadLocationforSubPerf(newValue, widget.mapController);
// widget.homeController.SubDropdownValue = newValue;
// widget.homeController.zoomtoSubPerf(newValue, widget.mapController);
// //widget.indexController.is_loading.value = true;
// //widget.indexController.populateForSubPerf(newValue, widget.mapController);
// //widget.indexController.loadLocationforSubPerf(newValue, widget.mapController);
// widget.indexController.subDropdownValue = newValue;
// widget.indexController.loadCatForCity(newValue);
// }
// //});
// });
// },
// items:
// getSubDropdownItems()
// ) :
// Text("")
// const Text(""),
// //CatWidget(indexController: widget.indexController,),
// widget.indexController.cats.length > 0 ?
// DropdownButton<String>(
// value: widget.indexController.cateogory,
// icon: const Icon(Icons.arrow_downward),
// elevation: 16,
// style: const TextStyle(color: Colors.deepPurple),
// hint: const Text("select"),
// underline: Container(
// height: 2,
// color: Colors.deepPurpleAccent,
// ),
// onChanged: (String? newValue) {
// setState(() {
// if(newValue != null){
// widget.indexController.is_loading.value = true;
// widget.indexController.cateogory = newValue;
// widget.indexController.currentCat.clear();
// widget.indexController.currentCat.add(newValue);
// widget.indexController.populateForSubPerf(widget.indexController.subDropdownValue, widget.mapController);
// //widget.indexController.loadLocationforSubPerf(newValue, widget.mapController);
// //widget.indexController.subDropdownValue = newValue;
// }
// });
// },
// items:
// getCategory(),
// )
// :
// Container(),
// ],
// ),
@ -359,3 +240,122 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
// }
// }
// // class PerfectureWidget extends StatefulWidget {
// // HomeController homeController;
// // MapController mapController;
// // PerfectureWidget({required this.homeController, required this.mapController});
// // @override
// // State<PerfectureWidget> createState() => _PerfectureWidgetState();
// // }
// // class _PerfectureWidgetState extends State<PerfectureWidget> {
// // String dropdownValue = "9";
// // List<DropdownMenuItem<String>> getDropdownItems() {
// // List<DropdownMenuItem<String>> dropDownItems = [];
// // for (Map<String, dynamic> currency in widget.homeController.perfectures[0]) {
// // //print(currency["id"].toString());
// // var newDropdown = DropdownMenuItem(
// // child: Text(currency["adm1_ja"].toString()),
// // value: currency["id"].toString(),
// // );
// // dropDownItems.add(newDropdown);
// // }
// // return dropDownItems;
// // }
// // List<DropdownMenuItem<String>> getSubDropdownItems() {
// // List<DropdownMenuItem<String>> dropDownItems = [];
// // if(widget.homeController.subPerfs.length > 0){
// // for (Map<String, dynamic> currency in widget.homeController.subPerfs[0]) {
// // var newDropdown = DropdownMenuItem(
// // child: Text(currency["adm2_ja"].toString()),
// // value: currency["id"].toString(),
// // );
// // dropDownItems.add(newDropdown);
// // }
// // }
// // return dropDownItems;
// // }
// // @override
// // void initState() {
// // super.initState();
// // widget.homeController.loadSubPerfFor("9");
// // widget.homeController.zoomtoMainPerf("9", widget.mapController);
// // }
// // @override
// // Widget build(BuildContext context) {
// // return Obx(() =>
// // Row(
// // children: [
// // DropdownButton<String>(
// // value: dropdownValue,
// // icon: const Icon(Icons.arrow_downward),
// // elevation: 16,
// // style: const TextStyle(color: Colors.deepPurple),
// // underline: Container(
// // height: 2,
// // color: Colors.deepPurpleAccent,
// // ),
// // onChanged: (String? newValue) {
// // //setState(() {
// // if(newValue != null){
// // dropdownValue = newValue;
// // widget.homeController.loadLocationforPerf(newValue, widget.mapController);
// // widget.homeController.loadSubPerfFor(newValue);
// // //SubDropdownValue = widget.homeController.getSubInitialVal();
// // //widget.mapController.fitBounds(widget.homeController.currentBound[0]);
// // widget.homeController.zoomtoMainPerf(newValue, widget.mapController);
// // }
// // //});
// // },
// // items: getDropdownItems()
// // ),
// // widget.homeController.subPerfs.length > 0 ?
// // DropdownButton<String>(
// // value: widget.homeController.SubDropdownValue,
// // icon: const Icon(Icons.arrow_downward),
// // elevation: 16,
// // style: const TextStyle(color: Colors.deepPurple),
// // hint: Container(
// // child: Text("select"),
// // ),
// // underline: Container(
// // height: 2,
// // color: Colors.deepPurpleAccent,
// // ),
// // onChanged: (String? newValue) {
// // //setState(() {
// // if(newValue != null){
// // widget.homeController.loadLocationforSubPerf(newValue, widget.mapController);
// // widget.homeController.SubDropdownValue = newValue;
// // widget.homeController.zoomtoSubPerf(newValue, widget.mapController);
// // }
// // //});
// // },
// // items:
// // getSubDropdownItems()
// // ) :
// // Text("")
// // ],
// // ),
// // );
// // }
// // }