diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/bkp_files/CustomFlutterHmsMessageService.java b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/bkp_files/CustomFlutterHmsMessageService.java index c96a60af..7b1fbb64 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/bkp_files/CustomFlutterHmsMessageService.java +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/bkp_files/CustomFlutterHmsMessageService.java @@ -10,8 +10,8 @@ import android.content.Intent; import android.content.SharedPreferences; import android.util.Log; -import com.huawei.hms.flutter.push.hms.FlutterHmsMessageService; -import com.huawei.hms.flutter.push.utils.ApplicationUtils; +//import com.huawei.hms.flutter.push.hms.FlutterHmsMessageService; +//import com.huawei.hms.flutter.push.utils.ApplicationUtils; import org.json.JSONObject; diff --git a/lib/config/config.dart b/lib/config/config.dart index 3589e93d..b7b8ba2e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; -// var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -408,7 +408,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 9.7; +var VERSION_ID = 9.8; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart index fbef90e6..cefc6a13 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart @@ -26,7 +26,7 @@ import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart'; -import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; class CMCLocationPage extends StatefulWidget { @@ -55,12 +55,12 @@ class _CMCLocationPageState extends State { ); LatLng currentPostion; AppSharedPreferences sharedPref = AppSharedPreferences(); - HmsApiAvailability hmsApiAvailability; + // HmsApiAvailability hmsApiAvailability; @override void initState() { - hmsApiAvailability = HmsApiAvailability(); - checkIsHuawei(); + // hmsApiAvailability = HmsApiAvailability(); + // checkIsHuawei(); appMap = AppMap( _kGooglePlex.toMap(), @@ -90,13 +90,13 @@ class _CMCLocationPageState extends State { super.initState(); } - checkIsHuawei() async { - await hmsApiAvailability.isHMSAvailable().then((value) { - isHuawei = value == 0 ? true : false; - }); - print(isHuawei); - setState(() {}); - } + // checkIsHuawei() async { + // await hmsApiAvailability.isHMSAvailable().then((value) { + // isHuawei = value == 0 ? true : false; + // }); + // print(isHuawei); + // setState(() {}); + // } @override Widget build(BuildContext context) { diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart index e96ddcc7..9108ff23 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -24,7 +24,7 @@ import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart'; -import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; class LocationPage extends StatefulWidget { @@ -58,16 +58,16 @@ class _LocationPageState extends State { // Completer mapController = Completer(); Placemark selectedPlace; - HmsApiAvailability hmsApiAvailability; + // HmsApiAvailability hmsApiAvailability; ProjectViewModel projectViewModel; @override void initState() { - hmsApiAvailability = HmsApiAvailability(); + // hmsApiAvailability = HmsApiAvailability(); if (latitude == 0.0 && longitude == 0.0) { showCurrentLocation = true; } - if (Platform.isAndroid) checkIsHuawei(); + // if (Platform.isAndroid) checkIsHuawei(); WidgetsBinding.instance.addPostFrameCallback((_) { latitude = projectViewModel.latitude; @@ -230,16 +230,16 @@ class _LocationPageState extends State { ); } - checkIsHuawei() async { + // checkIsHuawei() async { // isHuawei = await FlutterHmsGmsAvailability.isHmsAvailable; // print(isHuawei); // setState(() {}); - await hmsApiAvailability.isHMSAvailable().then((value) { - isHuawei = value == 0 ? true : false; - }); - print(isHuawei); - setState(() {}); - } + // await hmsApiAvailability.isHMSAvailable().then((value) { + // isHuawei = value == 0 ? true : false; + // }); + // print(isHuawei); + // setState(() {}); + // } void _getUserLocation() async { if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index bb215613..1bf5663b 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -9,12 +9,12 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:flutter/cupertino.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:huawei_location/location/fused_location_provider_client.dart'; -import 'package:huawei_location/location/location.dart'; -import 'package:huawei_location/location/location_callback.dart'; -import 'package:huawei_location/location/location_request.dart'; -import 'package:huawei_location/location/location_settings_request.dart'; -import 'package:huawei_location/permission/permission_handler.dart'; +// import 'package:huawei_location/location/fused_location_provider_client.dart'; +// import 'package:huawei_location/location/location.dart'; +// import 'package:huawei_location/location/location_callback.dart'; +// import 'package:huawei_location/location/location_request.dart'; +// import 'package:huawei_location/location/location_settings_request.dart'; +// import 'package:huawei_location/permission/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; @@ -28,9 +28,9 @@ class LocationUtils { LocationUtils({@required this.isShowConfirmDialog, @required this.context, this.isHuawei = false}); void getCurrentLocation({Function(LatLng) callBack}) async { - if (Platform.isAndroid && isHuawei) { - _getHMSCurrentLocation(callBack); - } else { + // if (Platform.isAndroid && isHuawei) { + // _getHMSCurrentLocation(callBack); + // } else { Geolocator.isLocationServiceEnabled().then((value) async { if (value) { await Geolocator.checkPermission().then((permission) async { @@ -67,50 +67,50 @@ class LocationUtils { }).catchError((err) { print(err); }); - } + // } } - LocationCallback _locationCallback; + // LocationCallback _locationCallback; - _getHMSCurrentLocation(Function(LatLng) callBack) async { - PermissionHandler permissionHandler = PermissionHandler(); - - int _locationUpdateCbId = 0; - doIt() { - FusedLocationProviderClient locationService = FusedLocationProviderClient(); - LocationRequest locationRequest = LocationRequest(); - locationRequest.priority = LocationRequest.PRIORITY_HIGH_ACCURACY; - locationRequest.interval = 1000; - List locationRequestList = [locationRequest]; - LocationSettingsRequest locationSettingsRequest = LocationSettingsRequest(requests: locationRequestList); - - locationService.checkLocationSettings(locationSettingsRequest).then((settings) async { - _locationUpdateCbId = await locationService.requestLocationUpdatesCb( - locationRequest, - LocationCallback(onLocationResult: (locationResult) { - Location location = locationResult.lastLocation; - locationService.removeLocationUpdatesCb(_locationUpdateCbId); - callBack(LatLng(location.latitude, location.longitude)); - setLocation(Position(latitude: location.latitude, longitude: location.longitude, altitude: location.altitude)); - }, onLocationAvailability: (locationAvailability) { - print("onLocationAvailability: $locationAvailability"); - })); - }).catchError((error) { - if (error.code == "LOCATION_SETTINGS_NOT_AVAILABLE") { - // Location service not enabled. - } - }); - } - - if (await permissionHandler.hasLocationPermission()) { - doIt(); - } else { - bool has = await requestPermissions(); - if (has) - doIt(); - else if (isShowConfirmDialog) showErrorLocationDialog(false); - } - } + // _getHMSCurrentLocation(Function(LatLng) callBack) async { + // PermissionHandler permissionHandler = PermissionHandler(); + // + // int _locationUpdateCbId = 0; + // doIt() { + // FusedLocationProviderClient locationService = FusedLocationProviderClient(); + // LocationRequest locationRequest = LocationRequest(); + // locationRequest.priority = LocationRequest.PRIORITY_HIGH_ACCURACY; + // locationRequest.interval = 1000; + // List locationRequestList = [locationRequest]; + // LocationSettingsRequest locationSettingsRequest = LocationSettingsRequest(requests: locationRequestList); + // + // locationService.checkLocationSettings(locationSettingsRequest).then((settings) async { + // _locationUpdateCbId = await locationService.requestLocationUpdatesCb( + // locationRequest, + // LocationCallback(onLocationResult: (locationResult) { + // Location location = locationResult.lastLocation; + // locationService.removeLocationUpdatesCb(_locationUpdateCbId); + // callBack(LatLng(location.latitude, location.longitude)); + // setLocation(Position(latitude: location.latitude, longitude: location.longitude, altitude: location.altitude)); + // }, onLocationAvailability: (locationAvailability) { + // print("onLocationAvailability: $locationAvailability"); + // })); + // }).catchError((error) { + // if (error.code == "LOCATION_SETTINGS_NOT_AVAILABLE") { + // // Location service not enabled. + // } + // }); + // } + // + // if (await permissionHandler.hasLocationPermission()) { + // doIt(); + // } else { + // bool has = await requestPermissions(); + // if (has) + // doIt(); + // else if (isShowConfirmDialog) showErrorLocationDialog(false); + // } + // } showErrorLocationDialog(bool isPermissionError) { ConfirmDialog dialog = new ConfirmDialog( diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 9fc5a7c7..ff8e658c 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -20,8 +20,8 @@ import 'package:flutter/material.dart'; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; import 'package:flutter_ios_voip_kit/call_state_type.dart'; import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart'; -import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; -import 'package:huawei_push/huawei_push.dart' as h_push; +// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +// import 'package:huawei_push/huawei_push.dart' as h_push; import 'app_shared_preferences.dart'; import 'navigation_service.dart'; @@ -30,11 +30,11 @@ import 'navigation_service.dart'; Future backgroundMessageHandler(dynamic message) async { print("Firebase backgroundMessageHandler!!!"); fir.RemoteMessage message_; - if (message is h_push.RemoteMessage) { - // if huawei remote message convert it to Firebase Remote Message - message_ = toFirebaseRemoteMessage(message); - h_push.Push.localNotification({h_push.HMSLocalNotificationAttr.TITLE: 'Background Message', h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler"}); - } + // if (message is h_push.RemoteMessage) { + // // if huawei remote message convert it to Firebase Remote Message + // message_ = toFirebaseRemoteMessage(message); + // h_push.Push.localNotification({h_push.HMSLocalNotificationAttr.TITLE: 'Background Message', h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler"}); + // } if (message.data != null && (message.data['is_call'] == 'true' || message.data['is_call'] == true)) { _incomingCall(message.data); @@ -53,39 +53,39 @@ Future backgroundMessageHandler(dynamic message) async { } // Push Notification Background <--| -RemoteMessage toFirebaseRemoteMessage(h_push.RemoteMessage message) { - final payload_data = jsonDecode(message.data); - final fire_message = RemoteMessage( - from: message.from, - collapseKey: message.collapseKey, - data: payload_data['data'], - messageId: message.messageId, - sentTime: DateTime.fromMillisecondsSinceEpoch(message.sentTime * 1000), - ttl: message.ttl, - category: null, - messageType: message.type, - notification: RemoteNotification( - title: message.notification.title, - titleLocArgs: (message.notification.titleLocalizationArgs ?? []).map((e) => e.toString()).toList(), - titleLocKey: message.notification.titleLocalizationKey, - body: message.notification.body, - bodyLocArgs: (message.notification.bodyLocalizationArgs ?? []).map((e) => e.toString()).toList(), - bodyLocKey: message.notification.bodyLocalizationKey, - android: AndroidNotification( - channelId: message.notification.channelId, - clickAction: message.notification.clickAction, - color: message.notification.color, - count: null, - imageUrl: message.notification.imageUrl.path, - link: message.notification.link.path, - smallIcon: message.notification.icon, - sound: message.notification.sound, - ticker: message.notification.ticker, - tag: message.notification.tag, - ), - )); - return fire_message; -} +// RemoteMessage toFirebaseRemoteMessage(h_push.RemoteMessage message) { +// final payload_data = jsonDecode(message.data); +// final fire_message = RemoteMessage( +// from: message.from, +// collapseKey: message.collapseKey, +// data: payload_data['data'], +// messageId: message.messageId, +// sentTime: DateTime.fromMillisecondsSinceEpoch(message.sentTime * 1000), +// ttl: message.ttl, +// category: null, +// messageType: message.type, +// notification: RemoteNotification( +// title: message.notification.title, +// titleLocArgs: (message.notification.titleLocalizationArgs ?? []).map((e) => e.toString()).toList(), +// titleLocKey: message.notification.titleLocalizationKey, +// body: message.notification.body, +// bodyLocArgs: (message.notification.bodyLocalizationArgs ?? []).map((e) => e.toString()).toList(), +// bodyLocKey: message.notification.bodyLocalizationKey, +// android: AndroidNotification( +// channelId: message.notification.channelId, +// clickAction: message.notification.clickAction, +// color: message.notification.color, +// count: null, +// imageUrl: message.notification.imageUrl.path, +// link: message.notification.link.path, +// smallIcon: message.notification.icon, +// sound: message.notification.sound, +// ticker: message.notification.ticker, +// tag: message.notification.tag, +// ), +// )); +// return fire_message; +// } // callPage(String sessionID, String token, String isWebrtc, String callerIdString) async { callPage(String sessionID, String token) async { @@ -115,7 +115,7 @@ class PushNotificationHandler { final BuildContext context; static PushNotificationHandler _instance; final voIPKit = FlutterIOSVoIPKit.instance; - HmsApiAvailability hmsApiAvailability; + // HmsApiAvailability hmsApiAvailability; Timer timeOutTimer; bool isTalking = false; @@ -161,7 +161,7 @@ class PushNotificationHandler { } init() async { - hmsApiAvailability = new HmsApiAvailability(); + // hmsApiAvailability = new HmsApiAvailability(); // VoIP Callbacks voIPKit.getVoIPToken().then((value) { print('🎈 example: getVoIPToken: $value'); @@ -223,12 +223,12 @@ class PushNotificationHandler { // if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) { if (Platform.isAndroid) { - await hmsApiAvailability.isHMSAvailable().then((value) async { - if (value != 0) { - final fcmToken = await FirebaseMessaging.instance.getToken(); - if (fcmToken != null) onToken(fcmToken); - } - }); + // await hmsApiAvailability.isHMSAvailable().then((value) async { + // if (value != 0) { + // final fcmToken = await FirebaseMessaging.instance.getToken(); + // if (fcmToken != null) onToken(fcmToken); + // } + // }); } if (Platform.isIOS) { @@ -288,29 +288,29 @@ class PushNotificationHandler { FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); if (Platform.isAndroid) { - await hmsApiAvailability.isHMSAvailable().then((value) async { - if (value == 0) { - h_push.Push.enableLogger(); - final result = await h_push.Push.setAutoInitEnabled(true); - - h_push.Push.onNotificationOpenedApp.listen((message) { - newMessage(toFirebaseRemoteMessage(message)); - }, onError: (e) => print(e.toString())); - - h_push.Push.onMessageReceivedStream.listen((message) { - newMessage(toFirebaseRemoteMessage(message)); - }, onError: (e) => print(e.toString())); - - h_push.Push.getTokenStream.listen((token) { - onToken(token); - }, onError: (e) => print(e.toString())); - await h_push.Push.getToken(''); - - h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); - } - }).catchError((err) { - print(err); - }); + // await hmsApiAvailability.isHMSAvailable().then((value) async { + // if (value == 0) { + // h_push.Push.enableLogger(); + // final result = await h_push.Push.setAutoInitEnabled(true); + // + // h_push.Push.onNotificationOpenedApp.listen((message) { + // newMessage(toFirebaseRemoteMessage(message)); + // }, onError: (e) => print(e.toString())); + // + // h_push.Push.onMessageReceivedStream.listen((message) { + // newMessage(toFirebaseRemoteMessage(message)); + // }, onError: (e) => print(e.toString())); + // + // h_push.Push.getTokenStream.listen((token) { + // onToken(token); + // }, onError: (e) => print(e.toString())); + // await h_push.Push.getToken(''); + // + // h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); + // } + // }).catchError((err) { + // print(err); + // }); } } diff --git a/lib/widgets/app_map/google_huawei_map.dart b/lib/widgets/app_map/google_huawei_map.dart index 57e23d81..19dea57f 100644 --- a/lib/widgets/app_map/google_huawei_map.dart +++ b/lib/widgets/app_map/google_huawei_map.dart @@ -6,8 +6,8 @@ import 'package:flutter/material.dart'; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; -import 'package:huawei_map/map.dart' as hmsMap; +// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +// import 'package:huawei_map/map.dart' as hmsMap; class AppMap extends StatefulWidget { CameraPositionCallback onCameraMove; @@ -23,13 +23,13 @@ class AppMap extends StatefulWidget { State createState() => _state = AppMapState(); moveTo({@required CameraPosition cameraPostion}) { - if (_state.isHuawei) { - final cameraJson = cameraPostion.toMap(); - final camera = hmsMap.CameraPosition.fromMap(cameraJson); - _state._huaweiMapController.animateCamera(hmsMap.CameraUpdate.newCameraPosition(camera)); - } else { + // if (_state.isHuawei) { + // final cameraJson = cameraPostion.toMap(); + // final camera = hmsMap.CameraPosition.fromMap(cameraJson); + // _state._huaweiMapController.animateCamera(hmsMap.CameraUpdate.newCameraPosition(camera)); + // } else { _state.googleMapController.animateCamera(CameraUpdate.newCameraPosition(cameraPostion)); - } + // } } } @@ -39,23 +39,22 @@ class AppMapState extends State { Completer _googleMapControllerComp = Completer(); GoogleMapController googleMapController; - Completer _huaweiMapControllerComp = Completer(); - hmsMap.HuaweiMapController _huaweiMapController; + // Completer _huaweiMapControllerComp = Completer(); + // hmsMap.HuaweiMapController _huaweiMapController; + // HmsApiAvailability hmsApiAvailability; - HmsApiAvailability hmsApiAvailability; - - checkIsHuawei() async { - await hmsApiAvailability.isHMSAvailable().then((value) { - isHuawei = value == 0 ? true : false; - }); - print(isHuawei); - setState(() {}); - } + // checkIsHuawei() async { + // await hmsApiAvailability.isHMSAvailable().then((value) { + // isHuawei = value == 0 ? true : false; + // }); + // print(isHuawei); + // setState(() {}); + // } @override void initState() { - hmsApiAvailability = HmsApiAvailability(); - if (Platform.isAndroid) checkIsHuawei(); + // hmsApiAvailability = HmsApiAvailability(); + // if (Platform.isAndroid) checkIsHuawei(); super.initState(); } @@ -65,7 +64,7 @@ class AppMapState extends State { return map(); } - Widget map() => isHuawei ? huaweiMap() : googleMap(); + Widget map() => googleMap(); Widget googleMap() { return GoogleMap( @@ -84,23 +83,23 @@ class AppMapState extends State { ); } - Widget huaweiMap() { - return hmsMap.HuaweiMap( - mapType: hmsMap.MapType.normal, - zoomControlsEnabled: false, - myLocationButtonEnabled: true, - myLocationEnabled: true, - initialCameraPosition: hmsMap.CameraPosition.fromMap(widget.initialCamera), - onCameraMove: (camera) => widget.onCameraMove(CameraPosition.fromMap(camera.toMap())), - onMapCreated: (controller) { - _huaweiMapController = controller; - _huaweiMapControllerComp.complete(controller); - widget.onMapCreated(); - }, - onCameraIdle: () { - print("onCameraIdle"); - widget.onCameraIdle(); - }, - ); - } + // Widget huaweiMap() { + // return hmsMap.HuaweiMap( + // mapType: hmsMap.MapType.normal, + // zoomControlsEnabled: false, + // myLocationButtonEnabled: true, + // myLocationEnabled: true, + // initialCameraPosition: hmsMap.CameraPosition.fromMap(widget.initialCamera), + // onCameraMove: (camera) => widget.onCameraMove(CameraPosition.fromMap(camera.toMap())), + // onMapCreated: (controller) { + // _huaweiMapController = controller; + // _huaweiMapControllerComp.complete(controller); + // widget.onMapCreated(); + // }, + // onCameraIdle: () { + // print("onCameraIdle"); + // widget.onCameraIdle(); + // }, + // ); + // } } diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart index e5639f5c..f797b169 100644 --- a/lib/widgets/pickupLocation/PickupLocationFromMap.dart +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -1,5 +1,3 @@ -import 'dart:io'; - import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/ambulanceRequest/locationDetails.dart'; @@ -14,7 +12,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart'; -import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; class PickupLocationFromMap extends StatefulWidget { @@ -40,7 +38,7 @@ class _PickupLocationFromMapState extends State { double latitude = 0; double longitude = 0; - HmsApiAvailability hmsApiAvailability; + // HmsApiAvailability hmsApiAvailability; static CameraPosition kGooglePlex = CameraPosition( target: LatLng(24.126613,45.081137), @@ -49,10 +47,10 @@ class _PickupLocationFromMapState extends State { @override void initState() { - if(Platform.isAndroid) { - hmsApiAvailability = HmsApiAvailability(); - checkIsHuawei(); - } + // if(Platform.isAndroid) { + // hmsApiAvailability = HmsApiAvailability(); + // checkIsHuawei(); + // } appMap = AppMap( kGooglePlex.toMap(), @@ -74,16 +72,16 @@ class _PickupLocationFromMapState extends State { super.initState(); } - checkIsHuawei() async { - // isHuawei = await FlutterHmsGmsAvailability.isHmsAvailable; - // print(isHuawei); - // setState(() {}); - await hmsApiAvailability.isHMSAvailable().then((value) { - isHuawei = value == 0 ? true : false; - }); - print(isHuawei); - setState(() {}); - } + // checkIsHuawei() async { + // // isHuawei = await FlutterHmsGmsAvailability.isHmsAvailable; + // // print(isHuawei); + // // setState(() {}); + // await hmsApiAvailability.isHMSAvailable().then((value) { + // isHuawei = value == 0 ? true : false; + // }); + // print(isHuawei); + // setState(() {}); + // } @override Widget build(BuildContext context) { diff --git a/pubspec.yaml b/pubspec.yaml index c7ce510c..aa4753ec 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.005+4050005 +version: 4.5.007+4050007 environment: sdk: ">=2.7.0 <3.0.0" @@ -89,8 +89,8 @@ dependencies: google_maps_flutter: ^2.1.1 # Huawei - huawei_map: 6.0.1+305 - huawei_push: ^5.3.0+304 +# huawei_map: 6.0.1+305 +# huawei_push: ^5.3.0+304 # Qr code Scanner TODO fix it # barcode_scanner: ^1.0.1 @@ -189,8 +189,8 @@ dependencies: flutter_material_pickers: ^3.1.2 flutter_staggered_grid_view: ^0.4.1 # flutter_hms_gms_availability: ^2.0.0 - huawei_hmsavailability: ^6.6.0+300 - huawei_location: ^6.0.0+302 +# huawei_hmsavailability: ^6.6.0+300 +# huawei_location: ^6.0.0+302 # Marker Animation flutter_animarker: ^3.2.0