Merge branches 'diplomatic-quarter-live' and 'notifications_page' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into notifications_page

 Conflicts:
	lib/config/localized_values.dart
	lib/uitl/translations_delegate_base.dart
fix_issues
Elham Rababah 4 years ago
commit 5ed4d76a54

@ -130,7 +130,10 @@ const Map<String, Map<String, String>> localizedValues = {
"nationalID": {"en": "National ID", "ar": "رقم الهوية"}, "nationalID": {"en": "National ID", "ar": "رقم الهوية"},
"fileNo": {"en": "File Number", "ar": "رقم الملف"}, "fileNo": {"en": "File Number", "ar": "رقم الملف"},
"forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"}, "forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"},
"forgotFileNoTitle": {"en": "Forgot medical file Number", "ar": "نسيت رقم الملف"}, "forgotFileNoTitle": {
"en": "Forgot medical file Number",
"ar": "نسيت رقم الملف"
},
"enter-national-id": { "enter-national-id": {
"en": "Please enter mobile number and national ID / Iqama", "en": "Please enter mobile number and national ID / Iqama",
@ -341,7 +344,7 @@ const Map<String, Map<String, String>> localizedValues = {
"MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'}, "MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'},
"myMedicalFileSubTitle": { "myMedicalFileSubTitle": {
"en": "All your medical records", "en": "All your medical records",
'ar': 'جميع سجلاتك البية' 'ar': 'جميع سجلاتك الطبية'
}, },
"viewMore": {"en": "View More", 'ar': 'عرض المزيد'}, "viewMore": {"en": "View More", 'ar': 'عرض المزيد'},
"homeHealthCareService": { "homeHealthCareService": {
@ -662,7 +665,10 @@ const Map<String, Map<String, String>> localizedValues = {
"ar": "الفحص ليس تشخيص." "ar": "الفحص ليس تشخيص."
}, },
"remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"}, "remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"},
"loginToUseService": {"en": "You need to login to use this service", "ar": "هذة الخدمة تتطلب تسجيل الدخول"}, "loginToUseService": {
"en": "You need to login to use this service",
"ar": "هذة الخدمة تتطلب تسجيل الدخول"
},
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
@ -673,9 +679,11 @@ const Map<String, Map<String, String>> localizedValues = {
"en": "Drag point to change your age", "en": "Drag point to change your age",
"ar": "اسحب لتغيير عمرك" "ar": "اسحب لتغيير عمرك"
}, },
"email": {"en": "Email", "ar": "البريد الالكتروني"},
"Book": {"en": "Book", "ar": "احجز"}, "Book": {"en": "Book", "ar": "احجز"},
"AppointmentLabel": {"en": "Appointment", "ar": "موعد"}, "AppointmentLabel": {"en": "Appointment", "ar": "موعد"},
"BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"}, "BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"},
"marital-status": {"en": "Marital status", "ar": "الحالة الإجتماعية"}
"notifications": {"en": "Notifications", "ar": "إشعارات"}, "notifications": {"en": "Notifications", "ar": "إشعارات"},
"notificationDetails": {"en": "Notification Details", "ar": "تفاصيل الاشعار"}, "notificationDetails": {"en": "Notification Details", "ar": "تفاصيل الاشعار"},

@ -23,5 +23,6 @@ class AuthenticatedUserObject {
logout() async { logout() async {
isLogin = false; isLogin = false;
var asd ="";
} }
} }

