Updates & fixes

master
mobileteam 2 weeks ago
parent a8547a9bd3
commit bd00e07c13

@ -187,7 +187,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; //0560717232 // body['MobileNo'] = "531940021"; //0560717232
// body['PatientID'] = 5690832; //4609100 // body['PatientID'] = 10714; //4609100
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574

@ -19,10 +19,13 @@ class _BookingOptionsState extends State<BookingOptions> {
@override @override
void initState() { void initState() {
locationUtils = locationUtils = new LocationUtils(
new LocationUtils(isShowConfirmDialog: true, context: context); isShowConfirmDialog: false,
WidgetsBinding.instance isShowLocationTimeoutDialog: false,
.addPostFrameCallback((_) => locationUtils.getCurrentLocation()); context: context);
WidgetsBinding.instance.addPostFrameCallback((_) =>
locationUtils.getCurrentLocation(
isShowConfirmDialog: false, isShowLocationTimeoutDialog: false));
super.initState(); super.initState();
} }

@ -29,67 +29,67 @@ class _HospitalsPageState extends State<HospitalsPage> {
itemBuilder: (context, index) => HospitalLocation(widget.findusHospitalModelList[index]), itemBuilder: (context, index) => HospitalLocation(widget.findusHospitalModelList[index]),
itemCount: widget.findusHospitalModelList.length, itemCount: widget.findusHospitalModelList.length,
), ),
Container( // Container(
margin: EdgeInsets.only(top: 14), // margin: EdgeInsets.only(top: 14),
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.all( // borderRadius: BorderRadius.all(
Radius.circular(10.0), // Radius.circular(10.0),
), // ),
boxShadow: [ // boxShadow: [
BoxShadow( // BoxShadow(
color: Color(0xff000000).withOpacity(.05), // color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5, // //spreadRadius: 5,
blurRadius: 27, // blurRadius: 27,
offset: Offset(0, -3), // offset: Offset(0, -3),
), // ),
], // ],
color: Colors.white), // color: Colors.white),
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ // children: [
IconButton( // IconButton(
icon: new Image.asset('assets/images/new-design/youtube.png'), // icon: new Image.asset('assets/images/new-design/youtube.png'),
iconSize: 48, // iconSize: 48,
tooltip: 'Youtube', // tooltip: 'Youtube',
onPressed: () { // onPressed: () {
setState(() { // setState(() {
launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); // launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals");
}); // });
}, // },
), // ),
IconButton( // IconButton(
icon: new Image.asset('assets/images/new-design/linkedin.png'), // icon: new Image.asset('assets/images/new-design/linkedin.png'),
tooltip: 'LinkedIn', // tooltip: 'LinkedIn',
iconSize: 48, // iconSize: 48,
onPressed: () { // onPressed: () {
setState(() { // setState(() {
launch("https://www.linkedin.com/company/drsulaiman-alhabib-medical-group"); // launch("https://www.linkedin.com/company/drsulaiman-alhabib-medical-group");
}); // });
}, // },
), // ),
IconButton( // IconButton(
icon: new Image.asset('assets/images/new-design/twitter.png'), // icon: new Image.asset('assets/images/new-design/twitter.png'),
tooltip: 'Twitter', // tooltip: 'Twitter',
iconSize: 48, // iconSize: 48,
onPressed: () { // onPressed: () {
setState(() { // setState(() {
launch("https://twitter.com/HMG"); // launch("https://twitter.com/HMG");
}); // });
}, // },
), // ),
IconButton( // IconButton(
icon: new Image.asset('assets/images/new-design/facebook.png'), // icon: new Image.asset('assets/images/new-design/facebook.png'),
tooltip: 'facebook', // tooltip: 'facebook',
iconSize: 48, // iconSize: 48,
onPressed: () { // onPressed: () {
setState(() { // setState(() {
launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); // launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn");
}); // });
}, // },
), // ),
], // ],
), // ),
), // ),
], ],
), ),
); );

