update for reorder and location points

This commit is contained in:
Mohamed Nouffer
2022-09-01 19:14:18 +05:30
parent a4adf24e99
commit 09ac737de5
12 changed files with 196 additions and 143 deletions

View File

@ -34,45 +34,6 @@ class _DestinationMapPageState extends State<DestinationMapPage> {
StreamSubscription? subscription;
final PopupController _popupLayerController = PopupController();
// Widget examplePopup(Marker marker){
// return Padding(
// padding: const EdgeInsets.all(10),
// child: Container(
// constraints: const BoxConstraints(minWidth: 100, maxWidth: 200),
// color: Colors.white,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// const Text(
// 'Popup for a marker!',
// overflow: TextOverflow.fade,
// softWrap: false,
// style: TextStyle(
// fontWeight: FontWeight.w500,
// fontSize: 14.0,
// ),
// ),
// const Padding(padding: EdgeInsets.symmetric(vertical: 4.0)),
// Text(
// 'Position: ${marker.point.latitude}, ${marker.point.longitude}',
// style: const TextStyle(fontSize: 12.0),
// ),
// Text(
// 'Marker size: ${marker.width}, ${marker.height}',
// style: const TextStyle(fontSize: 12.0),
// ),
// ],
// ),
// ),
// );
// }
List<LatLng>? getPoints(){
//print("##### --- route point ${indexController.routePoints.length}");
List<LatLng> pts = [];
@ -83,6 +44,20 @@ class _DestinationMapPageState extends State<DestinationMapPage> {
return pts;
}
String getDisplaytext(Destination dp){
String txt = "";
if(dp.cp! > 0){
txt = "${dp.cp}";
if(dp.checkin_point != null && dp.checkin_point! > 0){
txt = txt + "{${dp.checkin_point}}";
}
if(dp.buy_point != null && dp.buy_point! > 0){
txt = txt + "[${dp.buy_point}]";
}
}
return txt;
}
List<Marker>? getMarkers() {
List<Marker> pts = [];
int index = -1;
@ -111,21 +86,29 @@ class _DestinationMapPageState extends State<DestinationMapPage> {
);
}
},
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: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width:20,
height:20,
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),
),
),
),
),
child: new Center(
child: new Text(
(i + 1).toString(),
style: TextStyle(color: Colors.white),
),
),
Container( color: Colors.yellow, child: Text(getDisplaytext(d), style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, overflow: TextOverflow.visible),)),
],
),
);
@ -242,7 +225,7 @@ class _DestinationMapPageState extends State<DestinationMapPage> {
children: [
TileLayerWidget(
options: TileLayerOptions(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
urlTemplate: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
),
),
@ -253,8 +236,8 @@ class _DestinationMapPageState extends State<DestinationMapPage> {
polylines: [
Polyline(
points: getPoints()!,
strokeWidth: 4.0,
color: Colors.purple),
strokeWidth: 6.0,
color: Colors.indigo),
],
),
)