@ -61,394 +61,416 @@ 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 ,
child: Container (
color: Theme . of ( context ) . scaffoldBackgroundColor ,
color: Colors . white ,
child: Container (
child: Drawer (
/ / color: Colors . white ,
child: Column (
child: Theme (
children: < Widget > [
data: Theme . of ( context ) . copyWith (
Expanded (
canvasColor: Theme . of ( context ) . scaffoldBackgroundColor ) ,
flex: 4 ,
child: Drawer (
child: ListView (
child: Column (
padding: EdgeInsets . zero ,
children: < Widget > [
children: < Widget > [
Expanded (
Container (
flex: 4 ,
height: SizeConfig . screenHeight * . 30 ,
child: ListView (
child: InkWell (
padding: EdgeInsets . zero ,
child: DrawerHeader (
children: < Widget > [
child: Column (
Container (
children: < Widget > [
height: SizeConfig . screenHeight * . 30 ,
Container (
child: InkWell (
child:
child: DrawerHeader (
Image . asset ( ' assets/images/logo_HMG.png ' ) ,
child: Column (
margin: EdgeInsets . all (
children: < Widget > [
SizeConfig . imageSizeMultiplier * 4 ) ,
Container (
) ,
child: Image . asset (
( user ! = null & & projectProvider . isLogin )
' assets/images/logo_HMG.png ' ) ,
? Padding (
margin: EdgeInsets . all (
padding: EdgeInsets . all ( 15 ) ,
SizeConfig . imageSizeMultiplier * 4 ) ,
child: Column (
) ,
mainAxisAlignment:
( user ! = null & & projectProvider . isLogin )
MainAxisAlignment . start ,
? Padding (
children: < Widget > [
padding: EdgeInsets . all ( 15 ) ,
Row (
child: Column (
mainAxisAlignment:
MainAxisAlignment . start ,
children: < Widget > [
children: < Widget > [
Padding (
Row (
padding: EdgeInsets . only (
children: < Widget > [
right: 5 ) ,
Padding (
child: Icon (
padding:
Icons . account_circle ,
EdgeInsets . only (
right: 5 ) ,
child: Icon (
Icons . account_circle ,
color:
Color ( 0xFF40ACC9 ) ,
) ) ,
AppText (
user . firstName +
' ' +
user . lastName ,
color: Color ( 0xFF40ACC9 ) ,
color: Color ( 0xFF40ACC9 ) ,
)
] ,
) ,
Row ( children: < Widget > [
Padding (
padding: EdgeInsets . only (
left: 30 , top: 5 ) ,
child: Column (
children: < Widget > [
AppText (
TranslationBase . of (
context )
. fileno +
" : " +
user . patientID
. toString ( ) ,
color: Color (
0xFF40ACC9 ) ,
fontSize: SizeConfig
. textMultiplier *
1.5 ,
) ,
AppText (
user . bloodGroup ! =
null
? ' Blood Group: ' +
user . bloodGroup
: ' ' ,
fontSize: SizeConfig
. textMultiplier *
1.5 ,
) ,
] ,
) )
] )
] ) )
: SizedBox ( ) ,
] ,
) ,
) ,
) ,
) ,
Container (
child: Column (
mainAxisAlignment: MainAxisAlignment . start ,
children: < Widget > [
InkWell (
child: DrawerItem (
TranslationBase . of ( context ) . arabicChange ,
Icons . translate ) ,
onTap: ( ) {
sharedPref . setBool ( IS_ROBOT_INIT , null ) ;
if ( projectProvider . isArabic ) {
projectProvider . changeLanguage ( ' en ' ) ;
} else {
projectProvider . changeLanguage ( ' ar ' ) ;
}
} ,
) ,
( user ! = null & & projectProvider . isLogin )
? Column (
mainAxisAlignment: MainAxisAlignment . start ,
children: < Widget > [
( user . isFamily = = null | |
user . isFamily = = false ) & &
projectProvider . havePrivilege ( 2 )
? InkWell (
child: DrawerItem (
TranslationBase . of ( context )
. family ,
Icons . group ,
textColor: Theme . of ( context )
. textTheme
. bodyText1
. color ,
iconColor: Theme . of ( context )
. textTheme
. bodyText1
. color ,
bottomLine: false ,
sideArrow: true ,
) ,
onTap: ( ) {
Navigator . of ( context ) . pushNamed (
MY_FAMILIY ,
) ;
} ,
)
: SizedBox ( ) ,
FutureBuilder (
future: getFamilyFiles ( ) , / / async work
builder: ( BuildContext context ,
AsyncSnapshot <
GetAllSharedRecordsByStatusResponse >
snapshot ) {
switch ( snapshot . connectionState ) {
case ConnectionState . waiting:
return Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Text ( ' ' ) ) ;
default :
if ( snapshot . hasError )
return Padding (
padding: EdgeInsets . all ( 10 ) ,
child:
Text ( snapshot . error ) ) ;
else
return Container (
decoration: BoxDecoration (
border: Border (
bottom: BorderSide (
/ / < - - - left side
color: Colors . grey [ 200 ] ,
width: 1.0 ,
) ,
) ) ,
) ) ,
AppText (
child: Column (
user . firstName +
children: [
' ' +
user . isFamily = = true
user . lastName ,
? Container (
color: Color ( 0xFF40ACC9 ) ,
padding: EdgeInsets
)
. only (
] ,
bottom:
) ,
5 ) ,
Row ( children: < Widget > [
child: InkWell (
Padding (
onTap: ( ) {
padding: EdgeInsets . only (
switchUser (
left: 30 , top: 5 ) ,
mainUser ,
child: Column (
context ) ;
children: < Widget > [
} ,
AppText (
child: Row (
TranslationBase . of (
crossAxisAlignment:
context )
CrossAxisAlignment
. fileno +
. start ,
" : " +
children: <
user . patientID
Widget > [
. toString ( ) ,
Expanded (
color:
child:
Color ( 0xFF40ACC9 ) ,
Icon ( Icons . person ) ,
fontSize: SizeConfig
) ,
. textMultiplier *
Expanded (
1.5 ,
flex:
7 ,
child:
Column ( crossAxisAlignment: CrossAxisAlignment . start , children: < Widget > [
AppText ( mainUser . firstName + ' ' + mainUser . lastName , color: Theme . of ( context ) . textTheme . bodyText1 . color ) ,
AppText (
TranslationBase . of ( context ) . fileno + " : " + mainUser . patientID . toString ( ) ,
color: Theme . of ( context ) . textTheme . bodyText1 . color ,
) ,
] ) ) ,
] ,
) ) )
: SizedBox ( ) ,
Column (
mainAxisAlignment:
MainAxisAlignment
. start ,
mainAxisSize:
MainAxisSize
. min ,
children: snapshot
. data
. getAllSharedRecordsByStatusList
. map < Widget > (
( result ) {
return result
. status = =
3
? Container (
padding: EdgeInsets . only (
bottom:
5 ) ,
child: InkWell (
onTap: ( ) {
switchUser ( result ,
context ) ;
} ,
child: Row (
crossAxisAlignment:
CrossAxisAlignment . start ,
children: < Widget > [
Expanded (
child: Icon ( Icons . person , color: result . responseID = = user . patientID ? Color ( 0xFF40ACC9 ) : Colors . black ) ,
) ,
Expanded (
flex: 7 ,
child: Padding (
padding: EdgeInsets . only ( left: 5 , right: 5 ) ,
child: Column ( crossAxisAlignment: CrossAxisAlignment . start , children: < Widget > [
AppText ( result . patientName , color: result . responseID = = user . patientID ? Color ( 0xFF40ACC9 ) : Colors . black ) ,
AppText ( TranslationBase . of ( context ) . fileno + " : " + result . iD . toString ( ) , color: result . responseID = = user . patientID ? Color ( 0xFF40ACC9 ) : Colors . black ) ,
] ) ) ) ,
] ,
) ) )
: SizedBox ( ) ;
} ) . toList ( ) )
] ,
) ) ;
}
} ,
) ,
InkWell (
child: Stack (
children: [
DrawerItem (
TranslationBase . of ( context )
. notification ,
Icons . notifications ,
count: notificationCount ! = null
? new Container (
padding:
EdgeInsets . all ( 4 ) ,
margin: EdgeInsets . all ( 2 ) ,
decoration:
new BoxDecoration (
color: Colors . red ,
borderRadius:
BorderRadius
. circular ( 20 ) ,
) ,
) ,
AppText (
constraints:
user . bloodGroup ! = null
BoxConstraints (
? ' Blood Group: ' +
minWidth: 20 ,
user . bloodGroup
minHeight: 20 ,
: ' ' ,
fontSize: SizeConfig
. textMultiplier *
1.5 ,
) ,
) ,
] ,
child: new Text (
) )
notificationCount ,
] )
style: new TextStyle (
] ) )
color: Colors . white ,
: SizedBox ( ) ,
fontSize:
] ,
projectProvider
) ,
. isArabic
) ,
? 8
) ,
: 9 ,
) ,
) ,
Column (
textAlign:
mainAxisAlignment: MainAxisAlignment . start ,
TextAlign . center ,
children: < Widget > [
) ,
InkWell (
/ / ) ,
child: DrawerItem (
)
TranslationBase . of ( context ) . arabicChange ,
: SizedBox ( ) ,
Icons . translate ) ,
) ,
onTap: ( ) {
] ,
sharedPref . setBool ( IS_ROBOT_INIT , null ) ;
) ,
if ( projectProvider . isArabic ) {
onTap: ( ) {
projectProvider . changeLanguage ( ' en ' ) ;
/ / NotificationsPage
} else {
Navigator . of ( context ) . pop ( ) ;
projectProvider . changeLanguage ( ' ar ' ) ;
Navigator . push (
}
context ,
} ,
FadePage (
) ,
page: NotificationsPage ( ) ) ) ;
( user ! = null & & projectProvider . isLogin )
} ,
? Column (
) ,
mainAxisAlignment: MainAxisAlignment . start ,
if ( projectProvider . havePrivilege ( 3 ) )
children: < Widget > [
InkWell (
( user . isFamily = = null | |
user . isFamily = = false ) & &
projectProvider . havePrivilege ( 2 )
? InkWell (
child: DrawerItem (
child: DrawerItem (
TranslationBase . of ( context ) . family ,
TranslationBase . of ( context )
Icons . group ,
. appsetting ,
textColor: Theme . of ( context )
Icons . settings_input_composite ) ,
. textTheme
. bodyText1
. color ,
iconColor: Theme . of ( context )
. textTheme
. bodyText1
. color ,
bottomLine: false ,
sideArrow: true ,
) ,
onTap: ( ) {
onTap: ( ) {
Navigator . of ( context ) . pushNamed (
Navigator . of ( context ) . pushNamed (
MY_FAMILIY ,
SETTINGS ,
) ;
) ;
} ,
} ,
)
: SizedBox ( ) ,
FutureBuilder (
future: getFamilyFiles ( ) , / / async work
builder: ( BuildContext context ,
AsyncSnapshot <
GetAllSharedRecordsByStatusResponse >
snapshot ) {
switch ( snapshot . connectionState ) {
case ConnectionState . waiting:
return Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Text ( ' ' ) ) ;
default :
if ( snapshot . hasError )
return Padding (
padding: EdgeInsets . all ( 10 ) ,
child: Text ( snapshot . error ) ) ;
else
return Container (
decoration: BoxDecoration (
border: Border (
bottom: BorderSide (
/ / < - - - left side
color: Colors . grey [ 200 ] ,
width: 1.0 ,
) ,
) ) ,
child: Column (
children: [
user . isFamily = = true
? Container (
padding:
EdgeInsets . only (
bottom: 5 ) ,
child: InkWell (
onTap: ( ) {
switchUser (
mainUser ,
context ) ;
} ,
child: Row (
crossAxisAlignment:
CrossAxisAlignment
. start ,
children: <
Widget > [
Expanded (
child: Icon (
Icons
. person ) ,
) ,
Expanded (
flex: 7 ,
child: Column (
crossAxisAlignment:
CrossAxisAlignment . start ,
children: < Widget > [
AppText ( mainUser . firstName + ' ' + mainUser . lastName ) ,
AppText ( TranslationBase . of ( context ) . fileno + " : " + mainUser . patientID . toString ( ) ) ,
] ) ) ,
] ,
) ) )
: SizedBox ( ) ,
Column (
mainAxisAlignment:
MainAxisAlignment
. start ,
mainAxisSize:
MainAxisSize . min ,
children: snapshot . data
. getAllSharedRecordsByStatusList
. map < Widget > (
( result ) {
return result
. status = =
3
? Container (
padding: EdgeInsets
. only (
bottom:
5 ) ,
child: InkWell (
onTap: ( ) {
switchUser (
result ,
context ) ;
} ,
child: Row (
crossAxisAlignment:
CrossAxisAlignment . start ,
children: <
Widget > [
Expanded (
child:
Icon ( Icons . person , color: result . responseID = = user . patientID ? Color ( 0xFF40ACC9 ) : Colors . black ) ,
) ,
Expanded (
flex: 7 ,
child: Padding (
padding: EdgeInsets . only ( left: 5 , right: 5 ) ,
child: Column ( crossAxisAlignment: CrossAxisAlignment . start , children: < Widget > [
AppText ( result . patientName , color: result . responseID = = user . patientID ? Color ( 0xFF40ACC9 ) : Colors . black ) ,
AppText ( TranslationBase . of ( context ) . fileno + " : " + result . iD . toString ( ) , color: result . responseID = = user . patientID ? Color ( 0xFF40ACC9 ) : Colors . black ) ,
] ) ) ) ,
] ,
) ) )
: SizedBox ( ) ;
} ) . toList ( ) )
] ,
) ) ;
}
} ,
) ,
InkWell (
child: Stack (
children: [
DrawerItem (
TranslationBase . of ( context )
. notification ,
Icons . notifications ,
count: notificationCount ! = null
? new Container (
padding: EdgeInsets . all ( 4 ) ,
margin: EdgeInsets . all ( 2 ) ,
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: projectProvider
. isArabic
? 8
: 9 ,
) ,
textAlign: TextAlign . center ,
) ,
/ / ) ,
)
: SizedBox ( ) ,
) ,
) ,
] ,
InkWell (
) ,
child: DrawerItem (
onTap: ( ) {
TranslationBase . of ( context ) . rateApp ,
/ / NotificationsPage
Icons . star ) ,
Navigator . of ( context ) . pop ( ) ;
onTap: ( ) {
Navigator . push ( context ,
if ( Platform . isIOS ) {
FadePage ( page: NotificationsPage ( ) ) ) ;
launch (
} ,
" https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978 " ) ;
) ,
} else {
if ( projectProvider . havePrivilege ( 3 ) )
launch (
InkWell (
" https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en " ) ;
child: DrawerItem (
}
TranslationBase . of ( context )
} ,
. appsetting ,
) ,
Icons . settings_input_composite ) ,
InkWell (
onTap: ( ) {
child: DrawerItem (
Navigator . of ( context ) . pushNamed (
TranslationBase . of ( context ) . logout ,
SETTINGS ,
Icons . lock_open ) ,
) ;
onTap: ( ) {
} ,
logout ( ) ;
) ,
} ,
InkWell (
)
child: DrawerItem (
] ,
TranslationBase . of ( context ) . rateApp ,
)
Icons . star ) ,
: InkWell (
onTap: ( ) {
if ( Platform . isIOS ) {
launch (
" https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978 " ) ;
} else {
launch (
" https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en " ) ;
}
} ,
) ,
InkWell (
child: DrawerItem (
child: DrawerItem (
TranslationBase . of ( context ) . logout ,
TranslationBase . of ( context )
. loginregister ,
Icons . lock_open ) ,
Icons . lock_open ) ,
onTap: ( ) {
onTap: ( ) {
log out ( ) ;
login ( ) ;
} ,
} ,
)
) ,
] ,
/ / InkWell (
)
/ / child: DrawerItem (
: InkWell (
/ / TranslationBase . of ( context ) . appsetting ,
child: DrawerItem (
/ / Icons . settings_input_composite ) ,
TranslationBase . of ( context ) . loginregister ,
/ / onTap: ( ) {
Icons . lock_open ) ,
/ / Navigator . of ( context ) . pushNamed (
onTap: ( ) {
/ / SETTINGS ,
login ( ) ;
/ / ) ;
} ,
/ / } ,
) ,
/ / )
/ / InkWell (
] ,
/ / child: DrawerItem (
) )
/ / TranslationBase . of ( context ) . appsetting ,
/ / Icons . settings_input_composite ) ,
/ / onTap: ( ) {
/ / Navigator . of ( context ) . pushNamed (
/ / SETTINGS ,
/ / ) ;
/ / } ,
/ / )
] ,
] ,
)
) ,
] ,
) ,
) ,
Expanded (
) ,
flex: 1 ,
Expanded (
child: Column (
flex: 1 ,
children: < Widget > [
child: Column (
Container (
children: < Widget > [
child: Align (
Container (
alignment: FractionalOffset . bottomCenter ,
child: Align (
child: Container (
alignment: FractionalOffset . bottomCenter ,
child: Row (
child: Container (
mainAxisAlignment:
child: Row (
MainAxisAlignment . spaceEvenly ,
mainAxisAlignment: MainAxisAlignment . spaceEvenly ,
children: [
children: [
Column (
Column (
children: < Widget > [
children: < Widget > [
Text ( TranslationBase . of ( context )
Text ( TranslationBase . of ( context ) . poweredBy ) ,
. 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 ,
] ,
)
) ,
] ,
Column (
) ,
children: < Widget > [
Column (
Image . asset (
children: < Widget > [
' assets/images/new-design/vidamobile.png ' ,
Image . asset (
width: SizeConfig . imageSizeMultiplier * 25 ,
' assets/images/new-design/vidamobile.png ' ,
)
width:
SizeConfig . imageSizeMultiplier * 25 ,
)
] ,
) ,
] ,
] ,
) ,
) ,
] ,
) ,
) ,
) ,
) ,
)
) ,
] ,
)
) ,
],
)
) ,
] ,
)
) ,
] ,
) ,
) ,
) ,
) ,
) ) ;
) ,
) ;
}
}
drawerNavigator ( context , routeName ) {
drawerNavigator ( context , routeName ) {