@ -29,67 +29,67 @@ class _PharmaciesPageState extends State<PharmaciesPage> {
itemBuilder: (context, index) => HospitalLocation(widget.findusPharmaciesModelList[index], showCity: true), itemBuilder: (context, index) => HospitalLocation(widget.findusPharmaciesModelList[index], showCity: true),
itemCount: widget.findusPharmaciesModelList.length, itemCount: widget.findusPharmaciesModelList.length,
), ),
Container( // Container(
margin: EdgeInsets.only(top: 14), // margin: EdgeInsets.only(top: 14),
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.all( // borderRadius: BorderRadius.all(
Radius.circular(10.0), // Radius.circular(10.0),
), // ),
boxShadow: [ // boxShadow: [
BoxShadow( // BoxShadow(
color: Color(0xff000000).withOpacity(.05), // color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5, // //spreadRadius: 5,
blurRadius: 27, // blurRadius: 27,
offset: Offset(0, -3), // offset: Offset(0, -3),
), // ),
], // ],
color: Colors.white), // color: Colors.white),
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ // children: [
IconButton( // IconButton(
icon: new Image.asset('assets/images/new-design/youtube.png'), // icon: new Image.asset('assets/images/new-design/youtube.png'),
iconSize: 48, // iconSize: 48,
tooltip: 'Youtube', // tooltip: 'Youtube',
onPressed: () { // onPressed: () {
setState(() { // setState(() {
launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); // launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals");
}); // });
}, // },
), // ),
IconButton( // IconButton(
icon: new Image.asset('assets/images/new-design/linkedin.png'), // icon: new Image.asset('assets/images/new-design/linkedin.png'),
tooltip: 'LinkedIn', // tooltip: 'LinkedIn',
iconSize: 48, // iconSize: 48,
onPressed: () { // onPressed: () {
setState(() { // setState(() {
launch("https://www.linkedin.com/company/drsulaiman-alhabib-medical-group"); // launch("https://www.linkedin.com/company/drsulaiman-alhabib-medical-group");
}); // });
}, // },
), // ),
IconButton( // IconButton(
icon: new Image.asset('assets/images/new-design/twitter.png'), // icon: new Image.asset('assets/images/new-design/twitter.png'),
tooltip: 'Twitter', // tooltip: 'Twitter',
iconSize: 48, // iconSize: 48,
onPressed: () { // onPressed: () {
setState(() { // setState(() {
launch("https://twitter.com/HMG"); // launch("https://twitter.com/HMG");
}); // });
}, // },
), // ),
IconButton( // IconButton(
icon: new Image.asset('assets/images/new-design/facebook.png'), // icon: new Image.asset('assets/images/new-design/facebook.png'),
tooltip: 'facebook', // tooltip: 'facebook',
iconSize: 48, // iconSize: 48,
onPressed: () { // onPressed: () {
setState(() { // setState(() {
launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); // launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn");
}); // });
}, // },
), // ),
], // ],
), // ),
), // ),
], ],
), ),
); );