@ -31,48 +31,9 @@ class InsuranceCardService extends BaseService {
_cardUpdated.clear(); _cardUpdated.clear();
} }
InsuranceCardModel _insuranceCardModel = InsuranceCardModel(
channel: 3,
deviceTypeID: 2,
generalid: "Cs2020@2016\$2958",
iPAdress: "10.20.10.20",
isDentalAllowedBackend: false,
languageID: 1,
patientID: 1231755,
patientOutSA: 0,
patientType: 1,
patientTypeID: 1,
sessionID: "uoKFXSLUwEaHYPwKZNA",
tokenID: "@dm!n",
versionID: 5.5,
);
InsuranceUpdateModel _insuranceUpdateModel = InsuranceUpdateModel(
channel: 3,
deviceTypeID: 2,
generalid: "Cs2020@2016\$2958",
iPAdress: "10.20.10.20",
isDentalAllowedBackend: false,
patientID: 1231755,
patientType: 1,
versionID: 5.5,
languageID: 2,
patientOutSA: 0,
sessionID: "ENRSJBKXnzCuuVQ",
);
InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel( InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel(
versionID: 5.5,
channel: 3,
languageID: LANGUAGE_ID,
iPAdress: "10.20.10.20",
generalid: "Cs2020@2016\$2958",
patientOutSA: 0,
sessionID: "DypNmtMkivzURHjeYg",
isDentalAllowedBackend: false, isDentalAllowedBackend: false,
deviceTypeID: 2,
patientID: 1231755,
tokenID: "@dm!n",
patientTypeID: 1, patientTypeID: 1,
patientType: 1, patientType: 1,
eXuldAPPNO: 0, eXuldAPPNO: 0,
@ -89,7 +50,7 @@ class InsuranceCardService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _insuranceCardModel.toJson()); }, body: Map());
} }
Future getInsuranceUpdate() async { Future getInsuranceUpdate() async {
@ -97,13 +58,14 @@ class InsuranceCardService extends BaseService {
// _cardList.clear(); // _cardList.clear();
await baseAppClient.post(GET_PAtIENTS_INSURANCE_UPDATED, await baseAppClient.post(GET_PAtIENTS_INSURANCE_UPDATED,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_cardUpdated.clear();
response['List_PatientInsuranceCardHistory'].forEach((item) { response['List_PatientInsuranceCardHistory'].forEach((item) {
_cardUpdated.add(InsuranceUpdateModel.fromJson(item)); _cardUpdated.add(InsuranceUpdateModel.fromJson(item));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _insuranceUpdateModel.toJson()); }, body: Map());
} }
Future getInsuranceApproval({int appointmentNo}) async { Future getInsuranceApproval({int appointmentNo}) async {

@ -95,9 +95,13 @@ class PrescriptionsService extends BaseService {
isDentalAllowedBackend: false); isDentalAllowedBackend: false);
List<PrescriptionReport> prescriptionReportList = List(); List<PrescriptionReport> prescriptionReportList = List();
Future getPrescriptionReport({int dischargeNo}) async { Future getPrescriptionReport({int dischargeNo,int projectId,int clinicID,String setupID}) async {
hasError = false; hasError = false;
_requestPrescriptionReport.dischargeNo = dischargeNo; _requestPrescriptionReport.dischargeNo = dischargeNo;
_requestPrescriptionReport.projectID = projectId;
_requestPrescriptionReport.clinicID = clinicID;
_requestPrescriptionReport.setupID = setupID;
await baseAppClient.post(GET_PRESCRIPTION_REPORT, await baseAppClient.post(GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
prescriptionReportList.clear(); prescriptionReportList.clear();
@ -141,6 +145,9 @@ class PrescriptionsService extends BaseService {
_requestSendPrescriptionEmail.projectID = projectID; _requestSendPrescriptionEmail.projectID = projectID;
hasError = false; hasError = false;
await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, await baseAppClient.post(SEND_PRESCRIPTION_EMAIL,
onSuccess: (response,statusCode){
},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -102,9 +102,9 @@ class PrescriptionsViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
} }
getPrescriptionReport({int dischargeNo}) async { getPrescriptionReport({int dischargeNo,int projectId,int clinicID,String setupID}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReport(dischargeNo: dischargeNo); await _prescriptionsService.getPrescriptionReport(dischargeNo: dischargeNo,projectId: projectId,clinicID: clinicID,setupID: setupID);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -235,7 +235,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
return children; return children;
}, },
), ),
onDaySelected: (date, events,holidays) { onDaySelected: (date, events) {
_onDaySelected(date, events); _onDaySelected(date, events);
_animationController.forward(from: 0.0); _animationController.forward(from: 0.0);
}, },

@ -348,8 +348,11 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
return children; return children;
}, },
), ),
onDaySelected: (date, event,holidays) { onDaySelected: (date, event) {
_onDaySelected(date, event,); _onDaySelected(
date,
event,
);
_animationController.forward(from: 0.0); _animationController.forward(from: 0.0);
}, },
onVisibleDaysChanged: _onVisibleDaysChanged, onVisibleDaysChanged: _onVisibleDaysChanged,

@ -98,12 +98,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
children: <Widget>[ children: <Widget>[
Container( Container(
child: ListView.builder( child: ListView.builder(
itemCount: model.getAllSharedRecordsByStatusResponse itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length,
.getAllSharedRecordsByStatusList ==
null
? 0
: model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Container( return Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.all(10.0),

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
@ -27,6 +28,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../locator.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
final Function goToMyProfile; final Function goToMyProfile;
@ -46,6 +49,8 @@ class _HomePageState extends State<HomePage> {
}); });
super.initState(); super.initState();
} }
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -105,7 +110,7 @@ class _HomePageState extends State<HomePage> {
Orientation.landscape Orientation.landscape
? 0.02 ? 0.02
: 0.03), : 0.03),
child: (!model.isLogin && projectViewModel.user == null) child: (!authenticatedUserObject.isLogin && projectViewModel.user == null)
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: 160, height: 160,
@ -145,8 +150,8 @@ class _HomePageState extends State<HomePage> {
), ),
Align( Align(
alignment: projectViewModel.isArabic alignment: projectViewModel.isArabic
? Alignment.bottomRight ? Alignment.bottomLeft
: Alignment.bottomLeft, : Alignment.bottomRight,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
widget.goToMyProfile(); widget.goToMyProfile();

@ -52,7 +52,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
ProjectViewModel projectProvider; ProjectViewModel projectProvider;
///inject the user data ///inject the user data
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
final authService = new AuthProvider(); final authService = new AuthProvider();
@ -134,21 +135,21 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}); });
_requestIOSPermissions(); _requestIOSPermissions();
pageController = PageController(keepPage: true); pageController = PageController(keepPage: true);
// _firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
//
// if (Platform.isIOS) { if (Platform.isIOS) {
// _firebaseMessaging.requestNotificationPermissions(); _firebaseMessaging.requestNotificationPermissions();
// } }
//
// _firebaseMessaging.getToken().then((String token) { _firebaseMessaging.getToken().then((String token) {
// sharedPref.setString(PUSH_TOKEN, token); sharedPref.setString(PUSH_TOKEN, token);
// if (token != null) { if (token != null) {
// checkUserStatus(token); checkUserStatus(token);
// } }
// requestPermissions(); requestPermissions();
// }).catchError((err) { }).catchError((err) {
// print(err); print(err);
// }); });
//_firebase Background message handler //_firebase Background message handler
// _firebaseMessaging.configure( // _firebaseMessaging.configure(
@ -345,7 +346,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
headline6: headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold), TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
), ),
title: Texts(getText(currentTab).toUpperCase(),bold: true,color: Colors.white,), title: Texts(
getText(currentTab).toUpperCase(),
bold: true,
color: Colors.white,
),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return IconButton( return IconButton(
@ -373,7 +378,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: pageController, controller: pageController,
children: [ children: [
HomePage(goToMyProfile: () {_changeCurrentTab(1);},), HomePage(
goToMyProfile: () {
_changeCurrentTab(1);
},
),
MedicalProfilePage(), MedicalProfilePage(),
BookingOptions(), BookingOptions(),
Container(), Container(),

@ -523,7 +523,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
checkIfUserAgreedBefore(CheckActivationCode result) { checkIfUserAgreedBefore(CheckActivationCode result) {
print(result); print(result);
if (result.isNeedUserAgreement) { if (result.isNeedUserAgreement ==true) {
//move to agreement page. //move to agreement page.
} else { } else {
insertIMEI(); insertIMEI();

@ -228,21 +228,21 @@ class _Login extends State<Login> {
GifLoaderDialogUtils.hideDialog(context), GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate) if (appointmentRateViewModel.isHaveAppointmentNotRate)
{ {
Navigator.pushReplacement( Navigator.pushAndRemoveUntil(
context, context,
FadePage( FadePage(
page: RateAppointmentDoctor(), page: RateAppointmentDoctor(),
), ),
) (r) => false)
} }
else else
{ {
Navigator.pushReplacement( Navigator.pushAndRemoveUntil(
context, context,
FadePage( FadePage(
page: LandingPage(), page: LandingPage(),
), ),
) (r) => false)
} }
}) })
.catchError((err) { .catchError((err) {

@ -1,9 +1,14 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -22,6 +27,19 @@ class _RegisterInfo extends State<RegisterInfo> {
RegisterInfoResponse registerInfo; RegisterInfoResponse registerInfo;
bool isLoading; bool isLoading;
int page = 1; int page = 1;
final List<Location> locationList = [
new Location(name: 'KSA', value: '1'),
new Location(name: 'Dubai', value: '2'),
];
var language;
var registerd_data;
final List<Language> languageList = [
new Language(name: 'English', value: '2'),
new Language(name: 'Arabic', value: '1'),
];
var email = '';
var location;
@override @override
void initState() { void initState() {
@ -55,7 +73,7 @@ class _RegisterInfo extends State<RegisterInfo> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
AppText('National ID'), AppText(TranslationBase.of(context).nationalID),
Container( Container(
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
child: TextFields( child: TextFields(
@ -66,18 +84,34 @@ class _RegisterInfo extends State<RegisterInfo> {
top: 20, bottom: 20, left: 10, right: 10), top: 20, bottom: 20, left: 10, right: 10),
readOnly: true, readOnly: true,
)), )),
AppText('Name'), AppText(TranslationBase.of(context).firstName),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.firstNameEn,
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
readOnly: true,
)),
AppText(TranslationBase.of(context).middleName),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.secondNameEn,
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
readOnly: true,
)),
AppText(TranslationBase.of(context).lastName),
Container( Container(
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
child: TextFields( child: TextFields(
hintText: registerInfo.firstNameEn + hintText: registerInfo.lastNameEn,
' ' +
registerInfo.lastNameEn,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10), top: 20, bottom: 20, left: 10, right: 10),
readOnly: true, readOnly: true,
)), )),
AppText('Gender'), AppText(TranslationBase.of(context).gender),
Container( Container(
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
child: TextFields( child: TextFields(
@ -90,7 +124,16 @@ class _RegisterInfo extends State<RegisterInfo> {
top: 20, bottom: 20, left: 10, right: 10), top: 20, bottom: 20, left: 10, right: 10),
readOnly: true, readOnly: true,
)), )),
AppText('Nationality'), AppText(TranslationBase.of(context).maritalStatus),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.maritalStatus,
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
readOnly: true,
)),
AppText(TranslationBase.of(context).nationality),
Container( Container(
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
child: TextFields( child: TextFields(
@ -99,7 +142,16 @@ class _RegisterInfo extends State<RegisterInfo> {
top: 20, bottom: 20, left: 10, right: 10), top: 20, bottom: 20, left: 10, right: 10),
readOnly: true, readOnly: true,
)), )),
AppText('Date of Birth'), AppText(TranslationBase.of(context).mobileNumber),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText:registerd_data.patientMobileNumber,
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
readOnly: true,
)),
AppText(TranslationBase.of(context).dob),
Container( Container(
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
child: TextFields( child: TextFields(
@ -112,7 +164,73 @@ class _RegisterInfo extends State<RegisterInfo> {
) )
: registerInfo != null && page == 2 : registerInfo != null && page == 2
? Column( ? Column(
children: <Widget>[], crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(TranslationBase.of(context).language,
textAlign: TextAlign.start),
Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(10)),
child: DropdownButtonHideUnderline(
child: DropdownButton(
isExpanded: true,
value: language,
iconSize: 40,
elevation: 16,
onChanged: (value) => {
setState(() {
language = value;
})
},
items: languageList
.map<DropdownMenuItem<String>>(
(Language value) {
return DropdownMenuItem<String>(
value: value.value,
child: Text(value.name),
);
}).toList()))),
AppText(TranslationBase.of(context).location),
Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(10)),
child: DropdownButtonHideUnderline(
child: DropdownButton(
isExpanded: true,
value: language,
iconSize: 40,
elevation: 16,
onChanged: (value) => {
setState(() {
location = value;
})
},
items: locationList
.map<DropdownMenuItem<String>>(
(Location value) {
return DropdownMenuItem<String>(
value: value.value,
child: Text(value.name),
);
}).toList()))),
AppText(TranslationBase.of(context).email),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
onChanged: (value) {
this.email = value;
this.isValid();
},
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
)),
],
) )
: SizedBox(), : SizedBox(),
Expanded( Expanded(
@ -124,9 +242,14 @@ class _RegisterInfo extends State<RegisterInfo> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).next, page == 1
? TranslationBase.of(context).next
: TranslationBase.of(context).register,
() => {nextPage()}, () => {nextPage()},
textColor: Colors.white, textColor: Colors.white,
color: this.isValid() == false && page == 2
? Colors.grey
: Colors.black,
)) ))
], ],
), ),
@ -137,21 +260,110 @@ class _RegisterInfo extends State<RegisterInfo> {
} }
nextPage() { nextPage() {
if (page == 1) {
setState(() { setState(() {
page++; page++;
}); });
} else {
registerNow();
}
} }
registerNow() {} registerNow() {
dynamic request = getTempUserRequest();
request = RegisterUserRequest.fromJson(request);
this.authService.registerUser(request);
}
getRegisterInfo() async { getRegisterInfo() async {
RegisterInfoResponse registerInfo; var data =
registerInfo =
RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA));
if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) {
var data2 = CheckPatientAuthenticationReq.fromJson(
await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN));
setState(() { setState(() {
this.registerInfo = registerInfo; this.registerInfo = data;
this.registerd_data = data2;
}); });
}
}
getTempUserRequest() {
return {
"Patientobject": {
"TempValue": true,
"PatientIdentificationType": 1,
"PatientIdentificationNo": registerInfo.idNumber,
"MobileNumber": registerd_data['patientMobileNumber'],
"PatientOutSA": registerd_data['zipCode'] == '966' ? '0' : '1',
"FirstName": registerInfo.firstNameEn,
"MiddleName": registerInfo.secondNameEn,
"LastName": registerInfo.lastNameEn,
"StrDateofBirth": registerInfo.dateOfBirth,
"DateofBirth":
DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth),
"Gender": registerInfo.gender,
"NationalityID": registerInfo.nationality,
"DateofBirthN": registerInfo.dateOfBirth,
"EmailAddress": email,
"SourceType": location,
"PreferredLanguage": registerd_data['languageID'],
"Marital": registerInfo.maritalStatusCode == 'U'
? '0'
: registerInfo.maritalStatusCode == 'M'
? '1'
: '2',
},
"PatientIdentificationID": registerInfo.idNumber,
"PatientMobileNumber": registerd_data['PatientMobileNumber'],
};
print(this.registerInfo); // var patientObject ={};
// var request ={};
// patientObject['PatientIdentificationType'] = this.identificationType;
// patientObject['PatientIdentificationNo'] = this.id;
// request['PatientIdentificationID'] = this.id;
// request['PatientMobileNumber'] = this.registerInfo.MobileNumber;
// patientObject['MobileNumber'] = this.registerInfo.MobileNumber;
// patientObject['PatientOutSA'] = this.registerInfo.PatientOutSA;
// request['LogInTokenID'] = this.registerInfo.LogInTokenID;
// request['activationCode'] = this.registerInfo.activationCode;
// request['ProjectID'] = this.selectedProjectID;
// patientObject['ProjectID'] = this.selectedProjectID;
// request
// request.setBirthDate(this.dateOfBirth, this.cs.convertISODateToJsonDate(this.dateOfBirth));
// request.setGender(this.gender);
// request.Patientobject.NationalityID = this.selectedNationalityID;
// request.Patientobject.StrDateofBirth = this.dateOfBirth;
// request.Patientobject.DateofBirthN = this.dateHijri;
// request.Patientobject.EmailAddress = this.eMail;
// request.Patientobject.SourceType = this.iSOCountryID
// request.Patientobject.PreferredLanguage = this.preferredLanguage
// request.Patientobject.Marital = this.maritalStatus;
//return request;
} }
bool isValid() {
if (location != null ||
language != null ||
Utils.validEmail(email) == true) {
return true;
} else {
return false;
}
}
}
class Language {
final String name;
final String value;
Language({this.name, this.value});
}
class Location {
final String name;
final String value;
Location({this.name, this.value});
} }

