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,108 +58,128 @@ 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(
children: <Widget>[ padding: const EdgeInsets.only(left: 2,right: 2),
Checkbox( child: Row(
activeColor: new Color(0xFF40ACC9), children: <Widget>[
value: nearestAppo, Checkbox(
onChanged: (bool value) { activeColor: new Color(0xFF40ACC9),
setState(() { value: nearestAppo,
nearestAppo = value; onChanged: (bool value) {
print(nearestAppo); setState(() {
if (nearestAppo) nearestAppo = value;
getProjectsList(); print(nearestAppo);
else if (nearestAppo)
isProjectLoaded = false; getProjectsList();
}); else
}, isProjectLoaded = false;
), });
Text(TranslationBase.of(context).nearestAppo, },
style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)), ),
], Text(
TranslationBase.of(context).nearestAppo,
style: TextStyle(fontSize: 14.0, letterSpacing: -0.56),
),
],
),
), ),
widget.clnicIds != null && widget.clnicIds != null && widget.clnicIds.length > 1 && isLoaded == true
widget.clnicIds.length > 1 && ? Padding(
isLoaded == true padding: const EdgeInsets.only(left: 20,right: 20),
? Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: clinicsList.map<Widget>((result) { children: clinicsList.map<Widget>((result) {
return RoundedContainer( return RoundedContainer(
child: ListTile( child: ListTile(
onTap: () { onTap: () {
// setState(() { // setState(() {
dropdownValue = result.clinicID.toString(); dropdownValue = result.clinicID.toString();
setState(() { setState(() {
if (!isDentalSelectedAndSupported()) { if (!isDentalSelectedAndSupported()) {
projectDropdownValue = ""; projectDropdownValue = "";
getDoctorsList(context); getDoctorsList(context);
} }
}); });
}, },
title: Text(result.clinicDescription, title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0))));
style: TextStyle( }).toList()),
fontSize: 14.0, )
color: Colors.grey[700], : InkWell(
letterSpacing: 1.0)))); onTap: () {
}).toList()) dropdownKey.currentState;
: Container( },
height: 60.0, child: Container(
decoration: BoxDecoration( width: double.infinity,
color: Colors.white, margin: const EdgeInsets.only(left: 16,right: 16),
border: Border.all( decoration: containerRadius(Colors.white, 12),
color: Colors.grey[400], padding: EdgeInsets.only(left: 12, right: 12, top: 14, bottom: 14),
width: 1.0, child: Row(
), children: [
borderRadius: BorderRadius.circular(10), Flexible(
), child: Column(
// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0), crossAxisAlignment: CrossAxisAlignment.start,
padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
hint: new Text(TranslationBase.of(context).selectClinic),
value: dropdownValue,
items: clinicsList.map((item) {
return new DropdownMenuItem<String>(
value: item.clinicID.toString() +
"-" +
item.isLiveCareClinicAndOnline.toString() +
"-" +
item.liveCareClinicID.toString() +
"-" +
item.liveCareServiceID.toString(),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text(item.clinicDescription), Text(
item.isLiveCareClinicAndOnline "Select Clinic",
? SvgPicture.asset( style: TextStyle(
'assets/images/new-design/video_icon_green_right.svg', color: Colors.black,
height: 15, fontSize: 11,
width: 15, letterSpacing: -0.44,
fit: BoxFit.cover) fontWeight: FontWeight.w600,
: Container(), ),
]), ),
); Container(
}).toList(), height: 20,
onChanged: (newValue) { child: DropdownButtonHideUnderline(
setState(() { child: DropdownButton<String>(
print(newValue); key: dropdownKey,
dropdownValue = newValue; hint: new Text(TranslationBase.of(context).selectClinic),
if (!isDentalSelectedAndSupported() && !nearestAppo) { value: dropdownValue,
projectDropdownValue = ""; iconSize: 0,
getDoctorsList(context); style: TextStyle(
} color: Color(0xFF575757),
}); fontSize: 14,
}, letterSpacing: -0.56,
), ),
)), isExpanded: true,
isDentalSelectedAndSupported() == true || items: clinicsList.map((item) {
(nearestAppo && isProjectLoaded) return new DropdownMenuItem<String>(
value: item.clinicID.toString() +
"-" +
item.isLiveCareClinicAndOnline.toString() +
"-" +
item.liveCareClinicID.toString() +
"-" +
item.liveCareServiceID.toString(),
child: Text(item.clinicDescription),
);
}).toList(),
onChanged: (newValue) {
setState(() {
print(newValue);
dropdownValue = newValue;
if (!isDentalSelectedAndSupported() && !nearestAppo) {
projectDropdownValue = "";
getDoctorsList(context);
}
});
},
),
),
),
],
),
),
Icon(
Icons.keyboard_arrow_down_rounded,
),
],
)),
),
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.filterName == element.projectName,
(elementClinic) => )
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() setLocation(value);
.then((value){ if (callBack != null) callBack(LatLng(value.latitude, value.longitude));
setLocation(value);
if(callBack != null)
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,
Location location = locationResult.lastLocation; LocationCallback(onLocationResult: (locationResult) {
locationService.removeLocationUpdatesCb(_locationUpdateCbId); Location location = locationResult.lastLocation;
callBack(LatLng(location.latitude, location.longitude)); locationService.removeLocationUpdatesCb(_locationUpdateCbId);
setLocation(Position(latitude: location.latitude, longitude: location.longitude, altitude: location.altitude)); callBack(LatLng(location.latitude, location.longitude));
}, onLocationAvailability: (locationAvailability){ setLocation(Position(latitude: location.latitude, longitude: location.longitude, altitude: location.altitude));
debugPrint("onLocationAvailability: $locationAvailability"); }, 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