Merge branch 'development_new_design_2.0' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into development_new_design_2.0

merge-requests/390/head
Sultan Khan 4 years ago
commit 32f62fbe56

@ -23,7 +23,7 @@ class CMCService extends BaseService {
bool isOrderUpdated;
Future getCMCAllServices() async {
GetCMCServicesRequestModel getCMCServicesRequestModel = new GetCMCServicesRequestModel(genderID: user.gender, identificationNo: user.patientIdentificationNo);
GetCMCServicesRequestModel getCMCServicesRequestModel = new GetCMCServicesRequestModel(genderID: authenticatedUserObject.user.gender, identificationNo: authenticatedUserObject.user.patientIdentificationNo);
hasError = false;
await baseAppClient.post(HHC_GET_ALL_CMC_SERVICES, onSuccess: (dynamic response, int statusCode) {
cmcAllServicesList.clear();

@ -16,15 +16,15 @@ class CustomerAddressesService extends BaseService {
addNewAddressRequestModel.customer.roleIds = [3];
addNewAddressRequestModel.customer.addresses[0].email = customerInfo.email;
addNewAddressRequestModel.customer.addresses[0].phoneNumber = customerInfo.mobileNumber;
addNewAddressRequestModel.customer.addresses[0].firstName = user.firstName;
addNewAddressRequestModel.customer.addresses[0].lastName = user.lastName;
addNewAddressRequestModel.customer.addresses[0].firstName = authenticatedUserObject.user.firstName;
addNewAddressRequestModel.customer.addresses[0].lastName = authenticatedUserObject.user.lastName;
addNewAddressRequestModel.customer.addresses[0].countryId = 69;
var f = DateFormat('E, d MMM yyyy HH:mm:ss');
var date = f.format(DateTime.now().toUtc()) + " GMT";
addNewAddressRequestModel.customer.addresses[0].createdOnUtc = date;
hasError = false;
await baseAppClient.post(ADD_CUSTOMER_ADDRESS, onSuccess: (dynamic response, int statusCode) {
await baseAppClient.postPharmacy(ADD_CUSTOMER_ADDRESS, onSuccess: (dynamic response, int statusCode) {
addressesList.clear();
response["customers"][0]["addresses"].forEach((data) {
addressesList.add(AddressInfo.fromJson(data));
@ -50,7 +50,7 @@ class CustomerAddressesService extends BaseService {
}
Future getCustomerInfo() async {
Map<String, String> queryParams = {'FileNumber': '${user.patientID}'};
Map<String, String> queryParams = {'FileNumber': '${authenticatedUserObject.user.patientID}'};
hasError = false;
await baseAppClient.getPharmacy(BASE_PHARMACY_URL + GET_CUSTOMER_INFO, onSuccess: (dynamic response, int statusCode) {

@ -10,7 +10,7 @@ class BaseService {
String error;
bool hasError = false;
BaseAppClient baseAppClient = BaseAppClient();
AuthenticatedUser user;
AuthenticatedUser user = new AuthenticatedUser();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();

@ -34,17 +34,6 @@ class PharmacyAddressesViewModel extends BaseViewModel {
}
}
/* Future getCountries(String countryName) async {
setState(ViewState.Busy);
await _pharmacyAddressService.getCountries(countryName);
if (_pharmacyAddressService.hasError) {
error = _pharmacyAddressService.error;
// setState(ViewState.Error);
} else {
// setState(ViewState.Idle);
}
}*/
Future addEditAddress(PickResult value, Addresses editedAddress) async {
setState(ViewState.Busy);

@ -1,19 +1,18 @@
import 'dart:async';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
@ -45,6 +44,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
double longitude = 0;
AddressInfo _selectedAddress;
bool showCurrentLocation = false;
AppSharedPreferences sharedPref = AppSharedPreferences();
Completer<GoogleMapController> _controller = Completer();
GoogleMapController googleMapController;
@ -56,21 +56,25 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
LatLng currentPostion;
void _getUserLocation() async {
if (await Permission.contacts.request().isGranted) {
// Either the permission was already granted before or the user just granted it.
var position = await GeolocatorPlatform.instance.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
currentPostion = LatLng(position.latitude, position.longitude);
if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
var lat = await this.sharedPref.getDouble(USER_LAT);
var long = await this.sharedPref.getDouble(USER_LONG);
currentPostion = LatLng(lat, long);
setMap();
} else {
requestPermissions().then((value) async {
if (value[Permission.location].isGranted) {
var position = await GeolocatorPlatform.instance.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
currentPostion = LatLng(position.latitude, position.longitude);
setMap();
}
});
if (await Permission.location.request().isGranted) {
var position = await GeolocatorPlatform.instance.getCurrentPosition(desiredAccuracy: LocationAccuracy.low);
currentPostion = LatLng(position.latitude, position.longitude);
setMap();
} else {
requestPermissions().then((value) async {
if (value[Permission.location].isGranted) {
var position = await GeolocatorPlatform.instance.getCurrentPosition(desiredAccuracy: LocationAccuracy.low);
currentPostion = LatLng(position.latitude, position.longitude);
setMap();
}
});
}
}
}
@ -90,7 +94,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
CameraUpdate.newCameraPosition(
CameraPosition(
target: currentPostion,
zoom: 20,
zoom: 16,
),
),
);
@ -122,6 +126,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
currentPostion = LatLng(latitude, longitude);
setMap();
}
}

Loading…
Cancel
Save