diff --git a/ios/Podfile b/ios/Podfile index 1e8c3c9..a47d938 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -34,8 +34,73 @@ target 'Runner' do flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end +# post_install do |installer| +# installer.pods_project.targets.each do |target| +# flutter_additional_ios_build_settings(target) +# end +# end + post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + + # Start of the permission_handler configuration + target.build_configurations.each do |config| + + # You can enable the permissions needed here. For example to enable camera + # permission, just remove the `#` character in front so it looks like this: + # + # ## dart: PermissionGroup.camera + # 'PERMISSION_CAMERA=1' + # + # Preprocessor definitions can be found in: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ + '$(inherited)', + + ## dart: PermissionGroup.calendar + # 'PERMISSION_EVENTS=1', + + ## dart: PermissionGroup.reminders + # 'PERMISSION_REMINDERS=1', + + ## dart: PermissionGroup.contacts + # 'PERMISSION_CONTACTS=1', + + ## dart: PermissionGroup.camera + # 'PERMISSION_CAMERA=1', + + ## dart: PermissionGroup.microphone + # 'PERMISSION_MICROPHONE=1', + + ## dart: PermissionGroup.speech + # 'PERMISSION_SPEECH_RECOGNIZER=1', + + ## dart: PermissionGroup.photos + # 'PERMISSION_PHOTOS=1', + + ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] + 'PERMISSION_LOCATION=1' + + ## dart: PermissionGroup.notification + # 'PERMISSION_NOTIFICATIONS=1', + + ## dart: PermissionGroup.mediaLibrary + # 'PERMISSION_MEDIA_LIBRARY=1', + + ## dart: PermissionGroup.sensors + # 'PERMISSION_SENSORS=1', + + ## dart: PermissionGroup.bluetooth + # 'PERMISSION_BLUETOOTH=1', + + ## dart: PermissionGroup.appTrackingTransparency + # 'PERMISSION_APP_TRACKING_TRANSPARENCY=1', + + ## dart: PermissionGroup.criticalAlerts + # 'PERMISSION_CRITICAL_ALERTS=1' + ] + + end + # End of the permission_handler configuration end -end +end \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 8a992b1..d113457 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -21,7 +21,7 @@ PODS: - Flutter - path_provider_ios (0.0.1): - Flutter - - "permission_handler (5.1.0+2)": + - permission_handler_apple (9.0.4): - Flutter - sqflite (0.0.2): - Flutter @@ -37,7 +37,7 @@ DEPENDENCIES: - google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) - - permission_handler (from `.symlinks/plugins/permission_handler/ios`) + - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - sqflite (from `.symlinks/plugins/sqflite/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) @@ -61,8 +61,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/image_picker_ios/ios" path_provider_ios: :path: ".symlinks/plugins/path_provider_ios/ios" - permission_handler: - :path: ".symlinks/plugins/permission_handler/ios" + permission_handler_apple: + :path: ".symlinks/plugins/permission_handler_apple/ios" sqflite: :path: ".symlinks/plugins/sqflite/ios" url_launcher_ios: @@ -78,10 +78,10 @@ SPEC CHECKSUMS: GoogleMaps: 008e2c80e38605b56b560e8deb73d4194ff30bef image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 - permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 + permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de -PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c +PODFILE CHECKSUM: 0793805c7f7ae4910c8f6c28aaed7fe0a31e9dce COCOAPODS: 1.11.2 diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index f407620..b5f550b 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -45,6 +45,10 @@ UIViewControllerBasedStatusBarAppearance + NSLocationAlwaysAndWhenInUseUsageDescription + This app need location access + NSLocationWhenInUseUsageDescription + This all need location access NSLocationWhenInUseUsageDescription This app needs access to location when open. NSLocationAlwaysUsageDescription diff --git a/lib/services/location_service.dart b/lib/services/location_service.dart index 166a933..d333ef2 100644 --- a/lib/services/location_service.dart +++ b/lib/services/location_service.dart @@ -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 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(); 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{ diff --git a/lib/widgets/map_widget.dart b/lib/widgets/map_widget.dart index 3be32e9..967cb1e 100644 --- a/lib/widgets/map_widget.dart +++ b/lib/widgets/map_widget.dart @@ -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,))), ], ); }, diff --git a/pubspec.lock b/pubspec.lock index 839f757..ecb0b92 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -512,7 +512,21 @@ packages: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "8.3.0" + version: "10.0.0" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + url: "https://pub.dartlang.org" + source: hosted + version: "10.0.0" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + url: "https://pub.dartlang.org" + source: hosted + version: "9.0.4" permission_handler_platform_interface: dependency: transitive description: @@ -520,6 +534,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.7.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" platform: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 155dfbc..14c91ee 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,7 @@ dependencies: get: ^4.6.5 flutter_map: any geolocator: ^8.0.1 - permission_handler: ^8.3.0 + permission_handler: ^10.0.0 google_api_availability: ^3.0.1 tuple: ^2.0.0 latlong2: ^0.8.1 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 94586cc..ce843bc 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -7,11 +7,14 @@ #include "generated_plugin_registrant.h" #include +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { GeolocatorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("GeolocatorWindows")); + PermissionHandlerWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index f0bcafd..b3ea692 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST geolocator_windows + permission_handler_windows url_launcher_windows )