|
|
|
@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
|
|
|
|
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
|
|
|
@ -40,7 +41,8 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
var familyFileProvider = FamilyFilesProvider();
|
|
|
|
var familyFileProvider = FamilyFilesProvider();
|
|
|
|
AuthenticatedUser user;
|
|
|
|
AuthenticatedUser user;
|
|
|
|
AuthenticatedUser mainUser;
|
|
|
|
AuthenticatedUser mainUser;
|
|
|
|
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
|
|
|
|
AuthenticatedUserObject authenticatedUserObject = locator<
|
|
|
|
|
|
|
|
AuthenticatedUserObject>();
|
|
|
|
VitalSignService _vitalSignService = locator<VitalSignService>();
|
|
|
|
VitalSignService _vitalSignService = locator<VitalSignService>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -48,7 +50,10 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
projectProvider = Provider.of(context);
|
|
|
|
projectProvider = Provider.of(context);
|
|
|
|
return SizedBox(
|
|
|
|
return SizedBox(
|
|
|
|
width: MediaQuery.of(context).size.width * 0.75,
|
|
|
|
width: MediaQuery
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width * 0.75,
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Drawer(
|
|
|
|
child: Drawer(
|
|
|
|
@ -102,7 +107,8 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
TranslationBase.of(
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(
|
|
|
|
context)
|
|
|
|
context)
|
|
|
|
.fileno +
|
|
|
|
.fileno +
|
|
|
|
": " +
|
|
|
|
": " +
|
|
|
|
@ -138,7 +144,9 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
child: DrawerItem(
|
|
|
|
child: DrawerItem(
|
|
|
|
TranslationBase.of(context).arabicChange,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.arabicChange,
|
|
|
|
Icons.translate),
|
|
|
|
Icons.translate),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
// Navigator.of(context).pushNamed(
|
|
|
|
// Navigator.of(context).pushNamed(
|
|
|
|
@ -155,9 +163,12 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
? Column(
|
|
|
|
? Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
user.isFamily ==null || user.isFamily ==false ? InkWell(
|
|
|
|
user.isFamily == null || user.isFamily == false
|
|
|
|
|
|
|
|
? InkWell(
|
|
|
|
child: DrawerItem(
|
|
|
|
child: DrawerItem(
|
|
|
|
TranslationBase.of(context).family,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.family,
|
|
|
|
Icons.group,
|
|
|
|
Icons.group,
|
|
|
|
textColor: Color(0xFF40ACC9),
|
|
|
|
textColor: Color(0xFF40ACC9),
|
|
|
|
iconColor: Color(0xFF40ACC9),
|
|
|
|
iconColor: Color(0xFF40ACC9),
|
|
|
|
@ -169,7 +180,8 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
MY_FAMILIY,
|
|
|
|
MY_FAMILIY,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
) : SizedBox(),
|
|
|
|
)
|
|
|
|
|
|
|
|
: SizedBox(),
|
|
|
|
FutureBuilder(
|
|
|
|
FutureBuilder(
|
|
|
|
future: getFamilyFiles(), // async work
|
|
|
|
future: getFamilyFiles(), // async work
|
|
|
|
builder: (BuildContext context,
|
|
|
|
builder: (BuildContext context,
|
|
|
|
@ -224,10 +236,25 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
flex: 7,
|
|
|
|
flex: 7,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
CrossAxisAlignment
|
|
|
|
children: <Widget>[
|
|
|
|
.start,
|
|
|
|
AppText(mainUser.firstName + ' ' + mainUser.lastName),
|
|
|
|
children: <
|
|
|
|
AppText(TranslationBase.of(context).fileno + ": " + mainUser.patientID.toString()),
|
|
|
|
Widget>[
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
mainUser
|
|
|
|
|
|
|
|
.firstName +
|
|
|
|
|
|
|
|
' ' +
|
|
|
|
|
|
|
|
mainUser
|
|
|
|
|
|
|
|
.lastName),
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.fileno +
|
|
|
|
|
|
|
|
": " +
|
|
|
|
|
|
|
|
mainUser
|
|
|
|
|
|
|
|
.patientID
|
|
|
|
|
|
|
|
.toString()),
|
|
|
|
])),
|
|
|
|
])),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)))
|
|
|
|
)))
|
|
|
|
@ -258,20 +285,63 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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,
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding:EdgeInsets.only(left:5, right:5),
|
|
|
|
padding: EdgeInsets
|
|
|
|
child:Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
|
|
|
|
.only(
|
|
|
|
AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
|
|
|
|
left: 5,
|
|
|
|
AppText(TranslationBase.of(context).fileno + ": " + result.iD.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
|
|
|
|
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),
|
|
|
|
]))),
|
|
|
|
]))),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)))
|
|
|
|
)))
|
|
|
|
@ -284,7 +354,8 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
child: DrawerItem(
|
|
|
|
child: DrawerItem(
|
|
|
|
TranslationBase.of(context)
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
.notification,
|
|
|
|
.notification,
|
|
|
|
Icons.notifications),
|
|
|
|
Icons.notifications),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
@ -299,7 +370,9 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
child: DrawerItem(
|
|
|
|
child: DrawerItem(
|
|
|
|
TranslationBase.of(context).appsetting,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.appsetting,
|
|
|
|
Icons.settings_input_composite),
|
|
|
|
Icons.settings_input_composite),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pushNamed(
|
|
|
|
Navigator.of(context).pushNamed(
|
|
|
|
@ -309,7 +382,9 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
child: DrawerItem(
|
|
|
|
child: DrawerItem(
|
|
|
|
TranslationBase.of(context).rateApp,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.rateApp,
|
|
|
|
Icons.star),
|
|
|
|
Icons.star),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
@ -323,7 +398,9 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
child: DrawerItem(
|
|
|
|
child: DrawerItem(
|
|
|
|
TranslationBase.of(context).logout,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.logout,
|
|
|
|
Icons.lock_open),
|
|
|
|
Icons.lock_open),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
logout();
|
|
|
|
logout();
|
|
|
|
@ -333,7 +410,9 @@ 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();
|
|
|
|
@ -357,7 +436,9 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
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,
|
|
|
|
@ -410,8 +491,8 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
authenticatedUserObject.logout();
|
|
|
|
authenticatedUserObject.logout();
|
|
|
|
projectProvider.isLogin = false;
|
|
|
|
projectProvider.isLogin = false;
|
|
|
|
await authenticatedUserObject.getUser();
|
|
|
|
await authenticatedUserObject.getUser();
|
|
|
|
_vitalSignService.heightCm ="";
|
|
|
|
_vitalSignService.heightCm = "";
|
|
|
|
_vitalSignService.weightKg ="";
|
|
|
|
_vitalSignService.weightKg = "";
|
|
|
|
await sharedPref.clear();
|
|
|
|
await sharedPref.clear();
|
|
|
|
this.user = null;
|
|
|
|
this.user = null;
|
|
|
|
Navigator.of(context).pushNamed(HOME);
|
|
|
|
Navigator.of(context).pushNamed(HOME);
|
|
|
|
@ -442,18 +523,21 @@ class _AppDrawerState extends State<AppDrawer> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
switchUser(user, context) {
|
|
|
|
switchUser(user, context) {
|
|
|
|
Utils.showProgressDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
this
|
|
|
|
this
|
|
|
|
.familyFileProvider
|
|
|
|
.familyFileProvider
|
|
|
|
.silentLoggin(user is AuthenticatedUser ? null : user,
|
|
|
|
.silentLoggin(user is AuthenticatedUser ? null : user,
|
|
|
|
mainUser: user is AuthenticatedUser)
|
|
|
|
mainUser: user is AuthenticatedUser)
|
|
|
|
.then((value) => loginAfter(value, context))
|
|
|
|
.then((value) {
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
loginAfter(value, context);
|
|
|
|
|
|
|
|
})
|
|
|
|
.catchError((err) {
|
|
|
|
.catchError((err) {
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
print(err);
|
|
|
|
print(err);
|
|
|
|
AppToast.showErrorToast(message: err);
|
|
|
|
AppToast.showErrorToast(message: err);
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
}).showProgressBar(
|
|
|
|
});
|
|
|
|
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
loginAfter(result, context) async {
|
|
|
|
loginAfter(result, context) async {
|
|
|
|
|