bug fixes

dq_and_master
Sultan Khan 4 years ago
parent 21ccf1ef86
commit e28209d4e8

@ -1044,5 +1044,9 @@ const Map localizedValues = {
"Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.",
"ar":
"هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي."
},
"update-succ": {
"en": "Successfully updated profile",
"ar": "تم تحديث البيانات بنجاح"
}
};

@ -52,6 +52,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
ProjectViewModel projectViewModel;
var notificationCount = '';
var themeNotifier;
///inject the user data
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@ -140,18 +141,17 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.setAutoInitEnabled(true);
locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context);
new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance
.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions();
}
_firebaseMessaging.getToken().then((String token) async {
sharedPref.setString(PUSH_TOKEN, token);
if (token != null && await sharedPref.getObject(USER_PROFILE) ==null) {
if (token != null && await sharedPref.getObject(USER_PROFILE) == null) {
DEVICE_TOKEN = token;
checkUserStatus(token);
}
@ -159,122 +159,124 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}).catchError((err) {
print(err);
});
//
// //_firebase Background message handler
Future.delayed(Duration.zero, () => setTheme());
//_firebase Background message handler
// _firebaseMessaging.configure(
// onMessage: (Map<String, dynamic> message) async {
// showDialog("onMessage: $message");
// print("onMessage: $message");
// print(message);
// print(message['name']);
// print(message['appointmentdate']);
//
// if (Platform.isIOS) {
// if (message['is_call'] == "true") {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found iOS");
// }
// } else {
// print("Is Call Not Found iOS");
// }
//
// if (Platform.isAndroid) {
// if (message['data'].containsKey("is_call")) {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message['data']);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found Android");
// }
// } else {
// print("Is Call Not Found Android");
// }
// },
// onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// onLaunch: (Map<String, dynamic> message) async {
// print("onLaunch: $message");
// showDialog("onLaunch: $message");
// },
// onResume: (Map<String, dynamic> message) async {
// print("onResume: $message");
// print(message);
// print(message['name']);
// print(message['appointmentdate']);
//
// showDialog("onResume: $message");
//
// if (Platform.isIOS) {
// if (message['is_call'] == "true") {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found iOS");
// }
// } else {
// print("Is Call Not Found iOS");
// }
// },
// );
// // onMessage: (Map<String, dynamic> message) async {
// // showDialog("onMessage: $message");
// // print("onMessage: $message");
// // print(message);
// // print(message['name']);
// // print(message['appointmentdate']);
// //
// // if (Platform.isIOS) {
// // if (message['is_call'] == "true") {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// // print(myMap);
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => IncomingCall(
// // incomingCallData: LandingPage.incomingCallData)))
// // .then((value) {
// // isPageNavigated = false;
// // });
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// //
// // if (Platform.isAndroid) {
// // if (message['data'].containsKey("is_call")) {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap =
// // new Map<String, dynamic>.from(message['data']);
// // print(myMap);
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => IncomingCall(
// // incomingCallData: LandingPage.incomingCallData)))
// // .then((value) {
// // isPageNavigated = false;
// // });
// // }
// // } else {
// // print("Is Call Not Found Android");
// // }
// // } else {
// // print("Is Call Not Found Android");
// // }
// // },
// // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// // onLaunch: (Map<String, dynamic> message) async {
// // print("onLaunch: $message");
// // showDialog("onLaunch: $message");
// // },
// // onResume: (Map<String, dynamic> message) async {
// // print("onResume: $message");
// // print(message);
// // print(message['name']);
// // print(message['appointmentdate']);
// //
// // showDialog("onResume: $message");
// //
// // if (Platform.isIOS) {
// // if (message['is_call'] == "true") {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap =
// // new Map<String, dynamic>.from(message);
// // print(myMap);
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => IncomingCall(
// // incomingCallData: LandingPage.incomingCallData)))
// // .then((value) {
// // isPageNavigated = false;
// // });
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// // },
// );
}
showDialogs(String message) {
@ -390,7 +392,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
notificationCount,
style: new TextStyle(
color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9,
fontSize: projectViewModel.isArabic ? 8 : 9,
),
textAlign: TextAlign.center,
),
@ -405,16 +407,18 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
IconButton(
//iconSize: 70,
icon: Icon(
projectViewModel.isLogin ? Icons.settings : Icons.login,
projectViewModel.isLogin && projectViewModel.user != null
? Icons.settings
: Icons.login,
color: Colors.white,
),
onPressed: () {
if (projectViewModel.isLogin)
if (projectViewModel.isLogin && projectViewModel.user != null)
Navigator.of(context).pushNamed(
SETTINGS,
);
else
login();
login();
}, //do something,
)
],
@ -428,7 +432,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
children: [
HomePage(
goToMyProfile: () {
_changeCurrentTab(1);
// _changeCurrentTab(1);
},
),
MedicalProfilePage(),
@ -464,50 +468,51 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
case 2:
return TranslationBase.of(context).bookAppo;
case 3:
return TranslationBase.of(context).myFamily;
case 4:
return TranslationBase.of(context).services;
case 4:
return TranslationBase.of(context).bookAppo;
}
}
setTheme() async{
//
// defaultTheme =
// ThemeData(
// fontFamily:projectViewModel.isArabic ? 'Cairo' : 'WorkSans',
// primarySwatch: Colors.blue,
// visualDensity: VisualDensity.adaptivePlatformDensity,
// brightness: Brightness.light,
// pageTransitionsTheme: const PageTransitionsTheme(
// builders: {
// TargetPlatform.android: ZoomPageTransitionsBuilder(),
// TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
// },
// ),
// hintColor: Colors.grey[400],
// disabledColor: Colors.grey[300],
// errorColor: Color.fromRGBO(235, 80, 60, 1.0),
// scaffoldBackgroundColor: Color(0xffEEEEEE),
// textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
// textSelectionHandleColor: Colors.grey,
// canvasColor: Colors.white,
// backgroundColor: Colors.white,
// highlightColor: Colors.grey[100].withOpacity(0.4),
// splashColor: Colors.transparent,
// primaryColor: Color(0xff40ACC9),
// bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
// cursorColor: Colors.grey,
// cardColor: Colors.white,
// iconTheme: IconThemeData(),
// appBarTheme: AppBarTheme(
// color: Color(0xff40ACC9),
// brightness: Brightness.dark,
// elevation: 10.0,
// actionsIconTheme: IconThemeData(
// color: Color(0xff40ACC9),
// ),
// ),
// );
// themeNotifier.setTheme(defaultTheme);
setTheme() async {
//
// defaultTheme =
// ThemeData(
// fontFamily:projectViewModel.isArabic ? 'Cairo' : 'WorkSans',
// primarySwatch: Colors.blue,
// visualDensity: VisualDensity.adaptivePlatformDensity,
// brightness: Brightness.light,
// pageTransitionsTheme: const PageTransitionsTheme(
// builders: {
// TargetPlatform.android: ZoomPageTransitionsBuilder(),
// TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
// },
// ),
// hintColor: Colors.grey[400],
// disabledColor: Colors.grey[300],
// errorColor: Color.fromRGBO(235, 80, 60, 1.0),
// scaffoldBackgroundColor: Color(0xffEEEEEE),
// textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
// textSelectionHandleColor: Colors.grey,
// canvasColor: Colors.white,
// backgroundColor: Colors.white,
// highlightColor: Colors.grey[100].withOpacity(0.4),
// splashColor: Colors.transparent,
// primaryColor: Color(0xff40ACC9),
// bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
// cursorColor: Colors.grey,
// cardColor: Colors.white,
// iconTheme: IconThemeData(),
// appBarTheme: AppBarTheme(
// color: Color(0xff40ACC9),
// brightness: Brightness.dark,
// elevation: 10.0,
// actionsIconTheme: IconThemeData(
// color: Color(0xff40ACC9),
// ),
// ),
// );
// themeNotifier.setTheme(defaultTheme);
}
void checkUserStatus(token) async {
authService
@ -522,8 +527,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
.then((res) => {print(res)});
authService.getDashboard().then((value) => {
setState(() {
notificationCount = value['List_PatientDashboard']
[0]['UnreadPatientNotificationCount'].toString();
notificationCount = value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
})
});
}
@ -555,6 +561,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_changeCurrentTab(2);
}
}
login() async {
var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);

