Booking appointment 1.0

merge-update-with-lab-changes
Mirza.Shafique 5 years ago
parent 288d64214e
commit 62631677ad

@ -46,7 +46,7 @@ const Map localizedValues = {
'doctor': {'en': 'Doctor', 'ar': 'الطبيب'}, 'doctor': {'en': 'Doctor', 'ar': 'الطبيب'},
'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'}, 'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'},
'doctorName': {'en': 'Doctor Name', 'ar': 'إسم الطبيب'}, 'doctorName': {'en': 'Doctor Name', 'ar': 'إسم الطبيب'},
'nearestAppo': {'en': 'Nearest appointment', 'ar': 'أقرب موعد'}, 'nearestAppo': {'en': 'Nearest Appointment', 'ar': 'أقرب موعد'},
'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'}, 'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'},
'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'}, 'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'},
'search': {'en': 'Search', 'ar': 'بحث'}, 'search': {'en': 'Search', 'ar': 'بحث'},

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -22,8 +23,7 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
@override @override
void initState() { void initState() {
_tabController = _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type);
new TabController(length: 2, vsync: this, initialIndex: widget.type);
super.initState(); super.initState();
} }
@ -32,28 +32,22 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.context = context; AppGlobal.context = context;
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: false,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
backgroundColor: Color(0xFFF7F7F7),
body: Container( body: Container(
child: Column( child: Column(
children: [ children: [
TabBar( TabBar(
tabs: [ tabs: [
Tab(child: Text(TranslationBase.of(context).clinicName, style: TextStyle(color: Colors.black))),
Tab( Tab(
child: Text(TranslationBase.of(context).clinicName, child: Text(TranslationBase.of(context).doctorName, style: TextStyle(color: Colors.black)),
style: TextStyle(color: Colors.black))),
Tab(
child: Text(TranslationBase.of(context).doctorName,
style: TextStyle(color: Colors.black)),
) )
], ],
controller: _tabController, controller: _tabController,
), ),
Divider(
color: Colors.grey[600],
thickness: 0.5,
),
Expanded( Expanded(
child: new TabBarView( child: new TabBarView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -43,6 +44,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
bool isProjectLoaded = false; bool isProjectLoaded = false;
ListClinicCentralized selectedClinic; ListClinicCentralized selectedClinic;
final GlobalKey dropdownKey = GlobalKey();
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
@ -56,11 +58,12 @@ class _SearchByClinicState extends State<SearchByClinic> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.all(10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Padding(
padding: const EdgeInsets.only(left: 2,right: 2),
child: Row(
children: <Widget>[ children: <Widget>[
Checkbox( Checkbox(
activeColor: new Color(0xFF40ACC9), activeColor: new Color(0xFF40ACC9),
@ -76,14 +79,17 @@ class _SearchByClinicState extends State<SearchByClinic> {
}); });
}, },
), ),
Text(TranslationBase.of(context).nearestAppo, Text(
style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)), TranslationBase.of(context).nearestAppo,
style: TextStyle(fontSize: 14.0, letterSpacing: -0.56),
),
], ],
), ),
widget.clnicIds != null && ),
widget.clnicIds.length > 1 && widget.clnicIds != null && widget.clnicIds.length > 1 && isLoaded == true
isLoaded == true ? Padding(
? Column( padding: const EdgeInsets.only(left: 20,right: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: clinicsList.map<Widget>((result) { children: clinicsList.map<Widget>((result) {
return RoundedContainer( return RoundedContainer(
@ -98,29 +104,47 @@ class _SearchByClinicState extends State<SearchByClinic> {
} }
}); });
}, },
title: Text(result.clinicDescription, title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0))));
}).toList()),
)
: InkWell(
onTap: () {
dropdownKey.currentState;
},
child: Container(
width: double.infinity,
margin: const EdgeInsets.only(left: 16,right: 16),
decoration: containerRadius(Colors.white, 12),
padding: EdgeInsets.only(left: 12, right: 12, top: 14, bottom: 14),
child: Row(
children: [
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Select Clinic",
style: TextStyle( style: TextStyle(
fontSize: 14.0, color: Colors.black,
color: Colors.grey[700], fontSize: 11,
letterSpacing: 1.0)))); letterSpacing: -0.44,
}).toList()) fontWeight: FontWeight.w600,
: Container(
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey[400],
width: 1.0,
), ),
borderRadius: BorderRadius.circular(10),
), ),
// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0), Container(
padding: EdgeInsets.all(8.0), height: 20,
width: MediaQuery.of(context).size.width,
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
key: dropdownKey,
hint: new Text(TranslationBase.of(context).selectClinic), hint: new Text(TranslationBase.of(context).selectClinic),
value: dropdownValue, value: dropdownValue,
iconSize: 0,
style: TextStyle(
color: Color(0xFF575757),
fontSize: 14,
letterSpacing: -0.56,
),
isExpanded: true,
items: clinicsList.map((item) { items: clinicsList.map((item) {
return new DropdownMenuItem<String>( return new DropdownMenuItem<String>(
value: item.clinicID.toString() + value: item.clinicID.toString() +
@ -130,18 +154,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
item.liveCareClinicID.toString() + item.liveCareClinicID.toString() +
"-" + "-" +
item.liveCareServiceID.toString(), item.liveCareServiceID.toString(),
child: Row( child: Text(item.clinicDescription),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(item.clinicDescription),
item.isLiveCareClinicAndOnline
? SvgPicture.asset(
'assets/images/new-design/video_icon_green_right.svg',
height: 15,
width: 15,
fit: BoxFit.cover)
: Container(),
]),
); );
}).toList(), }).toList(),
onChanged: (newValue) { onChanged: (newValue) {
@ -155,9 +168,18 @@ class _SearchByClinicState extends State<SearchByClinic> {
}); });
}, },
), ),
),
),
],
),
),
Icon(
Icons.keyboard_arrow_down_rounded,
),
],
)), )),
isDentalSelectedAndSupported() == true || ),
(nearestAppo && isProjectLoaded) isDentalSelectedAndSupported() == true || (nearestAppo && isProjectLoaded)
? Container( ? Container(
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -196,9 +218,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
} }
bool isDentalSelectedAndSupported() { bool isDentalSelectedAndSupported() {
return dropdownValue != "" && return dropdownValue != "" && (dropdownValue == "17") && isMobileAppDentalAllow;
(dropdownValue == "17") &&
isMobileAppDentalAllow;
} }
getClinicsList() { getClinicsList() {
@ -258,10 +278,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: LiveCareBookAppointment( page: LiveCareBookAppointment(clinicName: "Family Medicine", liveCareClinicID: dropdownValue.split("-")[2], liveCareServiceID: dropdownValue.split("-")[3]),
clinicName: "Family Medicine",
liveCareClinicID: dropdownValue.split("-")[2],
liveCareServiceID: dropdownValue.split("-")[3]),
), ),
).then((value) { ).then((value) {
print(value); print(value);
@ -285,17 +302,10 @@ class _SearchByClinicState extends State<SearchByClinic> {
List<String> arrDistance = []; List<String> arrDistance = [];
List<String> result; List<String> result;
int numAll; int numAll;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
List();
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.getDoctorsList(int.parse(dropdownValue.split("-")[0]), projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, context).then((res) {
.getDoctorsList(
int.parse(dropdownValue.split("-")[0]),
projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0,
nearestAppo,
context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
@ -305,27 +315,17 @@ class _SearchByClinicState extends State<SearchByClinic> {
doctorsList.add(new DoctorList.fromJson(v)); doctorsList.add(new DoctorList.fromJson(v));
}); });
doctorsList.forEach((element) { doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
_patientDoctorAppointmentListHospital
.where( .where(
(elementClinic) => (elementClinic) => elementClinic.filterName == element.projectName,
elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[ _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
_patientDoctorAppointmentListHospital
.indexOf(doctorByHospital[0])]
.patientDoctorAppointmentList
.add(element);
} else { } else {
_patientDoctorAppointmentListHospital.add( _patientDoctorAppointmentListHospital
PatientDoctorAppointmentList( .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
filterName: element.projectName,
distanceInKMs:
element.projectDistanceInKiloMeters.toString(),
patientDoctorAppointment: element));
} }
}); });
} else {} } else {}
@ -333,8 +333,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
result = LinkedHashSet<String>.from(arr).toList(); result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length; numAll = result.length;
navigateToSearchResults( navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
context, doctorsList, _patientDoctorAppointmentListHospital);
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
@ -345,8 +344,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
}); });
} }
Future navigateToDentalComplaints( Future navigateToDentalComplaints(BuildContext context, SearchInfo searchInfo) async {
BuildContext context, SearchInfo searchInfo) async {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -355,20 +353,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
); );
} }
Future navigateToSearchResults( Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async {
context,
List<DoctorList> docList,
List<PatientDoctorAppointmentList>
patientDoctorAppointmentListHospital) async {
isProjectLoaded = false; isProjectLoaded = false;
Navigator.push( Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)))
context,
FadePage(
page: SearchResults(
isLiveCareAppointment: false,
doctorsList: docList,
patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital)))
.then((value) { .then((value) {
getProjectsList(); getProjectsList();
}); });
@ -377,9 +364,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
filterClinic() { filterClinic() {
setState(() { setState(() {
if (widget.clnicIds != null && widget.clnicIds.length > 0) { if (widget.clnicIds != null && widget.clnicIds.length > 0) {
clinicsList = clinicsList clinicsList = clinicsList.where((i) => widget.clnicIds.indexOf(i.clinicID) > -1).toList();
.where((i) => widget.clnicIds.indexOf(i.clinicID) > -1)
.toList();
isLoaded = true; isLoaded = true;
} }
}); });

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart';
@ -613,7 +614,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}, },
), ),
MedicalProfilePageNew(), MedicalProfilePageNew(),
BookingOptions(), Search(),
MyFamily(isAppbarVisible: false), MyFamily(isAppbarVisible: false),
ToDo(isShowAppBar: false), ToDo(isShowAppBar: false),
], // Please do not remove the BookingOptions from this array ], // Please do not remove the BookingOptions from this array

