diff --git a/lib/config/config.dart b/lib/config/config.dart index d7ffabcd..7840b97d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart index 523d1296..da7adec2 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -17,8 +17,9 @@ import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; - +import 'package:diplomaticquarterapp/widgets/app_map/google_huawei_map.dart'; import 'location_page.dart'; +import 'package:geolocator/geolocator.dart'; class NewHomeHealthCareStepTowPage extends StatefulWidget { final Function(PickResult) onPick; @@ -39,35 +40,47 @@ class _NewHomeHealthCareStepTowPageState extends State _controller = Completer(); - GoogleMapController googleMapController; final Set markers = new Set(); + AppMap appMap; static CameraPosition _kGooglePlex = CameraPosition( target: LatLng(37.42796133580664, -122.085749655962), zoom: 14.4746, ); + LatLng currentPostion; + Completer mapController = Completer(); @override void initState() { - if (widget.patientERInsertPresOrderRequestModel.latitude == null) { - setLatitudeAndLongitude(); - } else { - latitude = widget.patientERInsertPresOrderRequestModel.latitude; - longitude = widget.patientERInsertPresOrderRequestModel.longitude; - } - - markers.clear(); - markers.add( - Marker( - markerId: MarkerId( - latitude.hashCode.toString(), - ), - position: LatLng(latitude, longitude)), + appMap = AppMap( + _kGooglePlex.toMap(), + onCameraMove: (camera) { + _updatePosition(camera); + }, + onMapCreated: () { + goToCurrentLocation(); + setState(() {}); + }, ); + // if (widget.patientERInsertPresOrderRequestModel.latitude == null) { + // setLatitudeAndLongitude(); + // } else { + // latitude = widget.patientERInsertPresOrderRequestModel.latitude; + // longitude = widget.patientERInsertPresOrderRequestModel.longitude; + // } + + // markers.clear(); + // markers.add( + // Marker( + // markerId: MarkerId( + // latitude.hashCode.toString(), + // ), + // position: LatLng(latitude, longitude)), + // ); + + // _kGooglePlex = CameraPosition( + // target: LatLng(latitude, longitude), + // zoom: 14.4746, + // ); - _kGooglePlex = CameraPosition( - target: LatLng(latitude, longitude), - zoom: 14.4746, - ); super.initState(); } @@ -87,9 +100,21 @@ class _NewHomeHealthCareStepTowPageState extends State _updatePosition(_position)), + // onMapCreated: (GoogleMapController controller) { + // googleMapController = controller; + // _controller.complete(controller); + // }, + // ), + // Icon( + // Icons.place, + // color: CustomColors.accentColor, + // size: 50, + // ), + // ], + // ), + // ), Expanded( child: Stack( alignment: Alignment.center, children: [ - GoogleMap( - mapType: MapType.normal, - zoomControlsEnabled: false, - myLocationButtonEnabled: true, - myLocationEnabled: true, - initialCameraPosition: _kGooglePlex, - onCameraMove: ((_position) => _updatePosition(_position)), - onMapCreated: (GoogleMapController controller) { - googleMapController = controller; - _controller.complete(controller); - }, - ), + if (appMap != null) appMap, Icon( Icons.place, color: CustomColors.accentColor, @@ -246,4 +284,27 @@ class _NewHomeHealthCareStepTowPageState extends State { onModelReady: (model2) => model2.getFreeSlots(doctorList), allowAny: true, builder: (_, model2, widget2) { - if (model.freeSlots.length > 0 && isPageChange == false && model.state == ViewState.Idle) { - this.freeSlots = model.freeSlots; + if (model2.freeSlots.length > 0 && isPageChange == false && model2.state == ViewState.Idle) { + this.freeSlots = model2.freeSlots; this.doctorScheduleResponse = model.getDoctorScheduleList; this.generateWeeksSchedules(); - } else if (model.freeSlots.length == 0 && model.state == ViewState.Idle) { + } else if (model2.freeSlots.length == 0 && model2.state == ViewState.Idle) { AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule); Navigator.pop(context); }