Updates & fixes

merge-update-with-lab-changes
haroon amjad 9 months ago
parent 7ed401fb1c
commit c2785c5f68

@ -70,7 +70,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
@override
void initState() {
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils = new LocationUtils(isShowConfirmDialog: true, isShowLocationTimeoutDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList());
checkPVM();
super.initState();

@ -663,7 +663,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
setState(() {
if (value != null) {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, 0, true, notificationCount);
model.setState(model.count, model.ancillaryCount, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
// FlutterAppIconBadge.updateBadge(int.parse(notificationCount));
}

@ -429,7 +429,7 @@ class ClinicListService extends BaseService {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
}, body: request, isAllowAny: true);
return Future.value(localRes);
}

@ -18,11 +18,12 @@ class LocationUtils {
AppSharedPreferences sharedPref = new AppSharedPreferences();
bool isShowConfirmDialog;
bool isShowLocationTimeoutDialog;
BuildContext context;
bool isHuawei;
final GeolocatorPlatform _geolocatorPlatform = GeolocatorPlatform.instance;
LocationUtils({required this.isShowConfirmDialog, required this.context, this.isHuawei = false});
LocationUtils({required this.isShowConfirmDialog, required this.context, this.isHuawei = false, this.isShowLocationTimeoutDialog = true});
void getCurrentLocation({Function(LatLng)? callBack}) async {
if (Platform.isAndroid && isHuawei) {
@ -32,12 +33,15 @@ class LocationUtils {
if (value) {
await Geolocator.checkPermission().then((permission) async {
if (permission == LocationPermission.always || permission == LocationPermission.whileInUse) {
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.best, timeLimit: Duration(seconds: 5)).then((value) {
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 5)).then((value) {
setLocation(value);
if (callBack != null) callBack(LatLng(value.latitude, value.longitude));
}).catchError((err) {
print(err);
if (isShowConfirmDialog) showLocationTimeOutDialog(failureCallBack: (){});
if (isShowConfirmDialog && isShowLocationTimeoutDialog)
showLocationTimeOutDialog(failureCallBack: () {
Geolocator.openAppSettings();
});
});
}
@ -51,7 +55,7 @@ class LocationUtils {
if (callBack != null) callBack(LatLng(value.latitude, value.longitude));
});
} else {
if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: (){});
if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: () {});
}
});
} else {
@ -59,7 +63,7 @@ class LocationUtils {
getCurrentLocation(callBack: callBack);
} else {
setZeroLocation();
if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: (){});
if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: () {});
}
}
}
@ -130,7 +134,9 @@ class LocationUtils {
accuracy: 1.0,
heading: 0.0,
speed: 0.0,
speedAccuracy: 1, altitudeAccuracy: 0.0, headingAccuracy: 0.0,
speedAccuracy: 1,
altitudeAccuracy: 0.0,
headingAccuracy: 0.0,
// altitudeAccuracy: 0.0,
// headingAccuracy: 0.0,
// altitudeAccuracy: 0,

@ -20,13 +20,15 @@ class BottomNavigationItem extends StatelessWidget {
final String? name;
final bool? isDisabled;
late ToDoCountProviderModel toDoProvider;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
BottomNavigationItem({this.icon, this.activeIcon, this.changeIndex, this.index, this.currentIndex, this.name, this.isDisabled = false});
@override
Widget build(BuildContext context) {
var model = Provider.of<ToDoCountProviderModel>(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
ProjectViewModel projectViewModel = Provider.of(context);
return Expanded(
child: SizedBox(
@ -72,7 +74,7 @@ class BottomNavigationItem extends StatelessWidget {
),
],
)
: (authenticatedUserObject.isLogin && model.isShowBadge)
: (authenticatedUserObject.isLogin && toDoProvider.isShowBadge)
? Stack(
alignment: AlignmentDirectional.center,
children: [
@ -120,7 +122,7 @@ class BottomNavigationItem extends StatelessWidget {
// borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),
child: Text((model.count! + model.ancillaryCount!).toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)),
child: Text((toDoProvider.count! + toDoProvider.ancillaryCount!).toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)),
),
),
),

Loading…
Cancel
Save