@ -9,9 +9,9 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class ProfileSettings extends StatefulWidget {
@override
_ProfileSettings createState() => _ProfileSettings();
}
@ -32,10 +32,10 @@ class _ProfileSettings extends State<ProfileSettings>
});
super.initState();
}
Widget build(BuildContext context) {
Widget build(BuildContext context) {
return BaseView<DashboardViewModel>(
onModelReady: (model) =>{},
onModelReady: (model) => {},
builder: (_, model, wi) => Container(
child:
ListView(scrollDirection: Axis.vertical, children: <Widget>[
@ -82,7 +82,6 @@ class _ProfileSettings extends State<ProfileSettings>
setState(() {
language = value;
});
},
)
],
@ -102,7 +101,6 @@ class _ProfileSettings extends State<ProfileSettings>
setState(() {
language = value;
});
},
)
],
@ -164,7 +162,7 @@ class _ProfileSettings extends State<ProfileSettings>
children: [
AppText(TranslationBase.of(context).email),
TextField(
controller: emailController,
controller: emailController,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
@ -179,7 +177,7 @@ class _ProfileSettings extends State<ProfileSettings>
children: [
AppText(TranslationBase.of(context).emergencyName),
TextField(
controller: emergencyContactName,
controller: emergencyContactName,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
@ -209,7 +207,7 @@ class _ProfileSettings extends State<ProfileSettings>
child: DefaultButton(
TranslationBase.of(context).submit,
() {
saveSettings();
saveSettings();
},
)),
],
@ -217,14 +215,15 @@ class _ProfileSettings extends State<ProfileSettings>
])));
}
getSettings(context){
getSettings(context) {
GifLoaderDialogUtils.showMyDialog(context);
authService.getSettings().then((result)=>{
GifLoaderDialogUtils.hideDialog(context),
setValue(result["PateintInfoForUpdateList"][0])
});
authService.getSettings().then((result) => {
GifLoaderDialogUtils.hideDialog(context),
setValue(result["PateintInfoForUpdateList"][0])
});
}
setValue(value){
setValue(value) {
setState(() {
this.language = int.parse(value["PreferredLanguage"]);
this.emailAlert = value["IsEmailAlertRequired"];
@ -233,20 +232,21 @@ class _ProfileSettings extends State<ProfileSettings>
this.emergencyContact.text = value["EmergencyContactNo"];
this.emergencyContactName.text = value["EmergencyContactName"];
});
}
saveSettings(){
saveSettings() {
GifLoaderDialogUtils.showMyDialog(context);
Map<String, dynamic> request = {};
request["EmailAddress"] =this.emailController.text;
request["EmailAddress"] = this.emailController.text;
request["EmergencyContactName"] = this.emergencyContactName.text;
request["EmergencyContactNo"] = this.emergencyContact.text;
request["IsEmailAlertRequired"] = this.emailAlert;
request["IsSMSAlertRequired"] = this.smsAlert;
request["PreferredLanguage"] = this.language.toString();
authService.saveSettings(request).then((result)=>{
print(result),
GifLoaderDialogUtils.hideDialog(context)
});
authService.saveSettings(request).then((result) => {
AppToast.showSuccessToast(
message: TranslationBase.of(context).profileUpdate),
GifLoaderDialogUtils.hideDialog(context)
});
}
}

@ -148,7 +148,7 @@ class TranslationBase {
String get idNo => localizedValues['national-id'][locale.languageCode];
String get fileNo => localizedValues['fileNo'][locale.languageCode];
String get fileno => localizedValues['fileno'][locale.languageCode];
String get fileno => localizedValues['fileno'][locale.languageCode];
String get forgotPassword =>
localizedValues['forgotFileNo'][locale.languageCode];
@ -791,7 +791,8 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get modes => localizedValues['modes'][locale.languageCode];
String get vibration => localizedValues['vibration'][locale.languageCode];
String get blindMode => localizedValues['blind-modes'][locale.languageCode];
String get invertTheme => localizedValues['invert-theme'][locale.languageCode];
String get invertTheme =>
localizedValues['invert-theme'][locale.languageCode];
String get offTheme => localizedValues['off-theme'][locale.languageCode];
String get dimTheme => localizedValues['dim-theme'][locale.languageCode];
String get bwTheme => localizedValues['bw-theme'][locale.languageCode];
@ -805,8 +806,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
localizedValues['accessibility'][locale.languageCode];
String get selectClinic =>
localizedValues['selectClinic'][locale.languageCode];
String get reviews =>
localizedValues['reviews'][locale.languageCode];
String get reviews => localizedValues['reviews'][locale.languageCode];
String get orderStatus => localizedValues['orderStatus'][locale.languageCode];
String get cancelOrder => localizedValues['CancelOrder'][locale.languageCode];
@ -814,9 +814,12 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get feedback => localizedValues['Feedback'][locale.languageCode];
String get liveChat => localizedValues['LiveChat'][locale.languageCode];
String get service => localizedValues['Service'][locale.languageCode];
String get hMGServiceLabel => localizedValues['HMGServiceLabel'][locale.languageCode];
String get healthWeatherIndicators => localizedValues['HealthWeatherIndicators'][locale.languageCode];
String get healthTipsBasedOnCurrentWeather => localizedValues['HealthTipsBasedOnCurrentWeather'][locale.languageCode];
String get hMGServiceLabel =>
localizedValues['HMGServiceLabel'][locale.languageCode];
String get healthWeatherIndicators =>
localizedValues['HealthWeatherIndicators'][locale.languageCode];
String get healthTipsBasedOnCurrentWeather =>
localizedValues['HealthTipsBasedOnCurrentWeather'][locale.languageCode];
String get moreDetails => localizedValues['MoreDetails'][locale.languageCode];
String get sendCopy => localizedValues['SendCopy'][locale.languageCode];
String get resendOrder => localizedValues['ResendOrder'][locale.languageCode];
@ -830,7 +833,8 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get mass => localizedValues['mass'][locale.languageCode];
String get tempC => localizedValues['temp-c'][locale.languageCode];
String get bpm => localizedValues['bpm'][locale.languageCode];
String get respirationSigns => localizedValues['respiration-signs'][locale.languageCode];
String get respirationSigns =>
localizedValues['respiration-signs'][locale.languageCode];
String get sysDias => localizedValues['sys-dias'][locale.languageCode];
String get body => localizedValues['body'][locale.languageCode];
String get feedbackTitle => localizedValues['feedback'][locale.languageCode];
@ -839,26 +843,39 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get likeToHear => localizedValues['like-to-hear'][locale.languageCode];
String get subject => localizedValues['subject'][locale.languageCode];
String get message => localizedValues['message'][locale.languageCode];
String get emptySubject => localizedValues['empty-subject'][locale.languageCode];
String get emptyMessage => localizedValues['empty-message'][locale.languageCode];
String get selectAttachment => localizedValues['select-attachment'][locale.languageCode];
String get complainAppo => localizedValues['complain-appo'][locale.languageCode];
String get complainWithoutAppo => localizedValues['complain-without-appo'][locale.languageCode];
String get emptySubject =>
localizedValues['empty-subject'][locale.languageCode];
String get emptyMessage =>
localizedValues['empty-message'][locale.languageCode];
String get selectAttachment =>
localizedValues['select-attachment'][locale.languageCode];
String get complainAppo =>
localizedValues['complain-appo'][locale.languageCode];
String get complainWithoutAppo =>
localizedValues['complain-without-appo'][locale.languageCode];
String get question => localizedValues['question'][locale.languageCode];
String get messageType => localizedValues['message-type'][locale.languageCode];
String get messageType =>
localizedValues['message-type'][locale.languageCode];
String get compliment => localizedValues['compliment'][locale.languageCode];
String get suggestion => localizedValues['suggestion'][locale.languageCode];
String get yourFeedback => localizedValues['your-feedback'][locale.languageCode];
String get yourFeedback =>
localizedValues['your-feedback'][locale.languageCode];
String get selectPart => localizedValues['select-part'][locale.languageCode];
String get number => localizedValues['number'][locale.languageCode];
String get notClassified => localizedValues['not-classified'][locale.languageCode];
String get searchItemError => localizedValues['searchItemError'][locale.languageCode];
String get notClassified =>
localizedValues['not-classified'][locale.languageCode];
String get searchItemError =>
localizedValues['searchItemError'][locale.languageCode];
String get youCanFind => localizedValues['YouCanFind'][locale.languageCode];
String get itemInSearch => localizedValues['ItemInSearch'][locale.languageCode];
String get itemInSearch =>
localizedValues['ItemInSearch'][locale.languageCode];
String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode];
String get specialResult => localizedValues['SpecialResult'][locale.languageCode];
String get generalResult => localizedValues['GeneralResult'][locale.languageCode];
String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode];
String get specialResult =>
localizedValues['SpecialResult'][locale.languageCode];
String get generalResult =>
localizedValues['GeneralResult'][locale.languageCode];
String get showMoreBtn =>
localizedValues['show-more-btn'][locale.languageCode];
String get value => localizedValues['value'][locale.languageCode];
String get range => localizedValues['range'][locale.languageCode];
String get outpatient => localizedValues['out-patient'][locale.languageCode];
@ -868,50 +885,69 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get sendCopyRad => localizedValues['send-copy'][locale.languageCode];
String get appoSurvey => localizedValues['appoSurvey'][locale.languageCode];
String get labResults => localizedValues['labResults'][locale.languageCode];
String get doctorRating => localizedValues['doctorRating'][locale.languageCode];
String get doctorRating =>
localizedValues['doctorRating'][locale.languageCode];
String get good => localizedValues['good'][locale.languageCode];
String get v_good => localizedValues['v-good'][locale.languageCode];
String get excellent => localizedValues['excellent'][locale.languageCode];
String get below_average => localizedValues['below-average'][locale.languageCode];
String get below_average =>
localizedValues['below-average'][locale.languageCode];
String get infoSigns => localizedValues['info-signs'][locale.languageCode];
String get infoAdvancePayment => localizedValues['info-advance-payment'][locale.languageCode];
String get infoMyBalance => localizedValues['info-my-balance'][locale.languageCode];
String get infoAdvancePayment =>
localizedValues['info-advance-payment'][locale.languageCode];
String get infoMyBalance =>
localizedValues['info-my-balance'][locale.languageCode];
String get erContant => localizedValues['er-contant'][locale.languageCode];
String get er => localizedValues['er'][locale.languageCode];
String get transportationService => localizedValues['transportation-Service'][locale.languageCode];
String get infoAmbulance => localizedValues['info-ambulance'][locale.languageCode];
String get transportHeading => localizedValues['RRT-transport-heading'][locale.languageCode];
String get transportationService =>
localizedValues['transportation-Service'][locale.languageCode];
String get infoAmbulance =>
localizedValues['info-ambulance'][locale.languageCode];
String get transportHeading =>
localizedValues['RRT-transport-heading'][locale.languageCode];
String get sar => localizedValues['sar'][locale.languageCode];
String get directionHeading => localizedValues['RRT-direction-heading'][locale.languageCode];
String get directionHeading =>
localizedValues['RRT-direction-heading'][locale.languageCode];
String get toHospital => localizedValues['to-hospital'][locale.languageCode];
String get fromHospital => localizedValues['from-hospital'][locale.languageCode];
String get fromHospital =>
localizedValues['from-hospital'][locale.languageCode];
String get oneDirec => localizedValues['one-direc'][locale.languageCode];
String get twoDirec => localizedValues['two-direc'][locale.languageCode];
String get pickupLocation => localizedValues['pickup-location'][locale.languageCode];
String get pickupLocation =>
localizedValues['pickup-location'][locale.languageCode];
String get pickupSpot => localizedValues['pickup-spot'][locale.languageCode];
String get insideHome => localizedValues['inside-home'][locale.languageCode];
String get haveAppo => localizedValues['have-appo'][locale.languageCode];
String get dropoffLocation => localizedValues['dropoff-location'][locale.languageCode];
String get dropoffLocation =>
localizedValues['dropoff-location'][locale.languageCode];
String get selectAll => localizedValues['select-all'][locale.languageCode];
String get selectMap => localizedValues['select-map'][locale.languageCode];
String get noAppointment => localizedValues['no-appointment'][locale.languageCode];
String get patientShareB => localizedValues['patient-share'][locale.languageCode];
String get patientShareTax => localizedValues['patient-share-tax'][locale.languageCode];
String get patientShareTotal => localizedValues['patient-share-total'][locale.languageCode];
String get selectAmbulate => localizedValues['select-ambulate'][locale.languageCode];
String get noAppointment =>
localizedValues['no-appointment'][locale.languageCode];
String get patientShareB =>
localizedValues['patient-share'][locale.languageCode];
String get patientShareTax =>
localizedValues['patient-share-tax'][locale.languageCode];
String get patientShareTotal =>
localizedValues['patient-share-total'][locale.languageCode];
String get selectAmbulate =>
localizedValues['select-ambulate'][locale.languageCode];
String get wheelchair => localizedValues['wheelchair'][locale.languageCode];
String get walker => localizedValues['walker"'][locale.languageCode];
String get stretcher => localizedValues['stretcher'][locale.languageCode];
String get none => localizedValues['none'][locale.languageCode];
String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode];
String get billAmount => localizedValues['bill-amount'][locale.languageCode];
String get transportMethod => localizedValues['transport-method'][locale.languageCode];
String get transportMethod =>
localizedValues['transport-method'][locale.languageCode];
String get directions => localizedValues['directions'][locale.languageCode];
String get infoMyAppointments => localizedValues['info-my-appointments'][locale.languageCode];
String get infoMyAppointments =>
localizedValues['info-my-appointments'][locale.languageCode];
String get infoTodo => localizedValues['info-todo'][locale.languageCode];
String get familyInfo => localizedValues['family-info'][locale.languageCode];
String get profileUpdate =>
localizedValues['update-succ'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -41,19 +41,15 @@ class _AppDrawerState extends State<AppDrawer> {
var familyFileProvider = FamilyFilesProvider();
AuthenticatedUser user;
AuthenticatedUser mainUser;
AuthenticatedUserObject authenticatedUserObject = locator<
AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
VitalSignService _vitalSignService = locator<VitalSignService>();
@override
Widget build(BuildContext context) {
projectProvider = Provider.of(context);
return SizedBox(
width: MediaQuery
.of(context)
.size
.width * 0.75,
width: MediaQuery.of(context).size.width * 0.75,
child: Container(
color: Colors.white,
child: Drawer(
@ -65,359 +61,329 @@ class _AppDrawerState extends State<AppDrawer> {
padding: EdgeInsets.zero,
children: <Widget>[
Container(
height: SizeConfig.screenHeight * .30,
height: SizeConfig.screenHeight * .25,
padding: EdgeInsets.all(15),
child: InkWell(
child: DrawerHeader(
child: Column(
children: <Widget>[
Container(
child:
Image.asset('assets/images/DQ/DQ_logo.png'),
margin: EdgeInsets.all(
SizeConfig.imageSizeMultiplier * 4),
),
(user != null && projectProvider.isLogin)
? Padding(
padding: EdgeInsets.all(15),
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
child: Column(
children: <Widget>[
Container(
child:
Image.asset('assets/images/DQ/DQ_logo.png'),
margin: EdgeInsets.all(
SizeConfig.imageSizeMultiplier * 4),
),
(user != null && projectProvider.isLogin)
? Padding(
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Padding(
padding:
EdgeInsets.only(right: 5),
child: Icon(
Icons.account_circle,
color: Color(0xFF40ACC9),
)),
AppText(
user.firstName +
' ' +
user.lastName,
color: Color(0xFF40ACC9),
)
],
),
Row(children: <Widget>[
Padding(
padding: EdgeInsets.only(
right: 5),
child: Icon(
Icons.account_circle,
color: Color(0xFF40ACC9),
)),
AppText(
user.firstName +
' ' +
user.lastName,
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(),
],
),
padding:
EdgeInsets.only(left: 30),
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(),
],
),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
InkWell(
child: DrawerItem(
TranslationBase
.of(context)
.arabicChange,
Icons.translate),
onTap: () {
// Navigator.of(context).pushNamed(
// WELCOME_LOGIN,
// );
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
? InkWell(
child: DrawerItem(
TranslationBase
.of(context)
.family,
Icons.group,
textColor: Color(0xFF40ACC9),
iconColor: Color(0xFF40ACC9),
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('Loading....'));
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),
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
user.isFamily == null ||
user.isFamily == false
? InkWell(
child: DrawerItem(
TranslationBase.of(context).family,
Icons.group,
textColor: Color(0xFF40ACC9),
iconColor: Color(0xFF40ACC9),
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('Loading....'));
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(
result,
mainUser,
context);
},
child: Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
CrossAxisAlignment
.start,
children: <
Widget>[
Expanded(
child:
Icon(Icons
.person,
color: result
.responseID ==
user
.patientID
? Color(
0xFF40ACC9)
: Colors
.black),
child: Icon(
Icons
.person),
),
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),
]))),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(mainUser.firstName + ' ' + mainUser.lastName),
AppText(TranslationBase.of(context).fileno + ": " + mainUser.patientID.toString()),
])),
],
)))
: SizedBox();
}).toList())
],
));
}
},
),
InkWell(
child: DrawerItem(
TranslationBase
.of(context)
.notification,
Icons.notifications),
onTap: () {
//NotificationsPage
Navigator.of(context).pop();
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
NotificationsPage()));
},
),
InkWell(
child: DrawerItem(
TranslationBase
.of(context)
.appsetting,
Icons.settings_input_composite),
onTap: () {
Navigator.of(context).pushNamed(
SETTINGS,
);
},
),
InkWell(
child: DrawerItem(
TranslationBase
.of(context)
.rateApp,
Icons.star),
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(
TranslationBase
.of(context)
.logout,
Icons.lock_open),
onTap: () {
logout();
},
)
],
)
: InkWell(
child: DrawerItem(
TranslationBase
.of(context)
.loginregister,
Icons.lock_open),
onTap: () {
login();
},
),
: 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: DrawerItem(
TranslationBase.of(context)
.arabicChange,
Icons.translate),
onTap: () {
if (projectProvider.isArabic) {
projectProvider.changeLanguage('en');
} else {
projectProvider.changeLanguage('ar');
}
},
),
InkWell(
child: DrawerItem(
TranslationBase.of(context)
.notification,
Icons.notifications),
onTap: () {
//NotificationsPage
Navigator.of(context).pop();
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
NotificationsPage()));
},
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).appsetting,
Icons.settings_input_composite),
onTap: () {
Navigator.of(context).pushNamed(
SETTINGS,
);
},
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).rateApp,
Icons.star),
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(
TranslationBase.of(context).logout,
Icons.lock_open),
onTap: () {
logout();
},
)
],
)
: Column(
children: [
InkWell(
child: DrawerItem(
TranslationBase.of(context)
.loginregister,
Icons.lock_open),
onTap: () {
login();
},
),
SizedBox(
height: 120,
),
InkWell(
child: DrawerItem(
TranslationBase.of(context)
.arabicChange,
Icons.translate),
onTap: () {
if (projectProvider.isArabic) {
projectProvider.changeLanguage('en');
} else {
projectProvider.changeLanguage('ar');
}
},
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).appsetting,
Icons.settings_input_composite),
onTap: () {
Navigator.of(context).pushNamed(
SETTINGS,
);
},
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).rateApp,
Icons.star),
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");
}
},
)
],
)
],
)
],
@ -436,9 +402,7 @@ class _AppDrawerState extends State<AppDrawer> {
children: [
Column(
children: <Widget>[
Text(TranslationBase
.of(context)
.poweredBy),
Text(TranslationBase.of(context).poweredBy),
Image.asset(
'assets/images/cs_logo_container.png',
width: SizeConfig.imageSizeMultiplier * 30,
@ -527,12 +491,11 @@ class _AppDrawerState extends State<AppDrawer> {
this
.familyFileProvider
.silentLoggin(user is AuthenticatedUser ? null : user,
mainUser: user is AuthenticatedUser)
mainUser: user is AuthenticatedUser)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
loginAfter(value, context);
})
.catchError((err) {
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);

Loading…
Cancel
Save