update to 3.13
This commit is contained in:
@ -5,21 +5,15 @@ 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_popup/flutter_map_marker_popup.dart';
|
||||
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||
import 'package:flutter_polyline_points/flutter_polyline_points.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:get/get.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/services/destination_service.dart';
|
||||
import 'package:rogapp/utils/text_util.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 'package:rogapp/widgets/bread_crum_widget.dart';
|
||||
|
||||
|
||||
class DestinationMapPage extends StatelessWidget {
|
||||
@ -46,7 +40,7 @@ class DestinationMapPage extends StatelessWidget {
|
||||
int index = -1;
|
||||
for (int i = 0; i < destinationController.destinations.length; i++) {
|
||||
Destination d = destinationController.destinations[i];
|
||||
print("^^^^ ${d} ^^^^");
|
||||
print("^^^^ $d ^^^^");
|
||||
Marker m = Marker(
|
||||
point: LatLng(d.lat!, d.lon!),
|
||||
anchorPos: AnchorPos.align(AnchorAlign.center),
|
||||
@ -55,21 +49,19 @@ class DestinationMapPage extends StatelessWidget {
|
||||
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: Get.context!, isScrollControlled: true,
|
||||
builder:((context) => BottomSheetNew())
|
||||
).whenComplete((){
|
||||
print("---- set skip gps to false -----");
|
||||
destinationController.skip_gps = false;
|
||||
});
|
||||
if(indexController.currentDestinationFeature.isNotEmpty) {
|
||||
indexController.currentDestinationFeature.clear();
|
||||
}
|
||||
},
|
||||
indexController.currentDestinationFeature.add(d);
|
||||
//indexController.getAction();
|
||||
|
||||
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
||||
builder:((context) => BottomSheetNew())
|
||||
).whenComplete((){
|
||||
print("---- set skip gps to false -----");
|
||||
destinationController.skip_gps = false;
|
||||
});
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@ -79,19 +71,19 @@ class DestinationMapPage extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
border: new Border.all(
|
||||
border: Border.all(
|
||||
color: Colors.white,
|
||||
width: d.checkin_radious != null ? d.checkin_radious! : 1,
|
||||
),
|
||||
),
|
||||
child: new Center(
|
||||
child: new Text(
|
||||
child: Center(
|
||||
child: Text(
|
||||
(i + 1).toString(),
|
||||
style: TextStyle(color: Colors.white),
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container( color: Colors.yellow, child: Text(TextUtils.getDisplayText(d), style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, overflow: TextOverflow.visible),)),
|
||||
Container( color: Colors.yellow, child: Text(TextUtils.getDisplayText(d), style: const TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, overflow: TextOverflow.visible),)),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -132,28 +124,28 @@ class DestinationMapPage extends StatelessWidget {
|
||||
options: MapOptions(
|
||||
onMapReady: (){
|
||||
indexController.is_rog_mapcontroller_loaded.value = true;
|
||||
subscription = indexController.rogMapController!.mapEventStream.listen((MapEvent mapEvent) {
|
||||
subscription = indexController.rogMapController.mapEventStream.listen((MapEvent mapEvent) {
|
||||
if (mapEvent is MapEventMoveStart) {
|
||||
}
|
||||
if (mapEvent is MapEventMoveEnd) {
|
||||
//destinationController.is_gps_selected.value = true;
|
||||
//indexController.mapController!.move(c.center, c.zoom);
|
||||
LatLngBounds bounds = indexController.rogMapController!.bounds!;
|
||||
LatLngBounds bounds = indexController.rogMapController.bounds!;
|
||||
indexController.currentBound.clear();
|
||||
indexController.currentBound.add(bounds);
|
||||
if(indexController.currentUser.length <= 0){
|
||||
if(indexController.currentUser.isEmpty){
|
||||
indexController.loadLocationsBound();
|
||||
}
|
||||
}
|
||||
});
|
||||
} ,
|
||||
bounds: indexController.currentBound.length > 0 ? indexController.currentBound[0]: LatLngBounds.fromPoints([LatLng(35.03999881162295, 136.40587119778962), LatLng(36.642756778706904, 137.95226720406063)]),
|
||||
bounds: indexController.currentBound.isNotEmpty ? indexController.currentBound[0]: LatLngBounds.fromPoints([LatLng(35.03999881162295, 136.40587119778962), LatLng(36.642756778706904, 137.95226720406063)]),
|
||||
zoom: 1,
|
||||
maxZoom: 42,
|
||||
interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag,
|
||||
),
|
||||
children: [
|
||||
BaseLayer(),
|
||||
const BaseLayer(),
|
||||
Obx(() =>
|
||||
indexController.routePointLenght > 0 ?
|
||||
PolylineLayer(
|
||||
|
||||
Reference in New Issue
Block a user