This commit is contained in:
Mohamed Nouffer
2022-07-28 19:01:45 +05:30
parent 16cf0e1434
commit a4adf24e99
6 changed files with 53 additions and 17 deletions

View File

@ -6,6 +6,7 @@ import 'package:get/get.dart';
import 'package:latlong2/latlong.dart';
import 'package:rogapp/pages/destination/destination_controller.dart';
import 'package:rogapp/pages/destination_map/destination_map_page.dart';
import 'package:rogapp/pages/drawer/drawer_page.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/routes/app_pages.dart';
import 'package:rogapp/widgets/destination_widget.dart';
@ -64,6 +65,7 @@ class _DestinationPageState extends State<DestinationPage> {
return false;
},
child: Scaffold(
drawer: const DrawerPage(),
bottomNavigationBar: BottomAppBar(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,

View File

@ -85,27 +85,49 @@ class _DestinationMapPageState extends State<DestinationMapPage> {
List<Marker>? getMarkers() {
List<Marker> pts = [];
for(Destination d in destinationController.destinations){
int index = -1;
for (int i = 0; i < destinationController.destinations.length; i++) {
Destination d = destinationController.destinations[i];
//for(Destination d in destinationController.destinations){
//print("-----lat ${lat}, ----- lon ${lan}");
Marker m = Marker(
point: LatLng(d.lat!, d.lon!),
anchorPos: AnchorPos.align(AnchorAlign.center),
builder:(cts){
return Container(
color: Colors.transparent,
child: new Container(
decoration: new BoxDecoration(
color: Colors.red,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(40.0),
topRight: const Radius.circular(40.0),
)
),
child: new Center(
child: new Text("Hi modal sheet"),
)
));
return InkWell(
onTap: (){
print("-- Destination is --- ${d.name} ------");
if(d != null){
if(indexController.currentDestinationFeature.length > 0) {
indexController.currentDestinationFeature.clear();
}
indexController.currentDestinationFeature.add(d);
//indexController.getAction();
showModalBottomSheet(context: context, isScrollControlled: true,
//builder:((context) => BottomSheetWidget())
builder:((context) => BottomSheetNew())
);
}
},
child: Container(
decoration: BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
border: new Border.all(
color: Colors.white,
width: d.checkin_radious != null ? d.checkin_radious! : 1,
),
),
child: new Center(
child: new Text(
(i + 1).toString(),
style: TextStyle(color: Colors.white),
),
),
),
);
//return Icon(Icons.pin_drop);
// return IconButton(

View File

@ -42,6 +42,8 @@ class IndexController extends GetxController {
var is_mapController_loaded = false.obs;
var is_rog_mapcontroller_loaded = false.obs;
var is_custom_area_selected = false.obs;
MapController? mapController;
MapController? rogMapController;
@ -385,6 +387,9 @@ void login(String email, String password, BuildContext context){
}
void loadLocationsBound(){
if(is_custom_area_selected.value == true){
return;
}
String cat = currentCat.isNotEmpty ? currentCat[0] : "";
LatLngBounds bounds = mapController!.bounds!;
currentBound.clear();

View File

@ -28,7 +28,7 @@ class IndexPage extends GetView<IndexController> {
return false;
},
child: Scaffold(
drawer: const DrawerPage(),
//drawer: const DrawerPage(),
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.arrow_back_ios),