update for ios permission

This commit is contained in:
Mohamed Nouffer
2022-09-12 19:52:28 +05:30
parent 6802083a0a
commit b5932f2578
9 changed files with 124 additions and 23 deletions

View File

@ -41,7 +41,7 @@ class LocationService{
if(cat.isNotEmpty){
if(indexController.currentUser.length > 0){
var grp = indexController.currentUser[0]["group"];
var grp = indexController.currentUser[0]['user']['group'];
url = '${server_url}/api/inperf/?rog=True&perf=' + perfecture + '&cat=' + cat + "&grp=${grp}";
}
else {
@ -50,7 +50,7 @@ class LocationService{
}
else{
if(indexController.currentUser.length > 0){
var grp = indexController.currentUser[0]["group"];
var grp = indexController.currentUser[0]['user']['group'];
url = '${server_url}/api/inperf/?rog=True&perf=' + perfecture + "&grp=${grp}";
}
else {
@ -79,7 +79,7 @@ class LocationService{
String server_url = ConstValues.currentServer();
if(cat.isNotEmpty){
if(indexController.currentUser.length > 0){
var grp = indexController.currentUser[0]["group"];
var grp = indexController.currentUser[0]['user']['group'];
url = '${server_url}/api/insubperf?rog=True&subperf=' + subperfecture + '&cat=' + cat + "&grp=${grp}";
}
else{
@ -88,7 +88,7 @@ class LocationService{
}
else{
if(indexController.currentUser.length > 0){
var grp = indexController.currentUser[0]["group"];
var grp = indexController.currentUser[0]['user']['group'];
url = '${server_url}/api/insubperf?rog=True&subperf=' + subperfecture + "&grp=${grp}";
}
else{
@ -112,12 +112,13 @@ class LocationService{
static Future<GeoJsonFeatureCollection?> loadLocationsBound(double lat1, double lon1, double lat2, double lon2, double lat3, double lon3, double lat4, double lon4, String cat) async {
print("-------- in location for bound -------------");
final IndexController indexController = Get.find<IndexController>();
String url = "";
String server_url = ConstValues.currentServer();
if(cat.isNotEmpty){
if(indexController.currentUser.length > 0){
var grp = indexController.currentUser[0]["group"];
var grp = indexController.currentUser[0]['user']['group'];
url = '${server_url}/api/inbound?rog=True&ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}' + '&cat=' + cat + "&grp=${grp}";
}
else{
@ -126,7 +127,8 @@ class LocationService{
}
else{
if(indexController.currentUser.length > 0){
var grp = indexController.currentUser[0]["group"];
var grp = indexController.currentUser[0]['user']['group'];
print("-------- requested user group ${grp} -------------");
url = '${server_url}/api/inbound?rog=True&ln1=${lon1}&la1=${lat1}&ln2=${lon2}&la2=${lat2}&ln3=${lon3}&la3=${lat3}&ln4=${lon4}&la4=${lat4}' + '&grp=${grp}';
}
else{
@ -167,7 +169,7 @@ class LocationService{
print("loadCustomLocations url is ----- ${cat}");
if(cat.isNotEmpty){
if(indexController.currentUser.length > 0){
var grp = indexController.currentUser[0]["group"];
var grp = indexController.currentUser[0]['user']['group'];
url = '${server_url}/api/custom_area/?rog=True&&cat=' + cat + "&grp=${grp}";
}
else{
@ -176,7 +178,7 @@ class LocationService{
}
else{
if(indexController.currentUser.length > 0){
var grp = indexController.currentUser[0]["group"];
var grp = indexController.currentUser[0]['user']['group'];
url = '${server_url}/api/customarea?rog=True&name=${name}' + "&grp=${grp}";
}
else{

View File

@ -117,19 +117,21 @@ class MapWidget extends StatelessWidget {
},
size: Size(40, 40),
anchor: AnchorPos.align(AnchorAlign.center),
anchor: AnchorPos.align(AnchorAlign.left),
fitBoundsOptions: const FitBoundsOptions(
padding: EdgeInsets.all(50),
maxZoom: 265,
),
markers:indexController.locations[0].collection.map((i) {
print("i si ${i.properties!['location_id']}");
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
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,
anchorPos: AnchorPos.exactly(Anchor(108.0, 18.0)),
height: 32.0,
width: 120.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 ?
@ -141,8 +143,11 @@ class MapWidget extends StatelessWidget {
// : Icon(Icons.pin_drop),
builder: (ctx){
return Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
height: 32,
width: 32,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent,
@ -152,9 +157,9 @@ class MapWidget extends StatelessWidget {
style: BorderStyle.solid
)
),
child: Icon(Icons.circle,size: 14.0,)
child: Icon(Icons.circle,size: 6.0,)
),
Text(i.properties!['cp'] > 0 ? i.properties!['cp'].toString() : "", style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color:Colors.red,)),
Container(color: Colors.white, child: Text(i.properties!['cp'] > 0 ? "${i.properties!['cp'].toString().replaceAll(regex, '')}{${i.properties!['checkin_point'].toString()}}" : "", style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color:Colors.red,))),
],
);
},