@ -27,8 +27,10 @@ class _ErOptionsState extends State<ErOptions> {
@override @override
void initState() { void initState() {
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils =
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation()); new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance
.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
super.initState(); super.initState();
} }
@ -46,23 +48,27 @@ class _ErOptionsState extends State<ErOptions> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: Color(0xffF8F8F8), backgroundColor: Color(0xffF8F8F8),
body: GridView( body: GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 2 / 2,
crossAxisSpacing: 12,
mainAxisSpacing: 12),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
shrinkWrap: true, shrinkWrap: true,
children: [ children: [
InkWell( // InkWell(
onTap: () { // onTap: () {
if (projectViewModel.havePrivilege(63)) Navigator.push(context, FadePage(page: AmbulanceReq())); // if (projectViewModel.havePrivilege(63)) Navigator.push(context, FadePage(page: AmbulanceReq()));
}, // },
child: MedicalProfileItem( // child: MedicalProfileItem(
title: TranslationBase.of(context).ambulancerequest, // title: TranslationBase.of(context).ambulancerequest,
imagePath: 'assets/images/new-design/AM.PNG', // imagePath: 'assets/images/new-design/AM.PNG',
subTitle: TranslationBase.of(context).requestA, // subTitle: TranslationBase.of(context).requestA,
isPngImage: true, // isPngImage: true,
isEnable: projectViewModel.havePrivilege(63), // isEnable: projectViewModel.havePrivilege(63),
), // ),
), // ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: NearestEr())); Navigator.push(context, FadePage(page: NearestEr()));
@ -74,21 +80,22 @@ class _ErOptionsState extends State<ErOptions> {
isPngImage: true, isPngImage: true,
), ),
), ),
// InkWell(
// onTap: () {
// if (rrtLocked) Navigator.push(context, FadePage(page: RRTMainScreen()));
// },
// child: MedicalProfileItem(
// title: TranslationBase.of(context).RRTTitle,
// imagePath: 'assets/images/new-design/AM.PNG',
// subTitle: TranslationBase.of(context).RRTSubTitle,
// isPngImage: true,
// isEnable: rrtLocked,
// ),
// ),
InkWell( InkWell(
onTap: () { onTap: () {
if (rrtLocked) Navigator.push(context, FadePage(page: RRTMainScreen())); if (projectViewModel.havePrivilege(81))
}, Navigator.push(context, FadePage(page: DdServicesPage()));
child: MedicalProfileItem(
title: TranslationBase.of(context).RRTTitle,
imagePath: 'assets/images/new-design/AM.PNG',
subTitle: TranslationBase.of(context).RRTSubTitle,
isPngImage: true,
isEnable: rrtLocked,
),
),
InkWell(
onTap: () {
if (projectViewModel.havePrivilege(81)) Navigator.push(context, FadePage(page: DdServicesPage()));
// Navigator.push(context, FadePage(page: DdServicesPage())); // Navigator.push(context, FadePage(page: DdServicesPage()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(

@ -49,13 +49,13 @@ class _InsuranceCardState extends State<InsuranceCard> {
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor, backgroundColor: CustomColors.appBackgroudGreyColor,
floatingActionButton: FloatingActionButton.extended( // floatingActionButton: FloatingActionButton.extended(
onPressed: () { // onPressed: () {
Navigator.push(context, FadePage(page: InsuranceUpdate())); // Navigator.push(context, FadePage(page: InsuranceUpdate()));
}, // },
backgroundColor: CustomColors.accentColor, // backgroundColor: CustomColors.accentColor,
label: Text(TranslationBase.of(context).update, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold)), // label: Text(TranslationBase.of(context).update, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold)),
), // ),
body: Container( body: Container(
child: ListView.separated( child: ListView.separated(
itemCount: model.insurance == null ? 0 : model.insurance.length, itemCount: model.insurance == null ? 0 : model.insurance.length,

@ -47,7 +47,7 @@ class AllergiesPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).remarks+" :"), Texts(TranslationBase.of(context).remarks+" : " + model.allergies[index].remarks! ?? ''),
Texts(TranslationBase.of(context).description + ": " + model.allergies[index].description! ?? ''), Texts(TranslationBase.of(context).description + ": " + model.allergies[index].description! ?? ''),
], ],
), ),

@ -72,7 +72,7 @@ class PrescriptionItemsPage extends StatelessWidget {
prescriptions.doctorRate, prescriptions.doctorRate,
prescriptions.actualDoctorRate, prescriptions.actualDoctorRate,
prescriptions.noOfPatientsRate, prescriptions.noOfPatientsRate,
projectViewModel.user.emailAddress!, projectViewModel.user.emailAddress ?? "",
), ),
isNeedToShowButton: (model.prescriptionReportListINP.length > 0 || model.prescriptionReportEnhList.length > 0) ? projectViewModel.havePrivilege(13) : false, isNeedToShowButton: (model.prescriptionReportListINP.length > 0 || model.prescriptionReportEnhList.length > 0) ? projectViewModel.havePrivilege(13) : false,
buttonTitle: TranslationBase.of(context).download, buttonTitle: TranslationBase.of(context).download,

@ -22,19 +22,35 @@ class LocationUtils {
bool isHuawei; bool isHuawei;
final GeolocatorPlatform _geolocatorPlatform = GeolocatorPlatform.instance; final GeolocatorPlatform _geolocatorPlatform = GeolocatorPlatform.instance;
LocationUtils({required this.isShowConfirmDialog, required this.context, this.isHuawei = false, this.isShowLocationTimeoutDialog = true}); LocationUtils(
{required this.isShowConfirmDialog,
required this.context,
this.isHuawei = false,
this.isShowLocationTimeoutDialog = true});
void getCurrentLocation(
{bool isShowConfirmDialog = false,
bool isShowLocationTimeoutDialog = false,
Function(LatLng)? callBack}) async {
this.isShowConfirmDialog = isShowConfirmDialog;
this.isShowLocationTimeoutDialog = isShowLocationTimeoutDialog;
void getCurrentLocation({Function(LatLng)? callBack}) async {
if (Platform.isAndroid && isHuawei) { if (Platform.isAndroid && isHuawei) {
_getHMSCurrentLocation(callBack!); _getHMSCurrentLocation(callBack!);
} else { } else {
Geolocator.isLocationServiceEnabled().then((value) async { Geolocator.isLocationServiceEnabled().then((value) async {
if (value) { if (value) {
await Geolocator.checkPermission().then((permission) async { await Geolocator.checkPermission().then((permission) async {
if (permission == LocationPermission.always || permission == LocationPermission.whileInUse) { if (permission == LocationPermission.always ||
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 5)).then((value) { permission == LocationPermission.whileInUse) {
Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.medium,
timeLimit: Duration(seconds: 5))
.then((value) {
setLocation(value); setLocation(value);
if (callBack != null) callBack(LatLng(value.latitude, value.longitude)); if (callBack != null)
callBack(LatLng(value.latitude, value.longitude));
}).catchError((err) { }).catchError((err) {
print(err); print(err);
if (isShowConfirmDialog && isShowLocationTimeoutDialog) { if (isShowConfirmDialog && isShowLocationTimeoutDialog) {
@ -45,17 +61,25 @@ class LocationUtils {
}); });
} }
if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) { if (permission == LocationPermission.denied ||
permission == LocationPermission.deniedForever) {
if (Platform.isAndroid) { if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () async { Utils.showPermissionConsentDialog(context,
TranslationBase.of(context).locationPermissionDialog,
() async {
final hasPermission = await _handlePermission(); final hasPermission = await _handlePermission();
if (hasPermission) { if (hasPermission) {
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 10)).then((value) { Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.medium,
timeLimit: Duration(seconds: 10))
.then((value) {
setLocation(value); setLocation(value);
if (callBack != null) callBack(LatLng(value.latitude, value.longitude)); if (callBack != null)
callBack(LatLng(value.latitude, value.longitude));
}); });
} else { } else {
if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: () {}); if (isShowConfirmDialog)
showErrorLocationDialog(false, failureCallBack: () {});
} }
}); });
} else { } else {
@ -63,7 +87,8 @@ class LocationUtils {
getCurrentLocation(callBack: callBack); getCurrentLocation(callBack: callBack);
} else { } else {
setZeroLocation(); setZeroLocation();
if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: () {}); if (isShowConfirmDialog)
showErrorLocationDialog(false, failureCallBack: () {});
} }
} }
} }
@ -71,7 +96,8 @@ class LocationUtils {
print(err); print(err);
}); });
} else { } else {
if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: () {}); if (isShowConfirmDialog)
showErrorLocationDialog(false, failureCallBack: () {});
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -134,14 +160,20 @@ class LocationUtils {
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;
locationRequest.interval = 1000; locationRequest.interval = 1000;
List<LocationRequest> locationRequestList = <LocationRequest>[locationRequest]; List<LocationRequest> locationRequestList = <LocationRequest>[
LocationSettingsRequest locationSettingsRequest = LocationSettingsRequest(requests: locationRequestList); locationRequest
];
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, locationRequest,
LocationCallback(onLocationResult: (locationResult) { LocationCallback(onLocationResult: (locationResult) {
@ -208,7 +240,8 @@ class LocationUtils {
return dialog.showAlertDialog(context); return dialog.showAlertDialog(context);
} }
showErrorLocationDialog(bool isPermissionError, {Function()? failureCallBack}) { showErrorLocationDialog(bool isPermissionError,
{Function()? failureCallBack}) {
setLocation(null); setLocation(null);
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
@ -251,6 +284,7 @@ class LocationUtils {
var result = await [ var result = await [
Permission.location, Permission.location,
].request(); ].request();
return (result[Permission.location]!.isGranted || result[Permission.locationAlways]!.isGranted); return (result[Permission.location]!.isGranted ||
result[Permission.locationAlways]!.isGranted);
} }
} }

@ -460,16 +460,16 @@ class Utils {
), ),
)); ));
medical.add(InkWell( // medical.add(InkWell(
onTap: () { // onTap: () {
Navigator.push(context, FadePage(page: InsuranceUpdate())); // Navigator.push(context, FadePage(page: InsuranceUpdate()));
}, // },
child: MedicalProfileItem( // child: MedicalProfileItem(
title: TranslationBase.of(context).updateInsurance, // title: TranslationBase.of(context).updateInsurance,
imagePath: 'insurance_card.svg', // imagePath: 'insurance_card.svg',
subTitle: TranslationBase.of(context).updateInsuranceSubtitle, // subTitle: TranslationBase.of(context).updateInsuranceSubtitle,
), // ),
)); // ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(18) onTap: () => projectViewModel.havePrivilege(18)

Loading…
Cancel
Save