|
|
|
@ -47,6 +47,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
int currentTab = 0;
|
|
|
|
int currentTab = 0;
|
|
|
|
PageController pageController;
|
|
|
|
PageController pageController;
|
|
|
|
ProjectViewModel projectProvider;
|
|
|
|
ProjectViewModel projectProvider;
|
|
|
|
|
|
|
|
var notificationCount = '';
|
|
|
|
|
|
|
|
|
|
|
|
///inject the user data
|
|
|
|
///inject the user data
|
|
|
|
AuthenticatedUserObject authenticatedUserObject =
|
|
|
|
AuthenticatedUserObject authenticatedUserObject =
|
|
|
|
@ -344,23 +345,58 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
title: Text(
|
|
|
|
title: Text(
|
|
|
|
getText(currentTab).toUpperCase(),
|
|
|
|
getText(currentTab).toUpperCase(),
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold,color: Colors.white,fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
|
|
|
|
// bold: true,
|
|
|
|
// bold: true,
|
|
|
|
// color: Colors.white,
|
|
|
|
// color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
leading: Builder(
|
|
|
|
leading: Builder(
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return IconButton(
|
|
|
|
return new Stack(
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
|
|
IconButton(
|
|
|
|
icon: Icon(Icons.menu),
|
|
|
|
icon: Icon(Icons.menu),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
|
|
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
notificationCount != ''
|
|
|
|
|
|
|
|
? new Positioned(
|
|
|
|
|
|
|
|
right: 0,
|
|
|
|
|
|
|
|
top: 10,
|
|
|
|
|
|
|
|
child: new Container(
|
|
|
|
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
|
|
|
|
decoration: new BoxDecoration(
|
|
|
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
|
|
|
|
minWidth: 20,
|
|
|
|
|
|
|
|
minHeight: 20,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: new Text(
|
|
|
|
|
|
|
|
notificationCount,
|
|
|
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontSize: 9,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: SizedBox()
|
|
|
|
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
actions: [
|
|
|
|
actions: [
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
//iconSize: 70,
|
|
|
|
//iconSize: 70,
|
|
|
|
icon: Icon(projectViewModel.isLogin?Icons.settings : Icons.login,color: Colors.white,),
|
|
|
|
icon: Icon(
|
|
|
|
|
|
|
|
projectViewModel.isLogin ? Icons.settings : Icons.login,
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
if (projectViewModel.isLogin)
|
|
|
|
if (projectViewModel.isLogin)
|
|
|
|
Navigator.of(context).pushNamed(
|
|
|
|
Navigator.of(context).pushNamed(
|
|
|
|
@ -432,11 +468,17 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
|
|
|
|
if (await sharedPref.getObject(USER_PROFILE) != null) {
|
|
|
|
if (await sharedPref.getObject(USER_PROFILE) != null) {
|
|
|
|
var data =
|
|
|
|
var data =
|
|
|
|
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
|
|
|
|
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
|
|
|
|
if (data != null)
|
|
|
|
if (data != null) {
|
|
|
|
authService
|
|
|
|
authService
|
|
|
|
.registeredAuthenticatedUser(data, token, 0, 0)
|
|
|
|
.registeredAuthenticatedUser(data, token, 0, 0)
|
|
|
|
.then((res) => {print(res)});
|
|
|
|
.then((res) => {print(res)});
|
|
|
|
|
|
|
|
authService.getDashboard().then((value) => {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
notificationCount = value['List_PatientDashboard']
|
|
|
|
|
|
|
|
[0]['UnreadPatientNotificationCount'].toString();
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|