update for reorder and location points
This commit is contained in:
@ -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),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
@ -360,7 +360,7 @@ void login(String email, String password, BuildContext context){
|
||||
|
||||
void loadLocationforSubPerf(String subperf, MapController mapController) async {
|
||||
String cat = currentCat.isNotEmpty == true ? currentCat[0] : "";
|
||||
if(currentCat[0] == "-all-"){
|
||||
if(currentCat.isNotEmpty && currentCat[0] == "-all-"){
|
||||
cat = "";
|
||||
}
|
||||
LocationService.loadLocationsSubFor(subperf, cat).then((value){
|
||||
@ -371,6 +371,9 @@ void login(String email, String password, BuildContext context){
|
||||
|
||||
void loadCustomLocation(String customarea) async {
|
||||
String cat = currentCat.isNotEmpty == true ? currentCat[0] : "";
|
||||
if(currentCat.isNotEmpty && currentCat[0] == "-all-"){
|
||||
cat = "";
|
||||
}
|
||||
print("----- ${customarea}");
|
||||
LocationService.loadCustomLocations(customarea, cat).then((value){
|
||||
locations.clear();
|
||||
@ -390,7 +393,11 @@ void login(String email, String password, BuildContext context){
|
||||
if(is_custom_area_selected.value == true){
|
||||
return;
|
||||
}
|
||||
locations.clear();
|
||||
String cat = currentCat.isNotEmpty ? currentCat[0] : "";
|
||||
if(currentCat.isNotEmpty && currentCat[0] == "-all-"){
|
||||
cat = "";
|
||||
}
|
||||
LatLngBounds bounds = mapController!.bounds!;
|
||||
currentBound.clear();
|
||||
currentBound.add(bounds);
|
||||
@ -401,7 +408,6 @@ void login(String email, String password, BuildContext context){
|
||||
if(value == null){
|
||||
return;
|
||||
}
|
||||
locations.clear();
|
||||
if(value != null && value.collection.isEmpty){
|
||||
if(showPopup == false) {
|
||||
return;
|
||||
|
||||
@ -25,7 +25,9 @@ class LoginPage extends StatelessWidget {
|
||||
Navigator.pop(context);
|
||||
},icon:Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
|
||||
),
|
||||
body: Container(
|
||||
body:
|
||||
indexController.currentUser.length == 0 ?
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height,
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
@ -141,7 +143,16 @@ class LoginPage extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
):
|
||||
Container(
|
||||
child: TextButton(
|
||||
onPressed: (){
|
||||
indexController.currentUser.clear();
|
||||
},
|
||||
child: Text("Already Logged in, Click to logout"),
|
||||
),
|
||||
)
|
||||
,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user