|
|
|
@ -61,10 +61,14 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
projectProvider = Provider.of(context);
|
|
|
|
projectProvider = Provider.of(context);
|
|
|
|
return SizedBox(
|
|
|
|
return Container(
|
|
|
|
width: MediaQuery.of(context).size.width * 0.75,
|
|
|
|
width: MediaQuery.of(context).size.width * 0.75,
|
|
|
|
|
|
|
|
color: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
color: Colors.white,
|
|
|
|
// color: Colors.white,
|
|
|
|
|
|
|
|
child: Theme(
|
|
|
|
|
|
|
|
data: Theme.of(context).copyWith(
|
|
|
|
|
|
|
|
canvasColor: Theme.of(context).scaffoldBackgroundColor),
|
|
|
|
child: Drawer(
|
|
|
|
child: Drawer(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
@ -80,8 +84,8 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child:
|
|
|
|
child: Image.asset(
|
|
|
|
Image.asset('assets/images/logo_HMG.png'),
|
|
|
|
'assets/images/logo_HMG.png'),
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
SizeConfig.imageSizeMultiplier * 4),
|
|
|
|
SizeConfig.imageSizeMultiplier * 4),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -95,11 +99,13 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.only(
|
|
|
|
right: 5),
|
|
|
|
right: 5),
|
|
|
|
child: Icon(
|
|
|
|
child: Icon(
|
|
|
|
Icons.account_circle,
|
|
|
|
Icons.account_circle,
|
|
|
|
color: Color(0xFF40ACC9),
|
|
|
|
color:
|
|
|
|
|
|
|
|
Color(0xFF40ACC9),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
user.firstName +
|
|
|
|
user.firstName +
|
|
|
|
@ -122,14 +128,15 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
": " +
|
|
|
|
": " +
|
|
|
|
user.patientID
|
|
|
|
user.patientID
|
|
|
|
.toString(),
|
|
|
|
.toString(),
|
|
|
|
color:
|
|
|
|
color: Color(
|
|
|
|
Color(0xFF40ACC9),
|
|
|
|
0xFF40ACC9),
|
|
|
|
fontSize: SizeConfig
|
|
|
|
fontSize: SizeConfig
|
|
|
|
.textMultiplier *
|
|
|
|
.textMultiplier *
|
|
|
|
1.5,
|
|
|
|
1.5,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
user.bloodGroup != null
|
|
|
|
user.bloodGroup !=
|
|
|
|
|
|
|
|
null
|
|
|
|
? 'Blood Group: ' +
|
|
|
|
? 'Blood Group: ' +
|
|
|
|
user.bloodGroup
|
|
|
|
user.bloodGroup
|
|
|
|
: '',
|
|
|
|
: '',
|
|
|
|
@ -147,7 +154,8 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Column(
|
|
|
|
Container(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
@ -172,7 +180,8 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
projectProvider.havePrivilege(2)
|
|
|
|
projectProvider.havePrivilege(2)
|
|
|
|
? InkWell(
|
|
|
|
? InkWell(
|
|
|
|
child: DrawerItem(
|
|
|
|
child: DrawerItem(
|
|
|
|
TranslationBase.of(context).family,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.family,
|
|
|
|
Icons.group,
|
|
|
|
Icons.group,
|
|
|
|
textColor: Theme.of(context)
|
|
|
|
textColor: Theme.of(context)
|
|
|
|
.textTheme
|
|
|
|
.textTheme
|
|
|
|
@ -207,7 +216,8 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
if (snapshot.hasError)
|
|
|
|
if (snapshot.hasError)
|
|
|
|
return Padding(
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
child: Text(snapshot.error));
|
|
|
|
child:
|
|
|
|
|
|
|
|
Text(snapshot.error));
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
@ -222,9 +232,10 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
user.isFamily == true
|
|
|
|
user.isFamily == true
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets
|
|
|
|
EdgeInsets.only(
|
|
|
|
.only(
|
|
|
|
bottom: 5),
|
|
|
|
bottom:
|
|
|
|
|
|
|
|
5),
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
switchUser(
|
|
|
|
switchUser(
|
|
|
|
@ -238,18 +249,19 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
children: <
|
|
|
|
children: <
|
|
|
|
Widget>[
|
|
|
|
Widget>[
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Icon(
|
|
|
|
child:
|
|
|
|
Icons
|
|
|
|
Icon(Icons.person),
|
|
|
|
.person),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 7,
|
|
|
|
flex:
|
|
|
|
child: Column(
|
|
|
|
7,
|
|
|
|
crossAxisAlignment:
|
|
|
|
child:
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
AppText(mainUser.firstName + ' ' + mainUser.lastName, color: Theme.of(context).textTheme.bodyText1.color),
|
|
|
|
AppText(mainUser.firstName + ' ' + mainUser.lastName),
|
|
|
|
AppText(
|
|
|
|
AppText(TranslationBase.of(context).fileno + ": " + mainUser.patientID.toString()),
|
|
|
|
TranslationBase.of(context).fileno + ": " + mainUser.patientID.toString(),
|
|
|
|
|
|
|
|
color: Theme.of(context).textTheme.bodyText1.color,
|
|
|
|
|
|
|
|
),
|
|
|
|
])),
|
|
|
|
])),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)))
|
|
|
|
)))
|
|
|
|
@ -259,8 +271,10 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
MainAxisAlignment
|
|
|
|
MainAxisAlignment
|
|
|
|
.start,
|
|
|
|
.start,
|
|
|
|
mainAxisSize:
|
|
|
|
mainAxisSize:
|
|
|
|
MainAxisSize.min,
|
|
|
|
MainAxisSize
|
|
|
|
children: snapshot.data
|
|
|
|
.min,
|
|
|
|
|
|
|
|
children: snapshot
|
|
|
|
|
|
|
|
.data
|
|
|
|
.getAllSharedRecordsByStatusList
|
|
|
|
.getAllSharedRecordsByStatusList
|
|
|
|
.map<Widget>(
|
|
|
|
.map<Widget>(
|
|
|
|
(result) {
|
|
|
|
(result) {
|
|
|
|
@ -268,24 +282,20 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
.status ==
|
|
|
|
.status ==
|
|
|
|
3
|
|
|
|
3
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
padding: EdgeInsets
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
.only(
|
|
|
|
|
|
|
|
bottom:
|
|
|
|
bottom:
|
|
|
|
5),
|
|
|
|
5),
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
switchUser(
|
|
|
|
switchUser(result,
|
|
|
|
result,
|
|
|
|
|
|
|
|
context);
|
|
|
|
context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: <
|
|
|
|
children: <Widget>[
|
|
|
|
Widget>[
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child:
|
|
|
|
child: Icon(Icons.person, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
|
|
|
|
Icon(Icons.person, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 7,
|
|
|
|
flex: 7,
|
|
|
|
@ -313,15 +323,18 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
Icons.notifications,
|
|
|
|
Icons.notifications,
|
|
|
|
count: notificationCount != null
|
|
|
|
count: notificationCount != null
|
|
|
|
? new Container(
|
|
|
|
? new Container(
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.all(4),
|
|
|
|
margin: EdgeInsets.all(2),
|
|
|
|
margin: EdgeInsets.all(2),
|
|
|
|
decoration: new BoxDecoration(
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
new BoxDecoration(
|
|
|
|
color: Colors.red,
|
|
|
|
color: Colors.red,
|
|
|
|
borderRadius:
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(
|
|
|
|
BorderRadius
|
|
|
|
20),
|
|
|
|
.circular(20),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
constraints:
|
|
|
|
|
|
|
|
BoxConstraints(
|
|
|
|
minWidth: 20,
|
|
|
|
minWidth: 20,
|
|
|
|
minHeight: 20,
|
|
|
|
minHeight: 20,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -329,12 +342,14 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
notificationCount,
|
|
|
|
notificationCount,
|
|
|
|
style: new TextStyle(
|
|
|
|
style: new TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: projectProvider
|
|
|
|
fontSize:
|
|
|
|
|
|
|
|
projectProvider
|
|
|
|
.isArabic
|
|
|
|
.isArabic
|
|
|
|
? 8
|
|
|
|
? 8
|
|
|
|
: 9,
|
|
|
|
: 9,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
textAlign:
|
|
|
|
|
|
|
|
TextAlign.center,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -345,8 +360,10 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
//NotificationsPage
|
|
|
|
//NotificationsPage
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Navigator.push(context,
|
|
|
|
Navigator.push(
|
|
|
|
FadePage(page: NotificationsPage()));
|
|
|
|
context,
|
|
|
|
|
|
|
|
FadePage(
|
|
|
|
|
|
|
|
page: NotificationsPage()));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (projectProvider.havePrivilege(3))
|
|
|
|
if (projectProvider.havePrivilege(3))
|
|
|
|
@ -387,7 +404,8 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: InkWell(
|
|
|
|
: InkWell(
|
|
|
|
child: DrawerItem(
|
|
|
|
child: DrawerItem(
|
|
|
|
TranslationBase.of(context).loginregister,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.loginregister,
|
|
|
|
Icons.lock_open),
|
|
|
|
Icons.lock_open),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
login();
|
|
|
|
login();
|
|
|
|
@ -404,7 +422,7 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// )
|
|
|
|
// )
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
))
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -417,14 +435,17 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
alignment: FractionalOffset.bottomCenter,
|
|
|
|
alignment: FractionalOffset.bottomCenter,
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.spaceEvenly,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Text(TranslationBase.of(context).poweredBy),
|
|
|
|
Text(TranslationBase.of(context)
|
|
|
|
|
|
|
|
.poweredBy),
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
|
'assets/images/cs_logo_container.png',
|
|
|
|
'assets/images/cs_logo_container.png',
|
|
|
|
width: SizeConfig.imageSizeMultiplier * 30,
|
|
|
|
width:
|
|
|
|
|
|
|
|
SizeConfig.imageSizeMultiplier * 30,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -432,7 +453,8 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
|
'assets/images/new-design/vidamobile.png',
|
|
|
|
'assets/images/new-design/vidamobile.png',
|
|
|
|
width: SizeConfig.imageSizeMultiplier * 25,
|
|
|
|
width:
|
|
|
|
|
|
|
|
SizeConfig.imageSizeMultiplier * 25,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -448,7 +470,7 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
drawerNavigator(context, routeName) {
|
|
|
|
drawerNavigator(context, routeName) {
|
|
|
|
|