@ -20,7 +20,6 @@ import 'package:huawei_location/location/location_availability.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
class LocationUtils { class LocationUtils {
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
bool isShowConfirmDialog; bool isShowConfirmDialog;
@ -30,24 +29,20 @@ class LocationUtils {
void getCurrentLocation({Function(LatLng) callBack}) async { void getCurrentLocation({Function(LatLng) callBack}) async {
print("current location"); print("current location");
if(Platform.isAndroid && (await FlutterHmsGmsAvailability.isHmsAvailable)) { if (Platform.isAndroid && (await FlutterHmsGmsAvailability.isHmsAvailable)) {
_getHMSCurrentLocation(callBack); _getHMSCurrentLocation(callBack);
}else{ } else {
Geolocator.isLocationServiceEnabled().then((value) { Geolocator.isLocationServiceEnabled().then((value) {
if (value) { if (value) {
Geolocator.checkPermission().then((permission) { Geolocator.checkPermission().then((permission) {
if (permission == LocationPermission.always || if (permission == LocationPermission.always || permission == LocationPermission.whileInUse) {
permission == LocationPermission.whileInUse) { Geolocator.getLastKnownPosition().then((value) {
Geolocator.getLastKnownPosition()
.then((value){
setLocation(value); setLocation(value);
if(callBack != null) if (callBack != null) callBack(LatLng(value.latitude, value.longitude));
callBack(LatLng(value.latitude, value.longitude));
}); });
} }
if (permission == LocationPermission.denied || if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) {
permission == LocationPermission.deniedForever) {
setZeroLocation(); setZeroLocation();
if (isShowConfirmDialog) showErrorLocationDialog(false); if (isShowConfirmDialog) showErrorLocationDialog(false);
} }
@ -64,11 +59,12 @@ class LocationUtils {
} }
LocationCallback _locationCallback; LocationCallback _locationCallback;
_getHMSCurrentLocation(Function(LatLng) callBack) async{
_getHMSCurrentLocation(Function(LatLng) callBack) async {
PermissionHandler permissionHandler = PermissionHandler(); PermissionHandler permissionHandler = PermissionHandler();
int _locationUpdateCbId = 0; int _locationUpdateCbId = 0;
doIt(){ doIt() {
FusedLocationProviderClient locationService = FusedLocationProviderClient(); FusedLocationProviderClient locationService = FusedLocationProviderClient();
LocationRequest locationRequest = LocationRequest(); LocationRequest locationRequest = LocationRequest();
locationRequest.priority = LocationRequest.PRIORITY_HIGH_ACCURACY; locationRequest.priority = LocationRequest.PRIORITY_HIGH_ACCURACY;
@ -76,37 +72,31 @@ class LocationUtils {
List<LocationRequest> locationRequestList = <LocationRequest>[locationRequest]; List<LocationRequest> locationRequestList = <LocationRequest>[locationRequest];
LocationSettingsRequest locationSettingsRequest = LocationSettingsRequest(requests: locationRequestList); LocationSettingsRequest locationSettingsRequest = LocationSettingsRequest(requests: locationRequestList);
locationService.checkLocationSettings(locationSettingsRequest).then((settings) async{ locationService.checkLocationSettings(locationSettingsRequest).then((settings) async {
_locationUpdateCbId = await locationService.requestLocationUpdatesCb(
_locationUpdateCbId = await locationService.requestLocationUpdatesCb(locationRequest, LocationCallback(onLocationResult: (locationResult){ locationRequest,
LocationCallback(onLocationResult: (locationResult) {
Location location = locationResult.lastLocation; Location location = locationResult.lastLocation;
locationService.removeLocationUpdatesCb(_locationUpdateCbId); locationService.removeLocationUpdatesCb(_locationUpdateCbId);
callBack(LatLng(location.latitude, location.longitude)); callBack(LatLng(location.latitude, location.longitude));
setLocation(Position(latitude: location.latitude, longitude: location.longitude, altitude: location.altitude)); setLocation(Position(latitude: location.latitude, longitude: location.longitude, altitude: location.altitude));
}, onLocationAvailability: (locationAvailability){ }, onLocationAvailability: (locationAvailability) {
debugPrint("onLocationAvailability: $locationAvailability"); debugPrint("onLocationAvailability: $locationAvailability");
})); }));
}).catchError((error) {
}).catchError((error){ if (error.code == "LOCATION_SETTINGS_NOT_AVAILABLE") {
if(error.code == "LOCATION_SETTINGS_NOT_AVAILABLE"){
// Location service not enabled. // Location service not enabled.
} }
}); });
} }
if (await permissionHandler.hasLocationPermission()) {
if(await permissionHandler.hasLocationPermission()){
doIt(); doIt();
}else{ } else {
bool has = await requestPermissions(); bool has = await requestPermissions();
if(has) if (has)
doIt(); doIt();
else if(isShowConfirmDialog) else if (isShowConfirmDialog) showErrorLocationDialog(false);
showErrorLocationDialog(false);
} }
} }
@ -116,24 +106,14 @@ class LocationUtils {
confirmMessage: TranslationBase.of(context).locationDialogMessage, confirmMessage: TranslationBase.of(context).locationDialogMessage,
okText: TranslationBase.of(context).confirm, okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => { okFunction: () => {ConfirmDialog.closeAlertDialog(context), if (isPermissionError) Geolocator.openAppSettings() else Geolocator.openLocationSettings()},
ConfirmDialog.closeAlertDialog(context),
if (isPermissionError)
Geolocator.openAppSettings()
else
Geolocator.openLocationSettings()
},
cancelFunction: () => {}); cancelFunction: () => {});
return dialog.showAlertDialog(context); return dialog.showAlertDialog(context);
} }
void setLocation(Position position) { void setLocation(Position position) {
this this.sharedPref.setDouble(USER_LAT, position != null ? position.latitude : 0.0);
.sharedPref this.sharedPref.setDouble(USER_LONG, position != null ? position.longitude : 0.0);
.setDouble(USER_LAT, position != null ? position.latitude : 0.0);
this
.sharedPref
.setDouble(USER_LONG, position != null ? position.longitude : 0.0);
} }
void setZeroLocation() { void setZeroLocation() {
@ -141,7 +121,6 @@ class LocationUtils {
this.sharedPref.setDouble(USER_LONG, 0.0); this.sharedPref.setDouble(USER_LONG, 0.0);
} }
Future<bool> requestPermissions() async { Future<bool> requestPermissions() async {
var result = await [ var result = await [
Permission.location, Permission.location,

@ -564,6 +564,8 @@ class _AppDrawerState extends State<AppDrawer> {
Provider.of<ProjectViewModel>(context, listen: false).user = authenticatedUserObject.user; Provider.of<ProjectViewModel>(context, listen: false).user = authenticatedUserObject.user;
Provider.of<ProjectViewModel>(context, listen: false).setUser(authenticatedUserObject.user); Provider.of<ProjectViewModel>(context, listen: false).setUser(authenticatedUserObject.user);
await pharmacyModuleViewModel.generatePharmacyToken(); await pharmacyModuleViewModel.generatePharmacyToken();
_vitalSignService.heightCm = "";
_vitalSignService.weightKg = "";
if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser(); if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser();

Loading…
Cancel
Save