|
|
|
|
@ -59,7 +59,7 @@ class LandingPage extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
|
_LandingPageState createState() => state = _LandingPageState();
|
|
|
|
|
|
|
|
|
|
switchToDoFromHMGServices(){
|
|
|
|
|
switchToDoFromHMGServices() {
|
|
|
|
|
state.changeCurrentTab(4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -99,7 +99,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
|
|
|
|
|
|
changeCurrentTab(int tab) {
|
|
|
|
|
setState(() {
|
|
|
|
|
if(currentTab > 0 && tab == 2)
|
|
|
|
|
if (currentTab > 0 && tab == 2)
|
|
|
|
|
pageController.jumpToPage(0);
|
|
|
|
|
else if (tab != 0)
|
|
|
|
|
pageController.jumpToPage(tab);
|
|
|
|
|
@ -111,8 +111,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
|
|
|
|
super.didChangeAppLifecycleState(state);
|
|
|
|
|
@ -164,9 +162,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
WidgetsBinding.instance.addObserver(this);
|
|
|
|
|
//setState(() {
|
|
|
|
|
|
|
|
|
|
AppGlobal.context = context;
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
_requestIOSPermissions();
|
|
|
|
|
pageController = PageController(keepPage: true);
|
|
|
|
|
_firebaseMessaging.setAutoInitEnabled(true);
|
|
|
|
|
@ -196,6 +194,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
|
if (token != null && DEVICE_TOKEN == "") {
|
|
|
|
|
DEVICE_TOKEN = token;
|
|
|
|
|
checkUserStatus(token);
|
|
|
|
|
if (projectViewModel.isLogin)
|
|
|
|
|
this.getNotificationCount(DEVICE_TOKEN);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (results[Permission.location].isGranted) ;
|
|
|
|
|
@ -420,7 +420,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
|
authService
|
|
|
|
|
.selectDeviceImei(DEVICE_TOKEN)
|
|
|
|
|
.then((SelectDeviceIMEIRES value) {
|
|
|
|
|
this.getNotificationCount(DEVICE_TOKEN);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (value != null) {
|
|
|
|
|
setUserValues(value);
|
|
|
|
|
@ -444,23 +443,27 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
|
var data =
|
|
|
|
|
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
|
|
|
|
|
if (data != null) {
|
|
|
|
|
authService
|
|
|
|
|
.registeredAuthenticatedUser(data, token, 0, 0)
|
|
|
|
|
.then((res) => {print(res)});
|
|
|
|
|
// authService
|
|
|
|
|
// .registeredAuthenticatedUser(data, token, 0, 0)
|
|
|
|
|
// .then((res) => {print(res)});
|
|
|
|
|
authService.getDashboard().then((value) => {
|
|
|
|
|
setState(() {
|
|
|
|
|
notificationCount = value['List_PatientDashboard'][0]
|
|
|
|
|
['UnreadPatientNotificationCount'] >
|
|
|
|
|
99
|
|
|
|
|
? '99+'
|
|
|
|
|
: value['List_PatientDashboard'][0]
|
|
|
|
|
['UnreadPatientNotificationCount']
|
|
|
|
|
.toString();
|
|
|
|
|
|
|
|
|
|
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
|
|
|
|
|
})
|
|
|
|
|
if (value != null)
|
|
|
|
|
{
|
|
|
|
|
setState(() {
|
|
|
|
|
notificationCount = value['List_PatientDashboard'][0]
|
|
|
|
|
['UnreadPatientNotificationCount'] >
|
|
|
|
|
99
|
|
|
|
|
? '99+'
|
|
|
|
|
: value['List_PatientDashboard'][0]
|
|
|
|
|
['UnreadPatientNotificationCount']
|
|
|
|
|
.toString();
|
|
|
|
|
|
|
|
|
|
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
familyFileProvider.getSharedRecordByStatus();
|
|
|
|
|
|
|
|
|
|
// familyFileProvider.getSharedRecordByStatus();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -576,7 +579,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
|
changeIndex: changeCurrentTab,
|
|
|
|
|
index: currentTab,
|
|
|
|
|
),
|
|
|
|
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked ,
|
|
|
|
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
|
|
|
|
floatingActionButton:
|
|
|
|
|
(projectViewModel.havePrivilege(34) && currentTab == 0)
|
|
|
|
|
? FloatingButton(
|
|
|
|
|
|