@ -84,7 +84,7 @@ class LabsHomePage extends StatelessWidget {
patientLabOrders: labOrder, patientLabOrders: labOrder,
), ),
), ),
), ),isInOutPatient: labOrder.isInOutPatient,
name: labOrder.doctorName, name: labOrder.doctorName,
profileUrl: labOrder.doctorImageURL, profileUrl: labOrder.doctorImageURL,
subName: TranslationBase.of(context).billNo+' ${labOrder.invoiceNo}', subName: TranslationBase.of(context).billNo+' ${labOrder.invoiceNo}',

@ -31,8 +31,8 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
profileUrl: model.sickLeaveList[index].doctorImageURL, profileUrl: model.sickLeaveList[index].doctorImageURL,
rat: model.sickLeaveList[index].actualDoctorRate.toDouble(), rat: model.sickLeaveList[index].actualDoctorRate.toDouble(),
subName: model.sickLeaveList[index].projectName, subName: model.sickLeaveList[index].projectName,
isInOutPatientDescription: isInOutPatient:
model.sickLeaveList[index].isInOutPatientDescription, model.sickLeaveList[index].isInOutPatient,
onEmailTap: () { onEmailTap: () {
model.sendSickLeaveEmail( model.sendSickLeaveEmail(
message: TranslationBase.of(context).emailSentSuccessfully, message: TranslationBase.of(context).emailSentSuccessfully,

@ -46,9 +46,13 @@ class PrescriptionDetailsPage extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts(prescriptionReport.itemDescription)), child: Texts(
prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN),
), ),
), ),
)
], ],
), ),
), ),
@ -169,7 +173,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Texts(' '), Texts(prescriptionReport.remarks),
], ],
), ),
), ),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -19,10 +20,10 @@ class PrescriptionItemsPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PrescriptionsViewModel>( return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => onModelReady: (model) =>
model.getPrescriptionReport(dischargeNo: prescriptions.dischargeNo), model.getPrescriptionReport(dischargeNo: prescriptions.dischargeNo,setupID:prescriptions.setupID,clinicID: prescriptions.clinicID,projectId: prescriptions.projectID),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Items', appBarTitle: TranslationBase.of(context).prescriptions,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
height: MediaQuery.of(context).size.height * 0.8, height: MediaQuery.of(context).size.height * 0.8,
@ -62,8 +63,9 @@ class PrescriptionItemsPage extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts(model child: Texts(model.prescriptionReportList[index].itemDescription.isNotEmpty?
.prescriptionReportList[index].itemDescription)), model.prescriptionReportList[index].itemDescription :model
.prescriptionReportList[index].itemDescriptionN)),
)), )),
Icon( Icon(
Icons.arrow_forward_ios, Icons.arrow_forward_ios,

@ -86,8 +86,9 @@ class PrescriptionsPage extends StatelessWidget {
child: DoctorCard( child: DoctorCard(
name: prescriptions.doctorName, name: prescriptions.doctorName,
profileUrl: prescriptions.doctorImageURL, profileUrl: prescriptions.doctorImageURL,
rat: prescriptions.doctorRate.toDouble(), rat: prescriptions.actualDoctorRate.toDouble(),
subName: prescriptions.name, subName: prescriptions.name,
isInOutPatient: prescriptions.isInOutPatient,
date: DateUtil.getMonthDayYearDateFormatted( date: DateUtil.getMonthDayYearDateFormatted(
prescriptions.dischargeDate), prescriptions.dischargeDate),
), ),

@ -111,7 +111,7 @@ class AuthProvider with ChangeNotifier {
var imei = await sharedPref.getString(PUSH_TOKEN); var imei = await sharedPref.getString(PUSH_TOKEN);
// if (!request.) { // if (!request.) {
newRequest.iMEI = imei; newRequest.iMEI =imei; //imei!=null ? imei : '';
newRequest.firstName = request.firstName + " " + request.lastName; newRequest.firstName = request.firstName + " " + request.lastName;
newRequest.firstNameN = request.firstNameN + " " + request.lastNameN; newRequest.firstNameN = request.firstNameN + " " + request.lastNameN;
newRequest.lastNameN = request.lastNameN ?? ""; newRequest.lastNameN = request.lastNameN ?? "";

@ -122,8 +122,7 @@ class TranslationBase {
String get loginregister => String get loginregister =>
localizedValues['loginregister'][locale.languageCode]; localizedValues['loginregister'][locale.languageCode];
String get poweredBy => String get poweredBy => localizedValues['poweredBy'][locale.languageCode];
localizedValues['poweredBy'][locale.languageCode];
String get welcome => localizedValues['welcome'][locale.languageCode]; String get welcome => localizedValues['welcome'][locale.languageCode];
@ -373,7 +372,8 @@ class TranslationBase {
String get family => localizedValues['family'][locale.languageCode]; String get family => localizedValues['family'][locale.languageCode];
String get myFamilyFiles => localizedValues['family-title'][locale.languageCode]; String get myFamilyFiles =>
localizedValues['family-title'][locale.languageCode];
String get myFamily => localizedValues['myFamily'][locale.languageCode]; String get myFamily => localizedValues['myFamily'][locale.languageCode];
String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; String get oxygenation => localizedValues['oxygenation'][locale.languageCode];
@ -728,10 +728,16 @@ class TranslationBase {
String get selectAge => localizedValues['select-age'][locale.languageCode]; String get selectAge => localizedValues['select-age'][locale.languageCode];
String get iAm => localizedValues['i-am'][locale.languageCode]; String get iAm => localizedValues['i-am'][locale.languageCode];
String get yearOld => localizedValues['years-old'][locale.languageCode]; String get yearOld => localizedValues['years-old'][locale.languageCode];
String get email => localizedValues['email'][locale.languageCode];
String get book => localizedValues['Book'][locale.languageCode]; String get book => localizedValues['Book'][locale.languageCode];
String get appointmentLabel => localizedValues['AppointmentLabel'][locale.languageCode]; String get appointmentLabel =>
localizedValues['AppointmentLabel'][locale.languageCode];
String get bloodType => localizedValues['BloodType'][locale.languageCode]; String get bloodType => localizedValues['BloodType'][locale.languageCode];
String get loginToUseService =>
localizedValues['loginToUseService'][locale.languageCode];
String get maritalStatus =>
localizedValues['marital-status'][locale.languageCode];
String get loginToUseService => localizedValues['loginToUseService'][locale.languageCode]; String get loginToUseService => localizedValues['loginToUseService'][locale.languageCode];
String get notifications => localizedValues['notifications'][locale.languageCode]; String get notifications => localizedValues['notifications'][locale.languageCode];
String get notificationDetails => localizedValues['notificationDetails'][locale.languageCode]; String get notificationDetails => localizedValues['notificationDetails'][locale.languageCode];

@ -152,4 +152,10 @@ class Utils {
static Uint8List dataFromBase64String(String base64String) { static Uint8List dataFromBase64String(String base64String) {
return base64Decode(base64String); return base64Decode(base64String);
} }
static validEmail(email) {
return RegExp(
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
.hasMatch(email);
}
} }

@ -15,8 +15,7 @@ class DoctorCard extends StatelessWidget {
final String billNo; final String billNo;
final Function onTap; final Function onTap;
final Function onEmailTap; final Function onEmailTap;
final bool isInOutPatient;
final String isInOutPatientDescription;
DoctorCard( DoctorCard(
{this.name, {this.name,
@ -27,7 +26,7 @@ class DoctorCard extends StatelessWidget {
this.billNo, this.billNo,
this.onTap, this.onTap,
this.onEmailTap, this.onEmailTap,
this.isInOutPatientDescription}); this.isInOutPatient});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -54,7 +53,7 @@ class DoctorCard extends StatelessWidget {
width: 20, width: 20,
height: date == null ? 100 : 130, height: date == null ? 100 : 130,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.red[900], color: !isInOutPatient? Colors.red[900]: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(8), topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8))), bottomLeft: Radius.circular(8))),
@ -62,7 +61,7 @@ class DoctorCard extends StatelessWidget {
quarterTurns: 3, quarterTurns: 3,
child: Center( child: Center(
child: Text( child: Text(
isInOutPatientDescription ?? "Calendar", !isInOutPatient? 'In Patient'.toUpperCase():'OutPatient'.toUpperCase(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
)), )),

@ -9,7 +9,7 @@ class StarRating extends StatelessWidget {
final int totalCount; final int totalCount;
final bool forceStars; final bool forceStars;
StarRating({Key key, this.totalAverage: 0.0, this.size: 16.0, this.totalCount, this.forceStars = false}) : super(key: key); StarRating({Key key, this.totalAverage: 0.0, this.size: 16.0, this.totalCount=5, this.forceStars = false}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -81,7 +82,13 @@ class AppScaffold extends StatelessWidget {
centerTitle: true, centerTitle: true,
actions: <Widget>[ actions: <Widget>[
image!=null? InkWell( image!=null? InkWell(
onTap: ()=> Navigator.pop(context), onTap: ()=>
Navigator.push(
context,
FadePage(
page: InsuranceUpdate(),
),
),
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Image.asset( child: Image.asset(
@ -94,6 +101,8 @@ class AppScaffold extends StatelessWidget {
icon: Icon(FontAwesomeIcons.home), icon: Icon(FontAwesomeIcons.home),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
MaterialPageRoute(builder: (context) => LandingPage()), MaterialPageRoute(builder: (context) => LandingPage()),

Loading…
Cancel
Save