Merge branch 'diplomatic-quarter-live' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan

merge-update-with-lab-changes
Sultan Khan 5 years ago
commit d939b2ec9b

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

1
ios/.gitignore vendored

@ -32,3 +32,4 @@ Runner/GeneratedPluginRegistrant.*
!default.perspectivev3 !default.perspectivev3
/Runner.xcworkspace/contents.xcworkspacedata /Runner.xcworkspace/contents.xcworkspacedata
/Runner.xcodeproj/project.pbxproj /Runner.xcodeproj/project.pbxproj
/Flutter/.last_build_id

@ -0,0 +1 @@
da98d9f0c1f407e541c636e84847ac81

@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
const MAX_SMALL_SCREEN = 660; const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
@ -119,6 +119,9 @@ const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
//URL to get clinic list //URL to get clinic list
const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
//URL to get active appointment list
const GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber";
//URL to get projects list //URL to get projects list
const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';

@ -109,7 +109,8 @@ const Map<String, Map<String, String>> localizedValues = {
'set-reminder': {'en': 'Set Reminder', 'ar': 'تعيين تذكير'}, 'set-reminder': {'en': 'Set Reminder', 'ar': 'تعيين تذكير'},
'login': {'en': 'Login', 'ar': 'تسجيل الدخول'}, 'login': {'en': 'Login', 'ar': 'تسجيل الدخول'},
'loginregister': {'en': 'Login / Register', 'ar': 'دخولتسجيل'}, 'loginregister': {'en': 'Login / Register', 'ar': 'تسجيل الدخول'},
'poweredBy': {'en': 'Powered By', 'ar': 'مشغل بواسطة'},
'welcome': {'en': 'Welcome', 'ar': 'أهلا بك'}, 'welcome': {'en': 'Welcome', 'ar': 'أهلا بك'},
'welcome_text': { 'welcome_text': {
'en': 'Dr. Sulaiman Al Habib Mobile Application ', 'en': 'Dr. Sulaiman Al Habib Mobile Application ',
@ -117,7 +118,7 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
'welcome_text2': { 'welcome_text2': {
'en': 'Have you visited AlHabib Medical Group before? ', 'en': 'Have you visited AlHabib Medical Group before? ',
'ar': 'الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك' 'ar': 'هل قمت بزيارة مجموعة الحبيب الطبية من قبل؟'
}, },
'yes': {'en': 'Yes', 'ar': 'نعم'}, 'yes': {'en': 'Yes', 'ar': 'نعم'},
'no': {'en': 'No', 'ar': 'لا'}, 'no': {'en': 'No', 'ar': 'لا'},
@ -129,6 +130,11 @@ 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": "نسيت رقم الملف"
},
"enter-national-id": { "enter-national-id": {
"en": "Please enter mobile number and national ID / Iqama", "en": "Please enter mobile number and national ID / Iqama",
"ar": "الرجاء إدخال رقم الجوال والهوية الوطنية / الاقامة" "ar": "الرجاء إدخال رقم الجوال والهوية الوطنية / الاقامة"
@ -283,6 +289,7 @@ const Map<String, Map<String, String>> localizedValues = {
"enter-email": {"en": "Enter Email", "ar": "ادخل البريد الالكتروني"}, "enter-email": {"en": "Enter Email", "ar": "ادخل البريد الالكتروني"},
"family": {"en": "My Family", "ar": "عائلتي"}, "family": {"en": "My Family", "ar": "عائلتي"},
"family-title": {"en": "My Family Files", "ar": "ملفات العائلة"}, "family-title": {"en": "My Family Files", "ar": "ملفات العائلة"},
"myFamily": {"en": "My Family", "ar": "ملفات العائلة"},
"add-new-member": {"en": "Add Family Member", "ar": "إضافة عضو جديد"}, "add-new-member": {"en": "Add Family Member", "ar": "إضافة عضو جديد"},
"sent-requests": {"en": "Sent Requests", "ar": "الطلبات المرسلة"}, "sent-requests": {"en": "Sent Requests", "ar": "الطلبات المرسلة"},
"recieved-requests": {"en": "Recieved Requests", "ar": "الطلبات المستلمة"}, "recieved-requests": {"en": "Recieved Requests", "ar": "الطلبات المستلمة"},
@ -337,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": {
@ -409,7 +416,7 @@ const Map<String, Map<String, String>> localizedValues = {
"locationa": {"en": "location:", "ar": "الموقع"}, "locationa": {"en": "location:", "ar": "الموقع"},
"ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "}, "ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "},
"requestA": {"en": "Request:", "ar": "اسعاف"}, "requestA": {"en": "Request:", "ar": "اسعاف"},
"MyAppointments": {"en": "My Appointments", "ar": "مواعيدي"}, "MyAppointments": {"en": "Appointments", "ar": "مواعيدي"},
"NoBookedAppointments": { "NoBookedAppointments": {
"en": "No Booked Appointments", "en": "No Booked Appointments",
"ar": "لا توجد مواعيد محجوزة" "ar": "لا توجد مواعيد محجوزة"
@ -658,6 +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": "هذة الخدمة تتطلب تسجيل الدخول"
},
"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": "أنا ..."},
@ -668,5 +679,8 @@ 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": "البريد الالكتروني"} "email": {"en": "Email", "ar": "البريد الالكتروني"},
"Book": {"en": "Book", "ar": "احجز"},
"AppointmentLabel": {"en": "Appointment", "ar": "موعد"},
"BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"},
}; };

@ -5,13 +5,13 @@ class AppointmentDetails {
int appointmentNo; int appointmentNo;
int clinicID; int clinicID;
int doctorID; int doctorID;
String startTime; dynamic startTime;
String endTime; dynamic endTime;
String appointmentDate; dynamic appointmentDate;
String clinicName; dynamic clinicName;
String doctorImageURL; dynamic doctorImageURL;
String doctorName; dynamic doctorName;
String projectName; dynamic projectName;
AppointmentDetails( AppointmentDetails(
{this.setupID, {this.setupID,

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

@ -7,7 +7,9 @@ import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import '../../../locator.dart';
import '../../../routes.dart'; import '../../../routes.dart';
import '../AuthenticatedUserObject.dart';
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -16,7 +18,8 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
/// onSuccess: (dynamic response, int statusCode) {}, /// onSuccess: (dynamic response, int statusCode) {},
/// onFailure: (String error, int statusCode) {}, /// onFailure: (String error, int statusCode) {},
/// body: Map(); /// body: Map();
///
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
class BaseAppClient { class BaseAppClient {
post(String endPoint, post(String endPoint,
{Map<String, dynamic> body, {Map<String, dynamic> body,
@ -114,11 +117,15 @@ class BaseAppClient {
onFailure( onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode); statusCode);
logout();
} }
} else if (parsed['MessageStatus'] == 1 || } else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) { parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
}else if (!parsed['IsAuthenticated']) {
await logout();
//helpers.showErrorToast('Your session expired Please login agian');
} else { } else {
if (parsed['SameClinicApptList'] != null) { if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
@ -141,7 +148,8 @@ class BaseAppClient {
logout() async { logout() async {
await sharedPref.remove(LOGIN_TOKEN_ID); await sharedPref.remove(LOGIN_TOKEN_ID);
Navigator.of(AppGlobal.context).pushReplacementNamed(LOGIN_TYPE); await authenticatedUserObject.getUser();
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
} }
String getSessionId(String id) { String getSessionId(String id) {

@ -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);

@ -10,19 +10,23 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
class ProjectViewModel extends BaseViewModel { class ProjectViewModel extends BaseViewModel {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
Locale _appLocale; Locale _appLocale = Locale('ar');
String currentLanguage = 'en'; String currentLanguage = 'ar';
bool _isArabic = false; bool _isArabic = false;
bool isInternetConnection = true; bool isInternetConnection = true;
bool isLoading = false; bool isLoading = false;
bool isError = false; bool isError = false;
String error = ''; String error = '';
dynamic searchvalue; dynamic searchvalue;
dynamic get searchValue => searchvalue; dynamic get searchValue => searchvalue;
Locale get appLocal => _appLocale; Locale get appLocal => _appLocale;
LocaleType get localeType => isArabic? LocaleType.en:LocaleType.ar; LocaleType get localeType => isArabic ? LocaleType.en : LocaleType.ar;
bool get isArabic => _isArabic; bool get isArabic => _isArabic;
// BaseViewModel baseViewModel = locator<BaseViewModel>() // BaseViewModel baseViewModel = locator<BaseViewModel>()
StreamSubscription subscription; StreamSubscription subscription;
@ -48,11 +52,10 @@ class ProjectViewModel extends BaseViewModel {
} }
void loadSharedPrefLanguage() async { void loadSharedPrefLanguage() async {
currentLanguage = await sharedPref.getString(APP_LANGUAGE); currentLanguage =
_appLocale = Locale(currentLanguage ?? 'en'); await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_isArabic = currentLanguage != null _appLocale = Locale(currentLanguage);
? currentLanguage == 'ar' ? true : false _isArabic = currentLanguage == 'ar';
: true;
notifyListeners(); notifyListeners();
} }

@ -1,11 +1,11 @@
import 'dart:convert'; import 'dart:convert';
import 'package:barcode_scan_fix/barcode_scan.dart';
// import 'package:barcode_scan/platform_wrapper.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/qr/qr_parking_model.dart'; import 'package:diplomaticquarterapp/core/model/qr/qr_parking_model.dart';
import 'package:diplomaticquarterapp/core/service/qr_service.dart'; import 'package:diplomaticquarterapp/core/service/qr_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../locator.dart'; import '../../locator.dart';
class QrViewModel extends BaseViewModel { class QrViewModel extends BaseViewModel {
@ -15,25 +15,25 @@ class QrViewModel extends BaseViewModel {
readQr() async { readQr() async {
//TODO fix the barcode scan //TODO fix the barcode scan
// var result = await BarcodeScanner.scan(); String result = await BarcodeScanner.scan();
// var data = json.decode(result.rawContent); var data = json.decode(result);
// var qRParkingID = data['QRParkingID']; var qRParkingID = data['QRParkingID'];
// setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
// await _qrService.getQRParkingByID(qRParkingID); await _qrService.getQRParkingByID(qRParkingID);
// if (_qrService.hasError) { if (_qrService.hasError) {
// error = _qrService.error; error = _qrService.error;
// setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
// } else { } else {
// if (_qrService.qRParkingList.length > 0) { if (_qrService.qRParkingList.length > 0) {
// qrParkingModel = _qrService.qRParkingList[0]; qrParkingModel = _qrService.qRParkingList[0];
// await sharedPref.setObject(IS_GO_TO_PARKING, qrParkingModel); await sharedPref.setObject(IS_GO_TO_PARKING, qrParkingModel);
// isSavePark = true; isSavePark = true;
// setState(ViewState.Idle); setState(ViewState.Idle);
// } else { } else {
// error = "Invalid Qr Code"; error = "Invalid Qr Code";
// setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
// } }
// } }
} }
getIsSaveParking() async { getIsSaveParking() async {

@ -30,4 +30,13 @@ class DQIcons {
static const IconData thermometer = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData thermometer = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData weight_scale = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData weight_scale = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData parking_icon = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData parking_icon = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData blood_type_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData height_icon = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData online_payment_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData search_medicine_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData vital_sign_icon = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData weight_icon = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData my_medical_file = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData family = IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData calendar__2_ = IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg);
} }

@ -1,14 +1,16 @@
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'config/size_config.dart'; import 'config/size_config.dart';
import 'core/viewModels/project_view_model.dart'; import 'core/viewModels/project_view_model.dart';
import 'locator.dart'; import 'locator.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
void main() async { void main() async {
setupLocator(); setupLocator();
@ -29,6 +31,8 @@ class MyApp extends StatelessWidget {
ChangeNotifierProvider<ProjectViewModel>( ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(), create: (context) => ProjectViewModel(),
), ),
ChangeNotifierProvider<ToDoCountProviderModel>(
create: (context) => ToDoCountProviderModel()),
ChangeNotifierProvider<SearchProvider>( ChangeNotifierProvider<SearchProvider>(
create: (context) => SearchProvider()), create: (context) => SearchProvider()),
ChangeNotifierProvider.value( ChangeNotifierProvider.value(
@ -48,6 +52,7 @@ class MyApp extends StatelessWidget {
TranslationBaseDelegate(), TranslationBaseDelegate(),
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
], ],
supportedLocales: [ supportedLocales: [
const Locale('ar', ''), // Arabic const Locale('ar', ''), // Arabic
@ -67,28 +72,27 @@ class MyApp extends StatelessWidget {
hintColor: Colors.grey[400], hintColor: Colors.grey[400],
disabledColor: Colors.grey[300], disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0), errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: HexColor('#E9E9E9'), // Colors.grey[100], scaffoldBackgroundColor: Color(0xffEEEEEE),
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey, textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white, canvasColor: Colors.white,
backgroundColor: Color.fromRGBO(255, 255, 255, 1), backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Colors.grey, primaryColor: Color(0xff40ACC9),
bottomSheetTheme: BottomSheetThemeData( bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
backgroundColor: HexColor('#E0E0E0')),
cursorColor: Colors.grey, cursorColor: Colors.grey,
iconTheme: IconThemeData(), iconTheme: IconThemeData(),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
color: Colors.grey[700], color: Color(0xff40ACC9),
brightness: Brightness.light, brightness: Brightness.dark,
elevation: 0.0, elevation: 10.0,
actionsIconTheme: IconThemeData( actionsIconTheme: IconThemeData(
color: Colors.grey[800], color: Color(0xff40ACC9),
), ),
), ),
), ),
initialRoute: HOME, initialRoute: SPLASH,
routes: routes, routes: routes,
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
), ),

@ -0,0 +1,12 @@
import 'package:flutter/cupertino.dart';
class ToDoCountProviderModel with ChangeNotifier {
int _count;
int get count => _count;
void setState(int count) {
_count = count;
notifyListeners();
}
}

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.da
import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart';
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/family/my-family.dart';
@ -29,6 +30,11 @@ import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class AllHabibMedicalService extends StatefulWidget { class AllHabibMedicalService extends StatefulWidget {
//TODO
final Function goToMyProfile;
AllHabibMedicalService({Key key, this.goToMyProfile});
@override @override
_AllHabibMedicalServiceState createState() => _AllHabibMedicalServiceState(); _AllHabibMedicalServiceState createState() => _AllHabibMedicalServiceState();
} }
@ -95,12 +101,10 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () {
context, Navigator.pop(context);
FadePage( widget.goToMyProfile();
page: MedicalProfilePage(), },
),
),
imageLocation: imageLocation:
'assets/images/new-design/my_file_bottom_bar.png', 'assets/images/new-design/my_file_bottom_bar.png',
title: TranslationBase.of(context).myMedicalFile, title: TranslationBase.of(context).myMedicalFile,
@ -314,7 +318,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage( FadePage(
page: ParkingPage(), page: FindUsPage(),
), ),
), ),
imageLocation: 'assets/images/new-design/find_us_icon.png', imageLocation: 'assets/images/new-design/find_us_icon.png',

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsLis
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/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.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/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -382,8 +383,10 @@ class _BookConfirmState extends State<BookConfirm> {
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo,
BuildContext context) { BuildContext context) {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) { service.cancelAppointment(appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () { Future.delayed(new Duration(milliseconds: 1500), () {
if (!widget.isLiveCareAppointment) { if (!widget.isLiveCareAppointment) {
@ -397,11 +400,12 @@ class _BookConfirmState extends State<BookConfirm> {
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar( GifLoaderDialogUtils.hideDialog(context);
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); });
} }
insertAppointment(context, DoctorList docObject) { insertAppointment(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
widget.service widget.service
.insertAppointment( .insertAppointment(
@ -421,6 +425,7 @@ class _BookConfirmState extends State<BookConfirm> {
docObject.projectID, docObject); docObject.projectID, docObject);
}); });
} else { } else {
GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList(); appo = new AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo']; appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID']; appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
@ -445,11 +450,11 @@ class _BookConfirmState extends State<BookConfirm> {
}).catchError((err) { }).catchError((err) {
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
insertLiveCareScheduledAppointment(context, DoctorList docObject) { insertLiveCareScheduledAppointment(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
widget.service widget.service
.insertLiveCareScheduleAppointment( .insertLiveCareScheduleAppointment(
@ -470,6 +475,7 @@ class _BookConfirmState extends State<BookConfirm> {
docObject.clinicID, docObject.projectID, docObject); docObject.clinicID, docObject.projectID, docObject);
}); });
} else { } else {
GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList(); appo = new AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo']; appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID']; appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
@ -508,12 +514,12 @@ class _BookConfirmState extends State<BookConfirm> {
navigateToBookSuccess(context, docObject, widget.patientShareResponse); navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getLiveCareAppointmentPatientShare(context, String appointmentNo, getLiveCareAppointmentPatientShare(context, String appointmentNo,
int clinicID, int projectID, DoctorList docObject) { int clinicID, int projectID, DoctorList docObject) {
GifLoaderDialogUtils.hideDialog(context);
widget.service widget.service
.getLiveCareAppointmentPatientShare( .getLiveCareAppointmentPatientShare(
appointmentNo, clinicID, projectID, context) appointmentNo, clinicID, projectID, context)
@ -523,8 +529,7 @@ class _BookConfirmState extends State<BookConfirm> {
navigateToBookSuccess(context, docObject, widget.patientShareResponse); navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
String getTime(DateTime dateTime) { String getTime(DateTime dateTime) {
@ -581,6 +586,7 @@ class _BookConfirmState extends State<BookConfirm> {
Future navigateToBookSuccess(context, DoctorList docObject, Future navigateToBookSuccess(context, DoctorList docObject,
PatientShareResponse patientShareResponse) async { PatientShareResponse patientShareResponse) async {
GifLoaderDialogUtils.hideDialog(context);
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(

@ -230,9 +230,10 @@ class _BookSuccessState extends State<BookSuccess> {
children: <Widget>[ children: <Widget>[
_getBulletPoint("1"), _getBulletPoint("1"),
Container( Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text( child: Text(
"Please confirm the appointment to avoid the cancellation", "Please confirm the appointment to avoid the cancellation",
overflow: TextOverflow.fade, overflow: TextOverflow.clip,
style: TextStyle(fontSize: 13.0)), style: TextStyle(fontSize: 13.0)),
), ),
], ],
@ -314,7 +315,7 @@ class _BookSuccessState extends State<BookSuccess> {
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFFc5272d), color: new Color(0xFF40ACC9),
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
@ -483,7 +484,7 @@ class _BookSuccessState extends State<BookSuccess> {
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFFc5272d), color: new Color(0xFF40ACC9),
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),

@ -31,6 +31,7 @@ class _BookingOptionsState extends State<BookingOptions> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: widget.isAppbar, isShowAppBar: widget.isAppbar,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
body: Container( body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),

@ -40,6 +40,8 @@ class _DoctorProfileState extends State<DoctorProfile>
bool showFooterButton = false; bool showFooterButton = false;
var event = RobotProvider(); var event = RobotProvider();
AppSharedPreferences sharedPref = AppSharedPreferences();
@override @override
void initState() { void initState() {
_tabController = new TabController( _tabController = new TabController(
@ -69,6 +71,7 @@ class _DoctorProfileState extends State<DoctorProfile>
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
bottomSheet: showFooterButton bottomSheet: showFooterButton
? Container( ? Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
@ -211,7 +214,6 @@ class _DoctorProfileState extends State<DoctorProfile>
} }
getPatientData() async { getPatientData() async {
AppSharedPreferences sharedPref = AppSharedPreferences();
if (await sharedPref.getObject(USER_PROFILE) != null) { if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
@ -222,14 +224,14 @@ class _DoctorProfileState extends State<DoctorProfile>
} }
} }
void goToBookConfirm() { void goToBookConfirm() async {
if (DocAvailableAppointments.areSlotsAvailable) { if (DocAvailableAppointments.areSlotsAvailable) {
if (widget.authUser.patientID != null) { if (await sharedPref.getObject(USER_PROFILE) != null) {
navigateToBookConfirm(context); navigateToBookConfirm(context);
} else { } else {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: "You have to login to use this service", confirmMessage: TranslationBase.of(context).loginToUseService,
okText: TranslationBase.of(context).confirm, okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {navigateToLogin()}, okFunction: () => {navigateToLogin()},

@ -4,10 +4,10 @@ import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:table_calendar/table_calendar.dart'; import 'package:table_calendar/table_calendar.dart';
import '../../../uitl/date_uitl.dart'; import '../../../uitl/date_uitl.dart';
@ -331,11 +331,13 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
} }
getDoctorFreeSlots(context, DoctorList docObject) { getDoctorFreeSlots(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, .getDoctorFreeSlots(docObject.doctorID, docObject.clinicID,
docObject.projectID, context) docObject.projectID, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) { if (res['FreeTimeSlots'].length != 0) {
freeSlotsResponse = res['FreeTimeSlots']; freeSlotsResponse = res['FreeTimeSlots'];
@ -350,16 +352,17 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getDoctorScheduledFreeSlots(context, DoctorList docObject) { getDoctorScheduledFreeSlots(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID, .getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID,
docObject.projectID, docObject.serviceID, context) docObject.projectID, docObject.serviceID, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['PatientER_DoctorFreeSlots'].length != 0) { if (res['PatientER_DoctorFreeSlots'].length != 0) {
freeSlotsResponse = res['PatientER_DoctorFreeSlots']; freeSlotsResponse = res['PatientER_DoctorFreeSlots'];
@ -374,8 +377,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Widget _buildEventsMarker(DateTime date, List events) { Widget _buildEventsMarker(DateTime date, List events) {

@ -1,9 +1,9 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class DoctorInformation extends StatelessWidget { class DoctorInformation extends StatelessWidget {
DoctorProfileList docProfileList; DoctorProfileList docProfileList;
DoctorInformation({@required this.docProfileList}); DoctorInformation({@required this.docProfileList});
@ -27,8 +27,8 @@ class DoctorInformation extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset( SvgPicture.asset(
"assets/images/new-design/doctor_information_icon.png"), "assets/images/DQ/doctor_information_icon.svg"),
Container( Container(
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0), margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0),
child: Text(TranslationBase.of(context).docInfo, child: Text(TranslationBase.of(context).docInfo,
@ -43,12 +43,21 @@ class DoctorInformation extends StatelessWidget {
child: Table( child: Table(
children: [ children: [
TableRow(children: [ TableRow(children: [
TableCell(child: _getHeadingText(TranslationBase.of(context).gender)), TableCell(
TableCell(child: _getHeadingText(TranslationBase.of(context).nationality)), child: _getHeadingText(
TranslationBase.of(context).gender)),
TableCell(
child: _getHeadingText(
TranslationBase.of(context).nationality)),
]), ]),
TableRow(children: [ TableRow(children: [
TableCell(child: _getNormalText(docProfileList.genderDescription)), TableCell(
TableCell(child: _getNormalTextWithIcon(docProfileList.nationalityName, docProfileList.nationalityFlagURL)), child: _getNormalText(
docProfileList.genderDescription)),
TableCell(
child: _getNormalTextWithIcon(
docProfileList.nationalityName,
docProfileList.nationalityFlagURL)),
]), ]),
], ],
), ),
@ -82,13 +91,14 @@ class DoctorInformation extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset( SvgPicture.asset(
"assets/images/new-design/doctor_qualification_icon.png"), "assets/images/DQ/doctor_qualification_icon.svg"),
Container( Container(
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0), margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0),
child: Text(TranslationBase.of(context).docQualifications, child: Text(
TranslationBase.of(context).docQualifications,
style: style:
TextStyle(fontSize: 16.0, letterSpacing: 0.8)), TextStyle(fontSize: 16.0, letterSpacing: 0.8)),
), ),
], ],
), ),
@ -146,10 +156,7 @@ class DoctorInformation extends StatelessWidget {
color: Colors.grey[700])), color: Colors.grey[700])),
Container( Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0), margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Image.network( child: Image.network(icon, width: 18.0, height: 18.0),
icon,
width: 18.0,
height: 18.0),
), ),
], ],
), ),

@ -8,8 +8,8 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.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/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -17,7 +17,9 @@ import 'package:smart_progress_bar/smart_progress_bar.dart';
class SearchByClinic extends StatefulWidget { class SearchByClinic extends StatefulWidget {
final List clnicIds; final List clnicIds;
SearchByClinic({this.clnicIds}); SearchByClinic({this.clnicIds});
@override @override
_SearchByClinicState createState() => _SearchByClinicState(); _SearchByClinicState createState() => _SearchByClinicState();
} }
@ -26,11 +28,13 @@ class _SearchByClinicState extends State<SearchByClinic> {
bool nearestAppo = false; bool nearestAppo = false;
String dropdownValue; String dropdownValue;
String projectDropdownValue; String projectDropdownValue;
// var event = RobotProvider(); // var event = RobotProvider();
List<ListClinicCentralized> clinicsList = []; List<ListClinicCentralized> clinicsList = [];
List<HospitalsModel> projectsList = []; List<HospitalsModel> projectsList = [];
bool isMobileAppDentalAllow = false; bool isMobileAppDentalAllow = false;
bool isLoaded = false; bool isLoaded = false;
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList()); WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList());
@ -47,7 +51,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
Row( Row(
children: <Widget>[ children: <Widget>[
Checkbox( Checkbox(
activeColor: new Color(0xFFc5272d), activeColor: new Color(0xFF40ACC9),
value: nearestAppo, value: nearestAppo,
onChanged: (bool value) { onChanged: (bool value) {
setState(() { setState(() {
@ -77,12 +81,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
} }
}); });
}, },
// trailing: Icon(TranslationBase.of(AppGlobal.context)
// .locale
// .languageCode ==
// 'en'
// ? Icons.keyboard_arrow_right
// : Icons.keyboard_arrow_left),
title: Text(result.clinicDescription, title: Text(result.clinicDescription,
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
@ -168,27 +166,21 @@ class _SearchByClinicState extends State<SearchByClinic> {
} }
getClinicsList() { getClinicsList() {
GifLoaderDialogUtils.showMyDialog(context);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service service.getClinicsList(context).then((res) {
.getClinicsList(context) if (res['MessageStatus'] == 1) {
.then((res) { setState(() {
if (res['MessageStatus'] == 1) { isMobileAppDentalAllow = res['ISMobileAppDentalAllow'];
setState(() { res['ListClinicCentralized'].forEach((v) {
isMobileAppDentalAllow = res['ISMobileAppDentalAllow']; clinicsList.add(new ListClinicCentralized.fromJson(v));
res['ListClinicCentralized'].forEach((v) { });
clinicsList.add(new ListClinicCentralized.fromJson(v));
});
});
} else {}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
getProjectsList();
}); });
getProjectsList();
} else {}
}).catchError((err) {
print(err);
});
} }
getProjectsList() { getProjectsList() {
@ -199,23 +191,24 @@ class _SearchByClinicState extends State<SearchByClinic> {
res['ListProject'].forEach((v) { res['ListProject'].forEach((v) {
projectsList.add(new HospitalsModel.fromJson(v)); projectsList.add(new HospitalsModel.fromJson(v));
}); });
print(projectsList.length);
}); });
GifLoaderDialogUtils.hideDialog(context);
filterClinic(); filterClinic();
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getDoctorsList(BuildContext context) { getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
SearchInfo searchInfo = new SearchInfo(); SearchInfo searchInfo = new SearchInfo();
if (dropdownValue == "17") { if (dropdownValue == "17") {
searchInfo.ProjectID = int.parse(projectDropdownValue); searchInfo.ProjectID = int.parse(projectDropdownValue);
searchInfo.ClinicID = int.parse(dropdownValue); searchInfo.ClinicID = int.parse(dropdownValue);
searchInfo.date = DateTime.now(); searchInfo.date = DateTime.now();
GifLoaderDialogUtils.hideDialog(context);
navigateToDentalComplaints(context, searchInfo); navigateToDentalComplaints(context, searchInfo);
} else { } else {
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
@ -231,6 +224,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
nearestAppo, nearestAppo,
context) context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['DoctorList'].length != 0) { if (res['DoctorList'].length != 0) {
@ -249,17 +243,16 @@ class _SearchByClinicState extends State<SearchByClinic> {
result = LinkedHashSet<String>.from(arr).toList(); result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length; numAll = result.length;
navigateToSearchResults( navigateToSearchResults(
context, doctorsList, result, numAll, arrDistance); context, doctorsList, result, numAll, arrDistance);
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
} }
@ -296,8 +289,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
.where((i) => widget.clnicIds.indexOf(i.clinicID) > -1) .where((i) => widget.clnicIds.indexOf(i.clinicID) > -1)
.toList(); .toList();
isLoaded = true; isLoaded = true;
///print(clinicsList);
} }
}); });
} }

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -82,6 +83,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
} }
getDoctorsList(BuildContext context) { getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
@ -123,7 +125,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
}); });
} else {} } else {}
}); });
GifLoaderDialogUtils.hideDialog(context);
navigateToSearchResults( navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital); context, doctorsList, _patientDoctorAppointmentListHospital);
} else { } else {
@ -131,8 +133,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
_onDocTextChanged(content) { _onDocTextChanged(content) {

@ -27,6 +27,7 @@ class _BranchViewState extends State<BranchView> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
isBottomBar: false, isBottomBar: false,
body: new ListView.builder( body: new ListView.builder(
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
@ -109,7 +110,7 @@ class _ExpandableListViewState extends State<ExpandableListView> {
height: 28.0, height: 28.0,
width: 30.0, width: 30.0,
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Colors.red, color: Color(0xFF40ACC9),
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: new Center( child: new Center(

@ -31,7 +31,7 @@ class CardCommon extends StatelessWidget {
child: Text(this.text, child: Text(this.text,
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
style: TextStyle( style: TextStyle(
color: new Color(0xFFc5272d), color: new Color(0xFF40ACC9),
letterSpacing: 1.0, letterSpacing: 1.0,
fontSize: 20.0)), fontSize: 20.0)),
), ),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -135,12 +136,14 @@ class DoctorView extends StatelessWidget {
} }
getDoctorsProfile(context, DoctorList docObject, {isAppo}) { getDoctorsProfile(context, DoctorList docObject, {isAppo}) {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorProfileList> docProfileList = []; List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.getDoctorsProfile(docObject.doctorID, docObject.clinicID, .getDoctorsProfile(docObject.doctorID, docObject.clinicID,
docObject.projectID, context) docObject.projectID, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) { if (res['DoctorProfileList'].length != 0) {
res['DoctorProfileList'].forEach((v) { res['DoctorProfileList'].forEach((v) {
@ -154,7 +157,7 @@ class DoctorView extends StatelessWidget {
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); });
} }
String getDate(String date) { String getDate(String date) {

@ -5,11 +5,11 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCar
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class MyAppointments extends StatefulWidget { class MyAppointments extends StatefulWidget {
List<AppoitmentAllHistoryResultList> appoList = []; List<AppoitmentAllHistoryResultList> appoList = [];
@ -33,6 +33,7 @@ class _MyAppointmentsState extends State<MyAppointments>
bool isDataLoaded = false; bool isDataLoaded = false;
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 3, vsync: this); _tabController = new TabController(length: 3, vsync: this);
@ -77,6 +78,7 @@ class _MyAppointmentsState extends State<MyAppointments>
} }
getPatientAppointmentHistory() { getPatientAppointmentHistory() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
widget.appoList.clear(); widget.appoList.clear();
widget.bookedAppoList.clear(); widget.bookedAppoList.clear();
@ -85,6 +87,7 @@ class _MyAppointmentsState extends State<MyAppointments>
service.getPatientAppointmentHistory(false, context).then((res) { service.getPatientAppointmentHistory(false, context).then((res) {
print(res['AppoimentAllHistoryResultList'].length); print(res['AppoimentAllHistoryResultList'].length);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) { if (res['AppoimentAllHistoryResultList'].length != 0) {
res['AppoimentAllHistoryResultList'].forEach((v) { res['AppoimentAllHistoryResultList'].forEach((v) {
@ -100,11 +103,11 @@ class _MyAppointmentsState extends State<MyAppointments>
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).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));
} }
bool isConfirmed(AppoitmentAllHistoryResultList appo) { bool isConfirmed(AppoitmentAllHistoryResultList appo) {

@ -18,12 +18,12 @@ import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_p
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class AppointmentActions extends StatefulWidget { class AppointmentActions extends StatefulWidget {
@ -94,7 +94,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
child: Text(e.title, child: Text(e.title,
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
style: TextStyle( style: TextStyle(
color: new Color(0xFFc5272d), color: new Color(0xFF40ACC9),
letterSpacing: 1.0, letterSpacing: 1.0,
fontSize: 20.0)), fontSize: 20.0)),
), ),
@ -351,49 +351,49 @@ class _AppointmentActionsState extends State<AppointmentActions> {
cancelAppointment() { cancelAppointment() {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.cancelAppointment(widget.appo, context).then((res) {
.cancelAppointment(widget.appo, context) GifLoaderDialogUtils.hideDialog(context);
.then((res) { print(res);
print(res); if (res['MessageStatus'] == 1) {
if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); Navigator.of(context).pop();
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}) }).catchError((err) {
.catchError((err) { GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}) });
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
Navigator.of(context).pop();
});
} }
openAppointmentRadiology() { openAppointmentRadiology() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
FinalRadiology finalRadiology = new FinalRadiology(); FinalRadiology finalRadiology = new FinalRadiology();
service service
.getPatientRadOrders(widget.appo.appointmentNo.toString(), context) .getPatientRadOrders(widget.appo.appointmentNo.toString(), context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['FinalRadiologyList']); print(res['FinalRadiologyList']);
finalRadiology = finalRadiology =
new FinalRadiology.fromJson(res['FinalRadiologyList'][0]); new FinalRadiology.fromJson(res['FinalRadiologyList'][0]);
print(finalRadiology.reportData); print(finalRadiology.reportData);
navigateToRadiologyDetails(finalRadiology); navigateToRadiologyDetails(finalRadiology);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
openPrescriptionReport() { openPrescriptionReport() {
GifLoaderDialogUtils.showMyDialog(context);
List<PrescriptionReportEnh> prescriptionReportEnhList = List(); List<PrescriptionReportEnh> prescriptionReportEnhList = List();
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getPatientPrescriptionReports(widget.appo, context).then((res) { service.getPatientPrescriptionReports(widget.appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
res['ListPRM'].forEach((report) { res['ListPRM'].forEach((report) {
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report)); prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report));
}); });
@ -405,10 +405,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
AppToast.showErrorToast(message: "Sorry there is no data"); AppToast.showErrorToast(message: "Sorry there is no data");
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Future navigateToMedicinePrescriptionReport( Future navigateToMedicinePrescriptionReport(
@ -463,8 +463,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
askYourDoc() { askYourDoc() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) { service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['PatientDoctorAppointmentResultList']); print(res['PatientDoctorAppointmentResultList']);
if (res['PatientDoctorAppointmentResultList'].length != 0) { if (res['PatientDoctorAppointmentResultList'].length != 0) {
getCallRequestType(); getCallRequestType();
@ -473,15 +475,17 @@ class _AppointmentActionsState extends State<AppointmentActions> {
message: TranslationBase.of(context).askDocNotAllowed); message: TranslationBase.of(context).askDocNotAllowed);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getCallRequestType() { getCallRequestType() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getCallRequestType(context).then((res) { service.getCallRequestType(context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
List<AskDocRequestType> requestData = new List<AskDocRequestType>(); List<AskDocRequestType> requestData = new List<AskDocRequestType>();
res['ListReqTypes'].forEach((element) { res['ListReqTypes'].forEach((element) {
requestData.add(new AskDocRequestType.fromJson(element)); requestData.add(new AskDocRequestType.fromJson(element));
@ -490,9 +494,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
showAskDocRequestDialog(requestData); showAskDocRequestDialog(requestData);
}); });
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
showAskDocRequestDialog(List<AskDocRequestType> requestData) { showAskDocRequestDialog(List<AskDocRequestType> requestData) {
@ -525,28 +529,32 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
sendAskDocRequest(int requestType) { sendAskDocRequest(int requestType) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.sendAskDocCallRequest(widget.appo, requestType.toString(), context) .sendAskDocCallRequest(widget.appo, requestType.toString(), context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Request Sent Successfully"); AppToast.showSuccessToast(message: "Request Sent Successfully");
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
confirmAppointment() { confirmAppointment() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, .confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID,
widget.appo.projectID, widget.appo.isLiveCareAppointment, context) widget.appo.projectID, widget.appo.isLiveCareAppointment, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -554,9 +562,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
navigateToInsuranceApprovals(int appoNo) { navigateToInsuranceApprovals(int appoNo) {

@ -11,6 +11,7 @@ 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/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.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/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
@ -18,7 +19,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class ToDo extends StatefulWidget { class ToDo extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
@ -82,7 +82,7 @@ class _ToDoState extends State<ToDo> {
height: 20.0), height: 20.0),
Container( Container(
margin: margin:
EdgeInsets.only(left: 5.0, right: 25.0), EdgeInsets.only(left: 5.0, right: 20.0),
child: Text( child: Text(
getDate(widget getDate(widget
.appoList[index].appointmentDate), .appoList[index].appointmentDate),
@ -106,7 +106,14 @@ class _ToDoState extends State<ToDo> {
TranslationBase.of(context) TranslationBase.of(context)
.liveCareAppo, .liveCareAppo,
style: TextStyle(fontSize: 12.0)) style: TextStyle(fontSize: 12.0))
: Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-", : Text(
widget.appoList[index].projectName !=
null
? widget
.appoList[index].projectName
: "-",
overflow: TextOverflow.clip,
maxLines: 2,
style: TextStyle(fontSize: 11.0)), style: TextStyle(fontSize: 11.0)),
), ),
], ],
@ -253,7 +260,7 @@ class _ToDoState extends State<ToDo> {
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
color: Colors.red[600], color: new Color(0xFF40ACC9),
decoration: decoration:
TextDecoration.underline)), TextDecoration.underline)),
), ),
@ -464,8 +471,10 @@ class _ToDoState extends State<ToDo> {
} }
getPatientAppointmentHistory() { getPatientAppointmentHistory() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true, context).then((res) { service.getPatientAppointmentHistory(true, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) { if (res['AppoimentAllHistoryResultList'].length != 0) {
@ -485,26 +494,29 @@ class _ToDoState extends State<ToDo> {
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getPatientShare(context, AppoitmentAllHistoryResultList appo) { getPatientShare(context, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, .getPatientShare(appo.appointmentNo.toString(), appo.clinicID,
appo.projectID, context) appo.projectID, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse); openPaymentDialog(appo, widget.patientShareResponse);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getAppoQR(context, AppoitmentAllHistoryResultList appo) { getAppoQR(context, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
PatientShareResponse patientShareResponse = new PatientShareResponse(); PatientShareResponse patientShareResponse = new PatientShareResponse();
patientShareResponse.doctorNameObj = appo.doctorNameObj; patientShareResponse.doctorNameObj = appo.doctorNameObj;
@ -518,12 +530,13 @@ class _ToDoState extends State<ToDo> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.generateAppointmentQR(patientShareResponse, context).then((res) { service.generateAppointmentQR(patientShareResponse, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res); print(res);
navigateToQR(context, res['AppointmentQR'], patientShareResponse); navigateToQR(context, res['AppointmentQR'], patientShareResponse);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Future navigateToQR( Future navigateToQR(
@ -620,6 +633,7 @@ class _ToDoState extends State<ToDo> {
} }
checkPaymentStatus(AppoitmentAllHistoryResultList appo) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.checkPaymentStatus( .checkPaymentStatus(
@ -627,8 +641,7 @@ class _ToDoState extends State<ToDo> {
appo.projectID, appo.clinicID, appo.appointmentNo), appo.projectID, appo.clinicID, appo.appointmentNo),
context) context)
.then((res) { .then((res) {
print("Printing Payment Status Reponse!!!!"); GifLoaderDialogUtils.hideDialog(context);
print(res);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
createAdvancePayment(res, appo); createAdvancePayment(res, appo);
@ -636,18 +649,20 @@ class _ToDoState extends State<ToDo> {
AppToast.showErrorToast(message: res['Response_Message']); AppToast.showErrorToast(message: res['Response_Message']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service service
.createAdvancePayment( .createAdvancePayment(
appo, res['Amount'], res['Fort_id'], res['PaymentMethod'], context) appo, res['Amount'], res['Fort_id'], res['PaymentMethod'], context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest( addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
@ -656,23 +671,25 @@ class _ToDoState extends State<ToDo> {
appo); appo);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar( GifLoaderDialogUtils.hideDialog(context);
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); });
} }
addAdvancedNumberRequest(String advanceNumber, String paymentReference, addAdvancedNumberRequest(String advanceNumber, String paymentReference,
String appointmentID, AppoitmentAllHistoryResultList appo) { String appointmentID, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.addAdvancedNumberRequest( .addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, context) advanceNumber, paymentReference, appointmentID, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res); print(res);
getAppoQR(context, appo); getAppoQR(context, appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}).showProgressBar( });
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Future navigateToPaymentMethod( Future navigateToPaymentMethod(
@ -705,51 +722,46 @@ class _ToDoState extends State<ToDo> {
} }
confirmAppointment(AppoitmentAllHistoryResultList appo) { confirmAppointment(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, .confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.isLiveCareAppointment, context) appo.isLiveCareAppointment, context)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); if (res['MessageStatus'] == 1) {
getPatientAppointmentHistory(); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
} else { if (appo.isLiveCareAppointment) {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); insertLiveCareVIDARequest(appo);
} } else {
}) getPatientAppointmentHistory();
.catchError((err) { }
print(err); } else {
}) AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
.showProgressBar( }
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) }).catchError((err) {
.then((value) { GifLoaderDialogUtils.hideDialog(context);
if (appo.isLiveCareAppointment) { print(err);
insertLiveCareVIDARequest(appo); });
} else {
getPatientAppointmentHistory();
}
});
} }
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) { insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.serviceID, appo.doctorID, context) appo.serviceID, appo.doctorID, context)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); if (res['MessageStatus'] == 1) {
} else { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); getPatientAppointmentHistory();
} } else {
}) AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
.catchError((err) { }
print(err); }).catchError((err) {
}) print(err);
.showProgressBar( GifLoaderDialogUtils.hideDialog(context);
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) });
.then((value) {
getPatientAppointmentHistory();
});
} }
} }

@ -24,7 +24,7 @@ class _PaymentDialogState extends State<PaymentDialog> {
shape: shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container( child: Container(
height: 510.0, height: 550.0,
width: 450.0, width: 450.0,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

@ -191,7 +191,7 @@ class _TodoListCardState extends State<TodoListCard> {
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
color: Colors.red[600], color: new Color(0xFF40ACC9),
decoration: TextDecoration.underline)), decoration: TextDecoration.underline)),
), ),
), ),

@ -179,8 +179,7 @@ class _AddMember extends State<AddMember> {
request.regionID = 1; request.regionID = 1;
} }
loading(true); loading(true);
this familyFileProvider
.familyFileProvider
.insertNewMember(request) .insertNewMember(request)
.then((value) => sendActivationCode(value)); .then((value) => sendActivationCode(value));
} }
@ -189,8 +188,7 @@ class _AddMember extends State<AddMember> {
// var request = this.getCommonRequest(); // var request = this.getCommonRequest();
loading(true); loading(true);
patientShareRequestID = result['PatientShareRequestID']; patientShareRequestID = result['PatientShareRequestID'];
this familyFileProvider
.familyFileProvider
.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text) .sendActivationCode(mobileNo, countryCode, nationalIDorFile.text)
.then((result) => { .then((result) => {
if (result != null && result['isSMSSent'] == true) if (result != null && result['isSMSSent'] == true)
@ -203,11 +201,13 @@ class _AddMember extends State<AddMember> {
startSMSService(type, result) { startSMSService(type, result) {
loading(false); loading(false);
new SMSOTP( SMSOTP(
context, context,
type, type,
this.mobileNo, mobileNo,
(value) => {this.checkActivationCode(value, result)}, (value) {
this.checkActivationCode(value, result);
},
() => { () => {
print('Faild..'), print('Faild..'),
}, },
@ -215,8 +215,7 @@ class _AddMember extends State<AddMember> {
} }
checkActivationCode(value, result) { checkActivationCode(value, result) {
this familyFileProvider
.familyFileProvider
.checkActivationCode( .checkActivationCode(
result['LogInTokenID'], value, nationalIDorFile.text, mobileNo) result['LogInTokenID'], value, nationalIDorFile.text, mobileNo)
.then((result) => { .then((result) => {
@ -226,8 +225,7 @@ class _AddMember extends State<AddMember> {
} }
handleFamilyRequests(id, stauts) { handleFamilyRequests(id, stauts) {
this familyFileProvider
.familyFileProvider
.acceptAndRejectRecievedRequests(id, stauts) .acceptAndRejectRecievedRequests(id, stauts)
.then((result) => { .then((result) => {
sharedPref.remove(FAMILY_FILE), sharedPref.remove(FAMILY_FILE),

@ -19,7 +19,7 @@ class InsuranceCard extends StatefulWidget {
@override @override
_InsuranceCardState createState() => _InsuranceCardState(); _InsuranceCardState createState() => _InsuranceCardState();
} }
//TODO fix it
class _InsuranceCardState extends State<InsuranceCard> { class _InsuranceCardState extends State<InsuranceCard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -29,6 +29,7 @@ class _InsuranceCardState extends State<InsuranceCard> {
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
image: 'assets/images/medical/insurance_card_icon.png',
appBarTitle: TranslationBase.of(context).insuranceCards, appBarTitle: TranslationBase.of(context).insuranceCards,
body: Container( body: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(

@ -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),

File diff suppressed because it is too large Load Diff

@ -3,6 +3,7 @@ import 'dart:typed_data';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
@ -18,8 +19,12 @@ import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/slide_up_page.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -29,6 +34,7 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart'; import 'package:rxdart/rxdart.dart';
import '../../locator.dart';
import 'home_page.dart'; import 'home_page.dart';
class LandingPage extends StatefulWidget { class LandingPage extends StatefulWidget {
@ -44,6 +50,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
int currentTab = 0; int currentTab = 0;
PageController pageController; PageController pageController;
ProjectViewModel projectProvider; ProjectViewModel projectProvider;
///inject the user data
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
final authService = new AuthProvider(); final authService = new AuthProvider();
var event = RobotProvider(); var event = RobotProvider();
@ -123,7 +133,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
AppGlobal.context = context; AppGlobal.context = context;
}); });
_requestIOSPermissions(); _requestIOSPermissions();
pageController = PageController(keepPage: true); pageController = PageController(keepPage: true);
// _firebaseMessaging.setAutoInitEnabled(true); // _firebaseMessaging.setAutoInitEnabled(true);
// //
// if (Platform.isIOS) { // if (Platform.isIOS) {
@ -141,119 +151,119 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// }); // });
//_firebase Background message handler //_firebase Background message handler
// _firebaseMessaging.configure( // _firebaseMessaging.configure(
// onMessage: (Map<String, dynamic> message) async { // onMessage: (Map<String, dynamic> message) async {
// showDialog("onMessage: $message"); // showDialog("onMessage: $message");
// print("onMessage: $message"); // print("onMessage: $message");
// print(message); // print(message);
// print(message['name']); // print(message['name']);
// print(message['appointmentdate']); // print(message['appointmentdate']);
// //
// if (Platform.isIOS) { // if (Platform.isIOS) {
// if (message['is_call'] == "true") { // if (message['is_call'] == "true") {
// var route = ModalRoute.of(context); // var route = ModalRoute.of(context);
// //
// if (route != null) { // if (route != null) {
// print(route.settings.name); // print(route.settings.name);
// } // }
// //
// Map<String, dynamic> myMap = new Map<String, dynamic>.from(message); // Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// print(myMap); // print(myMap);
// LandingPage.isOpenCallPage = true; // LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) { // if (!isPageNavigated) {
// isPageNavigated = true; // isPageNavigated = true;
// Navigator.push( // Navigator.push(
// context, // context,
// MaterialPageRoute( // MaterialPageRoute(
// builder: (context) => IncomingCall( // builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData))) // incomingCallData: LandingPage.incomingCallData)))
// .then((value) { // .then((value) {
// isPageNavigated = false; // isPageNavigated = false;
// }); // });
// } // }
// } else { // } else {
// print("Is Call Not Found iOS"); // print("Is Call Not Found iOS");
// } // }
// } else { // } else {
// print("Is Call Not Found iOS"); // print("Is Call Not Found iOS");
// } // }
// //
// if (Platform.isAndroid) { // if (Platform.isAndroid) {
// if (message['data'].containsKey("is_call")) { // if (message['data'].containsKey("is_call")) {
// var route = ModalRoute.of(context); // var route = ModalRoute.of(context);
// //
// if (route != null) { // if (route != null) {
// print(route.settings.name); // print(route.settings.name);
// } // }
// //
// Map<String, dynamic> myMap = // Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message['data']); // new Map<String, dynamic>.from(message['data']);
// print(myMap); // print(myMap);
// LandingPage.isOpenCallPage = true; // LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) { // if (!isPageNavigated) {
// isPageNavigated = true; // isPageNavigated = true;
// Navigator.push( // Navigator.push(
// context, // context,
// MaterialPageRoute( // MaterialPageRoute(
// builder: (context) => IncomingCall( // builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData))) // incomingCallData: LandingPage.incomingCallData)))
// .then((value) { // .then((value) {
// isPageNavigated = false; // isPageNavigated = false;
// }); // });
// } // }
// } else { // } else {
// print("Is Call Not Found Android"); // print("Is Call Not Found Android");
// } // }
// } else { // } else {
// print("Is Call Not Found Android"); // print("Is Call Not Found Android");
// } // }
// }, // },
// onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// onLaunch: (Map<String, dynamic> message) async { // onLaunch: (Map<String, dynamic> message) async {
// print("onLaunch: $message"); // print("onLaunch: $message");
// showDialog("onLaunch: $message"); // showDialog("onLaunch: $message");
// }, // },
// onResume: (Map<String, dynamic> message) async { // onResume: (Map<String, dynamic> message) async {
// print("onResume: $message"); // print("onResume: $message");
// print(message); // print(message);
// print(message['name']); // print(message['name']);
// print(message['appointmentdate']); // print(message['appointmentdate']);
// //
// showDialog("onResume: $message"); // showDialog("onResume: $message");
// //
// if (Platform.isIOS) { // if (Platform.isIOS) {
// if (message['is_call'] == "true") { // if (message['is_call'] == "true") {
// var route = ModalRoute.of(context); // var route = ModalRoute.of(context);
// //
// if (route != null) { // if (route != null) {
// print(route.settings.name); // print(route.settings.name);
// } // }
// //
// Map<String, dynamic> myMap = // Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message); // new Map<String, dynamic>.from(message);
// print(myMap); // print(myMap);
// LandingPage.isOpenCallPage = true; // LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) { // if (!isPageNavigated) {
// isPageNavigated = true; // isPageNavigated = true;
// Navigator.push( // Navigator.push(
// context, // context,
// MaterialPageRoute( // MaterialPageRoute(
// builder: (context) => IncomingCall( // builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData))) // incomingCallData: LandingPage.incomingCallData)))
// .then((value) { // .then((value) {
// isPageNavigated = false; // isPageNavigated = false;
// }); // });
// } // }
// } else { // } else {
// print("Is Call Not Found iOS"); // print("Is Call Not Found iOS");
// } // }
// } else { // } else {
// print("Is Call Not Found iOS"); // print("Is Call Not Found iOS");
// } // }
// }, // },
// ); // );
} }
@ -329,56 +339,59 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// projectProvider = Provider.of(context); // projectProvider = Provider.of(context);
// checkValue(projectProvider); // checkValue(projectProvider);
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
textTheme: TextTheme( textTheme: TextTheme(
headline6: headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold), TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
), ),
title: Text(getText(currentTab).toUpperCase()), title: Texts(getText(currentTab).toUpperCase(),bold: true,color: Colors.white,),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return IconButton( return IconButton(
icon: Icon(Icons.menu), icon: Icon(Icons.menu),
color: Colors.white, color: Colors.white,
onPressed: () => Scaffold.of(context).openDrawer(), onPressed: () => Scaffold.of(context).openDrawer(),
); );
},
),
actions: [
// IconButton(
// iconSize: 70,
// icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
// height: 100, width: 100, fit: BoxFit.cover),
// onPressed: () {
// triggerRobot();
// } //do something,
// )
],
centerTitle: true,
),
drawer: SafeArea(child: AppDrawer()),
extendBody: true,
body: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: [
HomePage(
goToMyProfile: () {
_changeCurrentTab(1);
}, },
), ),
MedicalProfilePage(), actions: [
MyAdmissionsPage(), // IconButton(
ToDo(), // iconSize: 70,
BookingOptions() // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
], // Please do not remove the BookingOptions from this array // height: 100, width: 100, fit: BoxFit.cover),
), // onPressed: () {
bottomNavigationBar: BottomNavBar( // triggerRobot();
changeIndex: _changeCurrentTab, // } //do something,
index: currentTab, // )
), ],
); centerTitle: true,
),
drawer: SafeArea(child: AppDrawer()),
extendBody: true,
body: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: [
HomePage(goToMyProfile: () {_changeCurrentTab(1);},),
MedicalProfilePage(),
BookingOptions(),
Container(),
ToDo(),
], // Please do not remove the BookingOptions from this array
),
bottomNavigationBar: BottomNavBar(
changeIndex: _changeCurrentTab,
index: currentTab,
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: currentTab == 0
? FloatingButton(
elevation: true,
onTap: () {
_changeCurrentTab(2);
})
: null);
} }
triggerRobot() { triggerRobot() {
@ -392,11 +405,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
case 1: case 1:
return TranslationBase.of(context).medicalProfile; return TranslationBase.of(context).medicalProfile;
case 2: case 2:
return TranslationBase.of(context).mySchedule; return TranslationBase.of(context).bookAppo;
case 3: case 3:
return TranslationBase.of(context).services; return TranslationBase.of(context).myFamily;
case 4: case 4:
return TranslationBase.of(context).bookAppo; return TranslationBase.of(context).services;
} }
} }

@ -4,20 +4,20 @@ import 'package:diplomaticquarterapp/models/Authentication/check_activation_code
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart';
import 'package:diplomaticquarterapp/routes.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/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.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/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
@ -73,173 +73,165 @@ class _ConfirmLogin extends State<ConfirmLogin> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).confirm, appBarTitle: TranslationBase.of(context).confirm,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
height: SizeConfig.realScreenHeight * .9, height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 3, flex: 3,
child: user != null && isMoreOption == false child: user != null && isMoreOption == false
? Column( ? Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceEvenly,
MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ Image.asset(
Image.asset( 'assets/images/DQ/dq_logo_icon.png',
'assets/images/habib-logo.png', height: 90,
height: 80, width: 90,
width: 80, ),
), AppText(
AppText( TranslationBase.of(context).welcomeBack +
TranslationBase.of(context).welcomeBack + ' ' +
' ' + user.name,
user.name, fontSize: SizeConfig.textMultiplier * 3.5,
fontSize: SizeConfig.textMultiplier * 3.5, ),
), AppText(
AppText( TranslationBase.of(context).accountInfo,
TranslationBase.of(context).accountInfo, fontSize: SizeConfig.textMultiplier * 2.5,
fontSize: SizeConfig.textMultiplier * 2.5, ),
), Card(
Card( color: Colors.grey[300],
color: Colors.grey[300], child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: ListTile(
child: ListTile( title: Text(
title: Text( TranslationBase.of(context).lastLoginAt,
TranslationBase.of(context) textAlign: TextAlign.center,
.lastLoginAt, ),
textAlign: TextAlign.center, subtitle: Text(
), user.editedOn != null
subtitle: Text( ? formatDate(
user.editedOn != null DateUtil.convertStringToDate(
? formatDate(DateUtil user.editedOn))
.convertStringToDate( : '--',
user.editedOn)) textAlign: TextAlign.center),
: '--', )),
textAlign: TextAlign.center), Expanded(
)), child: ListTile(
Expanded( title: Text(
child: ListTile( TranslationBase.of(context)
title: Text( .lastLoginWith,
TranslationBase.of(context) textAlign: TextAlign.center),
.lastLoginWith, subtitle: Text(
textAlign: TextAlign.center), getType(user.logInType, context),
subtitle: Text( textAlign: TextAlign.center),
getType( ))
user.logInType, context), ],
textAlign: TextAlign.center), ))
)) ],
], )
)) : Column(
], mainAxisAlignment: MainAxisAlignment.spaceEvenly,
) crossAxisAlignment: CrossAxisAlignment.start,
: Column( children: <Widget>[
mainAxisAlignment: Image.asset(
MainAxisAlignment.spaceEvenly, 'assets/images/DQ/dq_logo_icon.png',
crossAxisAlignment: CrossAxisAlignment.start, height: 90,
children: <Widget>[ width: 90,
Image.asset( ),
'assets/images/habib-logo.png', this.onlySMSBox == false
height: 80, ? AppText(
width: 80, TranslationBase.of(context)
.verifyLoginWith,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
)
: AppText(
TranslationBase.of(context)
.verifyFingerprint2,
fontSize: SizeConfig.textMultiplier * 2.5,
textAlign: TextAlign.start,
), ),
this.onlySMSBox == false ])),
? AppText( user != null && isMoreOption == false
TranslationBase.of(context) ? Expanded(
.verifyLoginWith, flex: 2,
fontSize: child: Column(
SizeConfig.textMultiplier * 3.5, mainAxisAlignment: MainAxisAlignment.start,
textAlign: TextAlign.left, crossAxisAlignment: CrossAxisAlignment.start,
) children: <Widget>[
: AppText( Row(
TranslationBase.of(context) mainAxisAlignment: MainAxisAlignment.center,
.verifyFingerprint2,
fontSize:
SizeConfig.textMultiplier * 2.5,
textAlign: TextAlign.left,
),
])),
user != null && isMoreOption == false
? Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: InkWell(
onTap: () => {
authenticateUser(
3,
BiometricType
.face.index)
},
child:
getButton(user.logInType))),
Expanded(child: getButton(5))
])
]))
: Expanded(
flex: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
onlySMSBox == false Expanded(
? Row( child: InkWell(
mainAxisAlignment: onTap: () => {
MainAxisAlignment.center, authenticateUser(
children: <Widget>[ 3, BiometricType.face.index)
Expanded(child: getButton(3)), },
Expanded(child: getButton(2)) child: getButton(user.logInType))),
], Expanded(child: getButton(5))
) ])
: SizedBox(), ]))
Row( : Expanded(
mainAxisAlignment: MainAxisAlignment.center, flex: 4,
children: <Widget>[ child: Column(
Expanded(child: getButton(1)), mainAxisAlignment: MainAxisAlignment.start,
Expanded(child: getButton(4)) crossAxisAlignment: CrossAxisAlignment.start,
],
),
]),
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
user != null onlySMSBox == false
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(child: getButton(3)),
child: DefaultButton( Expanded(child: getButton(2))
TranslationBase.of(context)
.useAnotherAccount,
() => {
Navigator.of(context).pushNamed(
LOGIN_TYPE,
)
},
)),
], ],
) )
: SizedBox(), : SizedBox(),
], Row(
)) mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(child: getButton(1)),
Expanded(child: getButton(4))
],
),
]),
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
user != null
? Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).useAnotherAccount,
() => {
Navigator.of(context).pushNamed(
LOGIN_TYPE,
)
},
)),
],
)
: SizedBox(),
], ],
)))); ),
)
],
),
),
),
);
} }
Future<void> _getAvailableBiometrics() async { Future<void> _getAvailableBiometrics() async {
@ -301,6 +293,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
showLoader(true); showLoader(true);
var req = getCommonRequest(); var req = getCommonRequest();
var request = CheckPatientAuthenticationReq.fromJson(req.toJson()); var request = CheckPatientAuthenticationReq.fromJson(req.toJson());
GifLoaderDialogUtils.showMyDialog(context);
sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
authService authService
@ -322,19 +315,23 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}) })
.catchError((err) { .catchError((err) {
print(err); print(err);
}).showProgressBar( GifLoaderDialogUtils.hideDialog(context);
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
} }
sendActivationCode(type) async { sendActivationCode(type) async {
var request = this.getCommonRequest(); var request = this.getCommonRequest();
// loading(true); // loading(true);
GifLoaderDialogUtils.showMyDialog(context);
await this.authService.sendActivationCode(request).then((result) => { await this.authService.sendActivationCode(request).then((result) {
if (result != null && result['isSMSSent'] == true) GifLoaderDialogUtils.hideDialog(context);
{this.startSMSService(type)} if (result != null && result['isSMSSent'] == true) {
}); this.startSMSService(type);
}
}).catchError((r) {
GifLoaderDialogUtils.hideDialog(context);
});
// SMSOTP.showLoadingDialog(context, false), // SMSOTP.showLoadingDialog(context, false),
} }
@ -410,7 +407,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
print(err); print(err);
}).showProgressBar( }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
;
} }
setUser() async {} setUser() async {}
@ -482,11 +478,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
checkActivationCode({value}) async { checkActivationCode({value}) async {
SMSOTP.showLoadingDialog(context, true); GifLoaderDialogUtils.showMyDialog(context);
var request = this.getCommonRequest().toJson(); var request = this.getCommonRequest().toJson();
this authService
.authService
.checkActivationCode(request, value) .checkActivationCode(request, value)
.then((result) => { .then((result) => {
if (result is Map) if (result is Map)
@ -501,25 +496,20 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
else else
{ {
this.userData = result userData = result.list,
.list, //AuthenticatedUser.fromJson(result['List'][0]), //AuthenticatedUser.fromJson(result['List'][0]),
this.sharedPref.setObject(USER_PROFILE, result.list), sharedPref.setObject(USER_PROFILE, result.list),
this.loginTokenID = result.logInTokenID, loginTokenID = result.logInTokenID,
this sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
.sharedPref sharedPref.setString(TOKEN, result.authenticationTokenID),
.setObject(LOGIN_TOKEN_ID, result.logInTokenID), checkIfUserAgreedBefore(result),
this
.sharedPref
.setString(TOKEN, result.authenticationTokenID),
this.checkIfUserAgreedBefore(result),
// Navigator.of(context).pop(),
SMSOTP.showLoadingDialog(context, false),
} }
} }
else else
{ {
// Navigator.of(context).pop(), // Navigator.of(context).pop(),
SMSOTP.showLoadingDialog(context, false), GifLoaderDialogUtils.hideDialog(context),
Future.delayed(Duration(seconds: 1), () { Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: result); AppToast.showErrorToast(message: result);
}), }),
@ -527,9 +517,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}) })
.catchError((err) { .catchError((err) {
print(err); print(err);
}).showProgressBar( GifLoaderDialogUtils.hideDialog(context);
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); });
;
} }
checkIfUserAgreedBefore(CheckActivationCode result) { checkIfUserAgreedBefore(CheckActivationCode result) {

@ -1,6 +1,9 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.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/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
@ -15,11 +18,12 @@ class ForgotPassword extends StatefulWidget {
class _ForgotPassword extends State<ForgotPassword> { class _ForgotPassword extends State<ForgotPassword> {
String selectedType = 'Saudi Arabia'; String selectedType = 'Saudi Arabia';
final TextEditingController nationalIDorFile = null; final TextEditingController nationalIDorFile = null;
final TextEditingController mobileNo = null; final TextEditingController mobileNo = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).forgotPassword, appBarTitle: TranslationBase.of(context).forgotFileNoTitle,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
@ -32,8 +36,9 @@ class _ForgotPassword extends State<ForgotPassword> {
flex: 1, flex: 1,
child: AppText( child: AppText(
TranslationBase.of(context).forgotDesc, TranslationBase.of(context).forgotDesc,
fontSize: SizeConfig.textMultiplier * 3.5, fontSize: SizeConfig.textMultiplier * 3,
textAlign: TextAlign.left, textAlign: TextAlign.start,
marginTop: 10.0,
)), )),
Expanded( Expanded(
flex: 2, flex: 2,
@ -43,29 +48,29 @@ class _ForgotPassword extends State<ForgotPassword> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Expanded( // Expanded(
// add Expanded to have your dropdown button fill remaining space // // add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline( // child: DropdownButtonHideUnderline(
child: DropdownButton( // child: DropdownButton(
isExpanded: true, // isExpanded: true,
value: selectedType, // value: selectedType,
iconSize: 40, // iconSize: 40,
elevation: 16, // elevation: 16,
onChanged: (String newValue) => { // onChanged: (String newValue) => {
setState(() { // setState(() {
selectedType = newValue; // selectedType = newValue;
}) // })
}, // },
items: <String>[ // items: <String>[
'Saudi Arabia', // 'Saudi Arabia',
'Dubai', // 'Dubai',
].map<DropdownMenuItem<String>>( // ].map<DropdownMenuItem<String>>(
(String value) { // (String value) {
return DropdownMenuItem<String>( // return DropdownMenuItem<String>(
value: value, // value: value,
child: Text(value), // child: Text(value),
); // );
}).toList()))), // }).toList()))),
], ],
), ),
MobileNo(controller: mobileNo), MobileNo(controller: mobileNo),
@ -80,12 +85,13 @@ class _ForgotPassword extends State<ForgotPassword> {
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: RaisedButton( child: DefaultButton(
color: Colors.grey, TranslationBase.of(context).submit,
textColor: Colors.white, () {
child: Text(TranslationBase.of(context).submit), sendPatientIDBySMS();
onPressed: () => {}, // print(mobileNo.text);
)) },
)),
], ],
), ),
], ],
@ -93,4 +99,21 @@ class _ForgotPassword extends State<ForgotPassword> {
]), ]),
))); )));
} }
sendPatientIDBySMS() {
GifLoaderDialogUtils.showMyDialog(context);
final authService = new AuthProvider();
authService.sendPatientIDSMS(mobileNo.text, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
@ -6,7 +7,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/routes.dart';
class LoginType extends StatelessWidget { class LoginType extends StatelessWidget {
static int loginType = 0; static int loginType = 0;
@ -28,14 +28,16 @@ class LoginType extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/habib-logo.png', 'assets/images/DQ/dq_logo_icon.png',
height: 80, height: 90,
width: 80, width: 90,
), ),
AppText( AppText(
TranslationBase.of(context).logintypeRadio, TranslationBase.of(context).logintypeRadio,
fontSize: SizeConfig.textMultiplier * 3.5, fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left, textAlign: TextAlign.start,
marginBottom: 20.0,
marginTop: 20.0,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -75,6 +77,7 @@ class LoginType extends StatelessWidget {
fontSize: fontSize:
SizeConfig.textMultiplier * SizeConfig.textMultiplier *
2, 2,
fontWeight: FontWeight.bold,
) )
], ],
), ),
@ -112,6 +115,7 @@ class LoginType extends StatelessWidget {
fontSize: fontSize:
SizeConfig.textMultiplier * SizeConfig.textMultiplier *
2, 2,
fontWeight: FontWeight.bold,
) )
], ],
), ),
@ -131,7 +135,7 @@ class LoginType extends StatelessWidget {
child: AppText( child: AppText(
TranslationBase.of(context).forgotPassword, TranslationBase.of(context).forgotPassword,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
margin: 10, marginTop: 20.0,
underline: true))) underline: true)))
]), ]),
), ),
@ -150,7 +154,7 @@ class LoginType extends StatelessWidget {
REGISTER, REGISTER,
) )
}, },
)) )),
], ],
), ),
], ],

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doct
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.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/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/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
@ -23,6 +24,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
class Login extends StatefulWidget { class Login extends StatefulWidget {
@override @override
_Login createState() => _Login(); _Login createState() => _Login();
@ -41,8 +43,8 @@ class _Login extends State<Login> {
AppointmentRateViewModel appointmentRateViewModel = AppointmentRateViewModel appointmentRateViewModel =
locator<AppointmentRateViewModel>(); locator<AppointmentRateViewModel>();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@override @override
void initState() { void initState() {
@ -59,73 +61,76 @@ class _Login extends State<Login> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).login, appBarTitle: TranslationBase.of(context).login,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
padding: padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), height: SizeConfig.realScreenHeight * .9,
height: SizeConfig.realScreenHeight * .9, width: SizeConfig.realScreenWidth,
width: SizeConfig.realScreenWidth, child: Column(
child: Column(children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 2, flex: 2,
child: AppText( child: AppText(
TranslationBase.of(context).enterNationalId, TranslationBase.of(context).enterNationalId,
fontSize: SizeConfig.textMultiplier * 3.5, fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left, textAlign: TextAlign.start,
)), )),
Expanded( Expanded(
flex: 3, flex: 3,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
MobileNo( MobileNo(
onNumberChange: (value) => onNumberChange: (value) =>
{mobileNo = value, validateForm()}, {mobileNo = value, validateForm()},
onCountryChange: (value) => countryCode = value), onCountryChange: (value) => countryCode = value),
Container( Container(
child: TextFields( child: TextFields(
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
controller: nationalIDorFile, controller: nationalIDorFile,
onChanged: (value) => {validateForm()}, onChanged: (value) => {validateForm()},
prefixIcon: Icon( prefixIcon: Icon(
loginType == 1 loginType == 1
? Icons.chrome_reader_mode ? Icons.chrome_reader_mode
: Icons.receipt, : Icons.receipt,
color: Colors.red), color: Color(0xFF40ACC9)),
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10), top: 20, bottom: 20, left: 10, right: 10),
hintText: loginType == 1 hintText: loginType == 1
? TranslationBase.of(context).nationalID ? TranslationBase.of(context).nationalID
: TranslationBase.of(context).fileNo, : TranslationBase.of(context).fileNo,
)) ))
], ],
), ),
), ),
Expanded( Expanded(
flex: 3, flex: 3,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Row(
children: <Widget>[ children: <Widget>[
Row( Expanded(
children: <Widget>[ child: DefaultButton(
Expanded( TranslationBase.of(context).login,
child: DefaultButton( () => {this.startLogin()},
TranslationBase.of(context).login, color: isButtonDisabled == true
() => {this.startLogin()}, ? Colors.grey
color: isButtonDisabled == true : Colors.grey[900],
? Colors.grey textColor: Colors.white,
: Colors.grey[900], ))
textColor: Colors.white,
))
],
),
], ],
)) ),
]), ],
))); ))
],
),
),
),
);
} }
startLogin() { startLogin() {
@ -136,8 +141,10 @@ class _Login extends State<Login> {
void validateForm() { void validateForm() {
//TODO fix login //TODO fix login
if (util.validateIDBox(nationalIDorFile.text, loginType) == true && if (util.validateIDBox(nationalIDorFile.text, loginType) ==
mobileNo.length >= 9 && true /*&&
mobileNo.length >= 9 */
&&
util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) {
setState(() { setState(() {
isButtonDisabled = false; isButtonDisabled = false;
@ -150,7 +157,7 @@ class _Login extends State<Login> {
} }
checkUserAuthentication() { checkUserAuthentication() {
// showLoader(true); // showLoader(true);
var request = CheckPatientAuthenticationReq(); var request = CheckPatientAuthenticationReq();
request.isRegister = false; request.isRegister = false;
request.patientMobileNumber = int.parse(mobileNo); request.patientMobileNumber = int.parse(mobileNo);
@ -165,22 +172,27 @@ class _Login extends State<Login> {
request.patientID = int.parse(nationalIDorFile.text); request.patientID = int.parse(nationalIDorFile.text);
} }
sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
authService.checkPatientAuthentication(request).then((value) => { GifLoaderDialogUtils.showMyDialog(context);
//showLoader(false), authService
if (value['isSMSSent']) .checkPatientAuthentication(request)
{ .then((value) => {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), //showLoader(false),
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request), if (value['isSMSSent'])
Navigator.of(context).pushNamed(CONFIRM_LOGIN) {
} sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
else sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request),
{ GifLoaderDialogUtils.hideDialog(context),
if (value['IsAuthenticated']) {this.checkActivationCode()} Navigator.of(context).pushNamed(CONFIRM_LOGIN)
} }
}).catchError((err) { else
{
if (value['IsAuthenticated']) {this.checkActivationCode()}
}
})
.catchError((err) {
print(err); print(err);
}).showProgressBar( GifLoaderDialogUtils.hideDialog(context);
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); });
// SMSOTP.showLoadingDialog(context, false), // SMSOTP.showLoadingDialog(context, false),
} }
@ -191,7 +203,7 @@ class _Login extends State<Login> {
// request.isSilentLogin = code != null ? false : true; // request.isSilentLogin = code != null ? false : true;
if (code == null) if (code == null)
//showLoader(true); //showLoader(true);
request['PatientMobileNumber'] = int.parse(mobileNo); request['PatientMobileNumber'] = int.parse(mobileNo);
request['ZipCode'] = countryCode; request['ZipCode'] = countryCode;
request['SearchType'] = loginType; request['SearchType'] = loginType;
request['LoginType'] = loginType; request['LoginType'] = loginType;
@ -205,47 +217,45 @@ class _Login extends State<Login> {
// request.isRegister = false; // request.isRegister = false;
this.authService.checkActivationCode(request, code).then((result) => { this.authService.checkActivationCode(request, code).then((result) => {
result = CheckActivationCode.fromJson(result), result = CheckActivationCode.fromJson(result),
authenticatedUserObject.getUser(), authenticatedUserObject.getUser(),
this.sharedPref.setObject(USER_PROFILE, result.list), this.sharedPref.setObject(USER_PROFILE, result.list),
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
this.sharedPref.setString(TOKEN, result.authenticationTokenID), this.sharedPref.setString(TOKEN, result.authenticationTokenID),
//this.checkIfUserAgreedBefore(result),
Navigator.of(context).pushNamed(
HOME,
),
//showLoader(false),
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {
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) { })
print(err); .catchError((err) {
}).showProgressBar( print(err);
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) GifLoaderDialogUtils.hideDialog(context);
}),
// SMSOTP.showLoadingDialog(context, false), // SMSOTP.showLoadingDialog(context, false),
}); });
} }
// showLoader(bool isTrue) { // showLoader(bool isTrue) {
// setState(() { // setState(() {
// isLoading = isTrue; // isLoading = isTrue;
// }); // });
// } // }
} }

@ -6,14 +6,10 @@ import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.
import 'package:diplomaticquarterapp/pages/login/login-type.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/app_toast.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/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -40,12 +36,15 @@ class _RegisterInfo extends State<RegisterInfo> {
new Language(name: 'English', value: '2'), new Language(name: 'English', value: '2'),
new Language(name: 'Arabic', value: '1'), new Language(name: 'Arabic', value: '1'),
]; ];
var email =''; var email = '';
var location; var location;
@override @override
void initState() { void initState() {
getRegisterInfo(); WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getRegisterInfo();
});
super.initState(); super.initState();
} }
@ -243,7 +242,6 @@ class _RegisterInfo extends State<RegisterInfo> {
getRegisterInfo() async { getRegisterInfo() async {
var data = var data =
RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA));
if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) { if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) {
var data2 = CheckPatientAuthenticationReq.fromJson( var data2 = CheckPatientAuthenticationReq.fromJson(
await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN));
@ -253,7 +251,7 @@ class _RegisterInfo extends State<RegisterInfo> {
this.registerd_data = data2; this.registerd_data = data2;
}); });
} }
} }
getTempUserRequest() { getTempUserRequest() {

@ -76,7 +76,7 @@ class _Register extends State<Register> {
controller: nationalIDorFile, controller: nationalIDorFile,
onChanged: (value) => validateForm(), onChanged: (value) => validateForm(),
prefixIcon: prefixIcon:
Icon(Icons.chrome_reader_mode, color: Colors.red), Icon(Icons.chrome_reader_mode, color: Color(0xFF40ACC9)),
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10), top: 20, bottom: 20, left: 10, right: 10),
hintText: TranslationBase.of(context).nationalID, hintText: TranslationBase.of(context).nationalID,

@ -1,15 +1,10 @@
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/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/routes.dart';
class WelcomeLogin extends StatefulWidget { class WelcomeLogin extends StatefulWidget {
@override @override
@ -18,6 +13,7 @@ class WelcomeLogin extends StatefulWidget {
class _WelcomeLogin extends State<WelcomeLogin> { class _WelcomeLogin extends State<WelcomeLogin> {
bool isLoading = true; bool isLoading = true;
@override @override
void initState() { void initState() {
isLoading = true; isLoading = true;
@ -40,25 +36,23 @@ class _WelcomeLogin extends State<WelcomeLogin> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset('assets/images/DQ/dq_logo_icon.png',
'assets/images/habib-logo.png', height: 90, width: 90),
height: 80,
width: 80,
),
Text( Text(
TranslationBase.of(context).welcome, TranslationBase.of(context).welcome,
style: TextStyle(fontSize: 30), style: TextStyle(
textAlign: TextAlign.left, fontSize: 30, fontWeight: FontWeight.bold),
textAlign: TextAlign.start,
), ),
Text( Text(
TranslationBase.of(context).welcomeText, TranslationBase.of(context).welcomeText,
style: TextStyle(fontSize: 24), style: TextStyle(fontSize: 24),
textAlign: TextAlign.left, textAlign: TextAlign.start,
), ),
Text( Text(
TranslationBase.of(context).welcomeText2, TranslationBase.of(context).welcomeText2,
style: TextStyle(fontSize: 24), style: TextStyle(fontSize: 24),
textAlign: TextAlign.left, textAlign: TextAlign.start,
), ),
SizedBox( SizedBox(
height: SizeConfig.realScreenHeight * .15, height: SizeConfig.realScreenHeight * .15,
@ -81,7 +75,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
LOGIN_TYPE, LOGIN_TYPE,
), ),
}, },
color: Colors.red[900], color: Color(0xFF40ACC9),
textColor: Colors.white, textColor: Colors.white,
)) ))
], ],

@ -45,7 +45,7 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
leading: Radio( leading: Radio(
value: BeneficiaryType.MyAccount, value: BeneficiaryType.MyAccount,
groupValue: beneficiaryType, groupValue: beneficiaryType,
activeColor: Colors.red[800], activeColor: Color(0xFF40ACC9),
onChanged: (BeneficiaryType value) { onChanged: (BeneficiaryType value) {
setState(() { setState(() {
beneficiaryType = value; beneficiaryType = value;
@ -75,7 +75,7 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
leading: Radio( leading: Radio(
value: BeneficiaryType.MyFamilyFiles, value: BeneficiaryType.MyFamilyFiles,
groupValue: beneficiaryType, groupValue: beneficiaryType,
activeColor: Colors.red[800], activeColor: Color(0xFF40ACC9),
onChanged: (BeneficiaryType value) { onChanged: (BeneficiaryType value) {
setState(() { setState(() {
beneficiaryType = value; beneficiaryType = value;
@ -105,7 +105,7 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
leading: Radio( leading: Radio(
value: BeneficiaryType.OtherAccount, value: BeneficiaryType.OtherAccount,
groupValue: beneficiaryType, groupValue: beneficiaryType,
activeColor: Colors.red[800], activeColor: Color(0xFF40ACC9),
onChanged: (BeneficiaryType value) { onChanged: (BeneficiaryType value) {
setState(() { setState(() {
beneficiaryType = value; beneficiaryType = value;

@ -54,7 +54,7 @@ class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
leading: Radio( leading: Radio(
value: widget.hospitals[index], value: widget.hospitals[index],
groupValue: widget.selectedHospital, groupValue: widget.selectedHospital,
activeColor: Colors.red[800], activeColor: Color(0xFF40ACC9),
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
widget.selectedHospital = value; widget.selectedHospital = 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}',

@ -1,41 +1,29 @@
import 'dart:math'; import 'package:badges/badges.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/medical_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/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.dart';
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart';
import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_widget.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';
import 'package:diplomaticquarterapp/widgets/others/sliver_app_bar_delegate.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../locator.dart';
import 'active_medications/ActiveMedicationsPage.dart';
import 'allergies_page.dart'; import 'allergies_page.dart';
import 'ask_doctor/ask_doctor_home_page.dart';
import 'balance/my_balance_page.dart';
import 'doctor/doctor_home_page.dart'; import 'doctor/doctor_home_page.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'eye/EyeHomePage.dart';
import 'eye/EyeMeasurementsPage.dart';
import 'labs/labs_home_page.dart'; import 'labs/labs_home_page.dart';
import 'my_trackers/my_trackers.dart';
class MedicalProfilePage extends StatefulWidget { class MedicalProfilePage extends StatefulWidget {
@override @override
@ -43,9 +31,12 @@ class MedicalProfilePage extends StatefulWidget {
} }
class _MedicalProfilePageState extends State<MedicalProfilePage> { class _MedicalProfilePageState extends State<MedicalProfilePage> {
var authProvider = new AuthProvider();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(), onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
@ -62,31 +53,27 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Container( Container(
width: double.infinity, width: double.infinity,
height: 210, height: 210,
decoration: BoxDecoration(
image: DecorationImage(
image: ExactAssetImage(
'assets/images/timeline_bg.png'),
fit: BoxFit.cover),
),
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/timeline_bg.png', 'assets/images/timeline_bg.png',
fit: BoxFit.cover, fit: BoxFit.cover,
width: double.infinity, width: double.infinity,
// color: Colors.black.withOpacity(0.0)
), ),
if(model.authenticatedUserObject.isLogin) if (model.authenticatedUserObject.isLogin)
ListView.builder( ListView.builder(
itemBuilder: (context, index) => TimeLineWidget( itemBuilder: (context, index) =>
isUp: index % 2 == 1, TimeLineWidget(
appoitmentAllHistoryResul: model isUp: index % 2 == 1,
.appoitmentAllHistoryResultList[index], appoitmentAllHistoryResul: model
.appoitmentAllHistoryResultList[index],
),
itemCount: model
.appoitmentAllHistoryResultList.length,
scrollDirection: Axis.horizontal,
reverse: !projectViewModel.isArabic,
), ),
itemCount:
model.appoitmentAllHistoryResultList.length,
scrollDirection: Axis.horizontal,
reverse: !projectViewModel.isArabic,
),
], ],
), ),
), ),
@ -96,7 +83,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
children: <Widget>[ children: <Widget>[
Container( Container(
width: double.infinity, width: double.infinity,
height: 30, height: 55,
), ),
Row( Row(
children: <Widget>[ children: <Widget>[
@ -111,13 +98,53 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
), ),
); );
}, },
child: MedicalProfileItem( child: authProvider.isLogin
title: TranslationBase.of(context) ? Stack(children: [
.myAppointments, MedicalProfileItem(
imagePath: 'my_appointment_icon.png', title:
subTitle: TranslationBase.of(context) TranslationBase.of(context)
.myAppointmentsList, .myAppointments,
), imagePath:
'my_appointment_icon.png',
subTitle:
TranslationBase.of(context)
.myAppointmentsList,
hasBadge: true,
),
Positioned(
right: 0.0,
child: Badge(
toAnimate: false,
position:
BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: Color(0xFF40ACC9)
.withOpacity(1.0),
borderRadius:
BorderRadius.circular(8),
badgeContent: Container(
padding:
EdgeInsets.all(2.0),
child: Text(
appoCountProvider.count
.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 16.0)),
),
),
),
])
: MedicalProfileItem(
title: TranslationBase.of(context)
.myAppointments,
imagePath:
'my_appointment_icon.png',
subTitle:
TranslationBase.of(context)
.myAppointmentsList,
hasBadge: true,
),
), ),
), ),
Expanded( Expanded(
@ -158,48 +185,52 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: HomePrescriptionsPage(), page: DoctorHomePage(),
), ),
); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context)
.medicines, .myDoctor,
imagePath: 'prescription_icon.png', imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.medicinesSubtitle, .myDoctorSubtitle,
), ),
), ),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => Navigator.push( onTap: () {
context, Navigator.push(
FadePage( context,
page: VitalSignDetailsScreen(), FadePage(
), page: HomePrescriptionsPage(),
), ),
);
},
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context)
.vitalSigns, .medicines,
imagePath: 'vital_signs.png', imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.vitalSignsSubtitle, .medicinesSubtitle,
), ),
), ),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => Navigator.push(context, onTap: () {
FadePage(page: ActiveMedicationsPage())), Navigator.push(context,
FadePage(page: InsuranceCard()));
},
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context)
.myMedical, .insurance,
imagePath: 'active_medications.png', imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.myMedicalSubtitle, .insuranceSubtitle,
), ),
), ),
), ),
@ -210,20 +241,14 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () => Navigator.push(context,
Navigator.push( FadePage(page: AllergiesPage())),
context,
FadePage(
page: DoctorHomePage(),
),
);
},
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context)
.myDoctor, .allergies,
imagePath: 'doctor_icon.png', imagePath: 'my_allergies_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.myDoctorSubtitle, .allergiesSubtitle,
), ),
), ),
), ),
@ -234,13 +259,13 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: EyeMeasurementsPage())); page: PatientSickLeavePage()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).eye, title: TranslationBase.of(context).sick,
imagePath: 'eye_measurement_icon.png', imagePath: 'sick_leaves_icons.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.eyeSubtitle, .sickSubtitle,
), ),
), ),
), ),
@ -248,83 +273,24 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(
FadePage(page: InsuranceCard())); context,
FadePage(
page: InsuranceApproval()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context)
.insurance, .insuranceApproval,
imagePath: 'insurance_card_icon.png', imagePath:
'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.insuranceSubtitle, .insuranceApprovalSubtitle,
), ),
), ),
), ),
], ],
), ),
Row(children: <Widget>[ Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: InsuranceUpdate()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.updateInsurance,
imagePath: 'insurance_update_icon_.png',
subTitle: TranslationBase.of(context)
.updateInsuranceSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: InsuranceApproval()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.insuranceApproval,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context)
.insuranceApprovalSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap:()=> Navigator.push(context, FadePage(page: AllergiesPage())) ,
child: MedicalProfileItem(
title: TranslationBase.of(context).allergies,
imagePath: 'my_allergies_icon.png',
subTitle: TranslationBase.of(context)
.allergiesSubtitle,
),
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MyVaccines()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.myVaccines,
imagePath: 'my_vaccines_icon.png',
subTitle: TranslationBase.of(context)
.myVaccinesSubtitle,
),
),
),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
@ -342,156 +308,16 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
), ),
), ),
Expanded( Expanded(
flex: 1, child: Container(),
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MonthlyReportsPage()));
},
child: MedicalProfileItem(
title:
TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png',
subTitle: TranslationBase.of(context)
.monthlySubtitle,
),
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: PatientSickLeavePage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png',
subTitle: TranslationBase.of(context)
.sickSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MyBalancePage()));
},
child: MedicalProfileItem(
title:
TranslationBase.of(context).myBalance,
imagePath: 'check-in.png',
subTitle: TranslationBase.of(context)
.myBalanceSubtitle,
),
),
),
Expanded(
flex: 1,
child: MedicalProfileItem(
title:
TranslationBase.of(context).patientCall,
imagePath: 'medical_history_icon.png',
subTitle: TranslationBase.of(context)
.patientCallSubtitle,
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
//TODO
onTap: () {
Navigator.push(
context, FadePage(page: SmartWatchInstructions()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.smartWatches,
imagePath: 'smartwatch_icon.png',
subTitle: TranslationBase.of(context)
.smartWatchesSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MyTrackers()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.myTrackers,
imagePath: 'my_tracker_icon.png',
subTitle: TranslationBase.of(context)
.myTrackersSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: (){
Navigator.push(context,
FadePage(page: AskDoctorHomPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).askYour,
imagePath: 'ask_doctor_icon.png',
subTitle: TranslationBase.of(context)
.askYourSubtitle,
),
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
//TODO
// onTap: () {
// Navigator.push(
// context, FadePage(page: DoctorHomePage()));
// },
child: MedicalProfileItem(
title:
TranslationBase.of(context).internet,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context)
.internetSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
// onTap: () {
// Navigator.push(
// context, FadePage(page: InsuranceApproval()));
// },
child: MedicalProfileItem(
title:
TranslationBase.of(context).chatbot,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context)
.chatbotSubtitle,
),
),
), ),
Expanded( Expanded(
flex: 1,
child: Container(), child: Container(),
), ),
]), ]),
SizedBox(
height:
MediaQuery.of(context).size.height * 0.12,
)
], ],
), ),
) )
@ -499,14 +325,14 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
), ),
if (model.user != null) if (model.user != null)
Positioned( Positioned(
top: 175, top: 185,
left: 20, left: 20,
right: 20, right: 20,
child: Container( child: Container(
width: double.infinity, width: double.infinity,
height: 70, height: 80,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey[600], color: Theme.of(context).primaryColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(
color: Colors.transparent, width: 0.5), color: Colors.transparent, width: 0.5),
@ -518,6 +344,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
fit: BoxFit.cover)), fit: BoxFit.cover)),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 8, height: 8,
@ -527,9 +354,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
" " + " " +
model.user.lastName, model.user.lastName,
color: Colors.white, color: Colors.white,
), bold: true,
SizedBox(
height: 8,
), ),
Texts( Texts(
'${model.user.patientID}', '${model.user.patientID}',

@ -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),
), ),

@ -25,6 +25,7 @@ class MedicineSearch extends StatelessWidget {
AppScaffold( AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).searchMedicine, appBarTitle: TranslationBase.of(context).searchMedicine,
isShowAppBar: true,
body: Container( body: Container(
height: SizeConfig.screenHeight, height: SizeConfig.screenHeight,
child: Column( child: Column(

@ -100,7 +100,7 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
height: 4, height: 4,
), ),
Texts( Texts(
model.appointmentDetails.clinicName, model.appointmentDetails.clinicName != null ? model.appointmentDetails.clinicName : "",
bold: true, bold: true,
), ),
SizedBox( SizedBox(

@ -13,9 +13,11 @@ import 'package:diplomaticquarterapp/pages/family/add-family-member.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/symtom-checker.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/symtom-checker.dart';
import 'package:diplomaticquarterapp/splashPage.dart';
const String INIT_ROUTE = '/'; const String INIT_ROUTE = '/';
const String HOME = '/'; const String HOME = 'home';
const String SPLASH = '/';
const String LOGIN = 'login'; const String LOGIN = 'login';
const String WELCOME_LOGIN = 'welcome-login'; const String WELCOME_LOGIN = 'welcome-login';
const String LOGIN_TYPE = 'login-type'; const String LOGIN_TYPE = 'login-type';
@ -32,6 +34,7 @@ const String SYMPTOM_CHECKER = 'symptom-checker';
const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info'; const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info';
const String SELECT_GENDER = 'select-gender'; const String SELECT_GENDER = 'select-gender';
var routes = { var routes = {
SPLASH: (_) => SplashScreen(),
HOME: (_) => LandingPage(), HOME: (_) => LandingPage(),
WELCOME_LOGIN: (_) => WelcomeLogin(), WELCOME_LOGIN: (_) => WelcomeLogin(),
LOGIN_TYPE: (_) => LoginType(), LOGIN_TYPE: (_) => LoginType(),

@ -1,17 +1,18 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart'; import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart';
import 'package:diplomaticquarterapp/models/Authentication/insert_device_imei_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/insert_device_imei_request.dart';
import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/Authentication/registered_authenticated_user_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/registered_authenticated_user_req.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -19,7 +20,9 @@ import '../../locator.dart';
// SharedPreferences sharedPref = new SharedPreferences(); // SharedPreferences sharedPref = new SharedPreferences();
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
const String INSERT_DEVICE_IMEI = const String INSERT_DEVICE_IMEI =
'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI'; 'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI';
@ -40,11 +43,15 @@ const REGISTER_USER = 'Services/Authentication.svc/REST/PatientRegistration';
const LOGGED_IN_USER_URL = const LOGGED_IN_USER_URL =
'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo'; 'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo';
const FORGOT_PATIENT_ID =
'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber';
class AuthProvider with ChangeNotifier { class AuthProvider with ChangeNotifier {
bool isLogin = false; bool isLogin = false;
bool isLoading = true; bool isLoading = true;
dynamic authenticatedUser; dynamic authenticatedUser;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AuthProvider() { AuthProvider() {
getUserAuthentication(); getUserAuthentication();
@ -355,4 +362,36 @@ class AuthProvider with ChangeNotifier {
throw error; throw error;
} }
} }
Future<Map> sendPatientIDSMS(mobileNo, context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"PatientID": 0,
"TokenID": "",
"PatientMobileNumber": mobileNo,
"SearchType": 2,
"ZipCode": "966",
"PatientIdentificationID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null
};
dynamic localRes;
await new BaseAppClient().post(FORGOT_PATIENT_ID,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
} }

@ -44,6 +44,34 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getActiveAppointmentNo(context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"TokenID": "",
"IsActiveAppointment": true,
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null
};
dynamic localRes;
await baseAppClient.post(GET_ACTIVE_APPOINTMENTS_LIST_URL,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getProjectsList(context) async { Future<Map> getProjectsList(context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE); var languageID = await sharedPref.getString(APP_LANGUAGE);

@ -172,7 +172,7 @@ class FamilyFilesProvider with ChangeNotifier {
throw error; throw error;
} }
} }
//TODO
Future<dynamic> checkActivationCode( Future<dynamic> checkActivationCode(
loginTokenID, activationCode, indentification, mobileNo) async { loginTokenID, activationCode, indentification, mobileNo) async {
try { try {

@ -0,0 +1,36 @@
import 'dart:async';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:flutter/material.dart';
class SplashScreen extends StatefulWidget {
@override
_SplashScreenState createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
@override
void initState() {
super.initState();
Timer(
Duration(seconds: 3),
() => Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (BuildContext context) => LandingPage(),
),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset('assets/images/DQ/DQ_logo.png'),
),
),
);
}
}

@ -0,0 +1,13 @@
import 'package:flutter/material.dart';
import '../widgets/Loader/gif_loader_container.dart';
class GifLoaderDialogUtils {
static showMyDialog(BuildContext context) {
showDialog(context: context, child: GifLoaderContainer());
}
static hideDialog(BuildContext context) {
Navigator.of(context).pop();
}
}

@ -122,6 +122,8 @@ class TranslationBase {
String get loginregister => String get loginregister =>
localizedValues['loginregister'][locale.languageCode]; localizedValues['loginregister'][locale.languageCode];
String get poweredBy => localizedValues['poweredBy'][locale.languageCode];
String get welcome => localizedValues['welcome'][locale.languageCode]; String get welcome => localizedValues['welcome'][locale.languageCode];
String get welcomeText => String get welcomeText =>
@ -148,6 +150,9 @@ class TranslationBase {
String get forgotPassword => String get forgotPassword =>
localizedValues['forgotFileNo'][locale.languageCode]; localizedValues['forgotFileNo'][locale.languageCode];
String get forgotFileNoTitle =>
localizedValues['forgotFileNoTitle'][locale.languageCode];
String get enterNationalId => String get enterNationalId =>
localizedValues['enter-national-id'][locale.languageCode]; localizedValues['enter-national-id'][locale.languageCode];
@ -369,6 +374,7 @@ class TranslationBase {
String get myFamilyFiles => String get myFamilyFiles =>
localizedValues['family-title'][locale.languageCode]; localizedValues['family-title'][locale.languageCode];
String get myFamily => localizedValues['myFamily'][locale.languageCode];
String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; String get oxygenation => localizedValues['oxygenation'][locale.languageCode];
String get respirationRate => String get respirationRate =>
@ -723,6 +729,13 @@ class TranslationBase {
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 email => localizedValues['email'][locale.languageCode];
String get book => localizedValues['Book'][locale.languageCode];
String get appointmentLabel =>
localizedValues['AppointmentLabel'][locale.languageCode];
String get bloodType => localizedValues['BloodType'][locale.languageCode];
String get loginToUseService =>
localizedValues['loginToUseService'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -0,0 +1,43 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_gifimage/flutter_gifimage.dart';
class GifLoaderContainer extends StatefulWidget {
@override
_GifLoaderContainerState createState() => _GifLoaderContainerState();
}
class _GifLoaderContainerState extends State<GifLoaderContainer>
with TickerProviderStateMixin {
GifController controller1;
@override
void initState() {
controller1 = GifController(vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) {
controller1.repeat(
min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true);
});
super.initState();
}
@override
void dispose() {
controller1.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
//progress-loading.gif
child: Container(
// margin: EdgeInsets.only(bottom: 40),
child: GifImage(
controller: controller1,
image: AssetImage(
"assets/images/progress-loading.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"),
),
));
}
}

@ -5,6 +5,7 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../d_q_icons_icons.dart';
import 'bottom_navigation_item.dart'; import 'bottom_navigation_item.dart';
class BottomNavBar extends StatefulWidget { class BottomNavBar extends StatefulWidget {
@ -44,50 +45,50 @@ class _BottomNavBarState extends State<BottomNavBar> {
name: TranslationBase.of(context).home, name: TranslationBase.of(context).home,
), ),
BottomNavigationItem( BottomNavigationItem(
icon: EvaIcons.list, icon: DQIcons.my_medical_file,
activeIcon: EvaIcons.list, activeIcon: DQIcons.my_medical_file,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: widget.index, index: widget.index,
currentIndex: 1, currentIndex: 1,
name: TranslationBase.of(context).medicalProfile, name: TranslationBase.of(context).medicalProfile,
), ),
// Expanded( if(widget.index == 0)
// child: SizedBox( Expanded(
// height: 50, child: SizedBox(
// child: Column( height: 50,
// mainAxisSize: MainAxisSize.min, child: Column(
// mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.min,
// children: <Widget>[ mainAxisAlignment: MainAxisAlignment.center,
// SizedBox(height: 22), children: <Widget>[
// ], SizedBox(height: 22),
// ), ],
// ), ),
// ), ),
),
// Added Calendar Icon to access book appointment flow if(widget.index != 0)
BottomNavigationItem( BottomNavigationItem(
icon: EvaIcons.calendar, icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendarOutline, activeIcon: EvaIcons.calendar,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: _index,
currentIndex: 4, currentIndex: 2,
name: TranslationBase.of(context).bookAppo, name: TranslationBase.of(context).bookAppo,
), ),
BottomNavigationItem( BottomNavigationItem(
icon: EvaIcons.person, icon: DQIcons.family,
activeIcon: EvaIcons.person, activeIcon: DQIcons.family,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: widget.index, index: widget.index,
currentIndex: 2, currentIndex: 3,
name: TranslationBase.of(context).mySchedule, name: TranslationBase.of(context).myFamily,
), ),
BottomNavigationItem( BottomNavigationItem(
icon: EvaIcons.calendar, icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendar, activeIcon: EvaIcons.calendar,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: widget.index, index: widget.index,
currentIndex: 3, currentIndex: 4,
name: TranslationBase.of(context).todoList, name: TranslationBase.of(context).todoList,
) )
], ],

@ -1,6 +1,10 @@
import 'package:badges/badges.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class BottomNavigationItem extends StatelessWidget { class BottomNavigationItem extends StatelessWidget {
final IconData icon; final IconData icon;
@ -10,6 +14,8 @@ class BottomNavigationItem extends StatelessWidget {
final int currentIndex; final int currentIndex;
final String name; final String name;
var authProvider = new AuthProvider();
BottomNavigationItem( BottomNavigationItem(
{this.icon, {this.icon,
this.activeIcon, this.activeIcon,
@ -20,6 +26,7 @@ class BottomNavigationItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var model = Provider.of<ToDoCountProviderModel>(context);
return Expanded( return Expanded(
child: SizedBox( child: SizedBox(
// height: 72.0, // height: 72.0,
@ -29,35 +36,113 @@ class BottomNavigationItem extends StatelessWidget {
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
splashColor: Colors.transparent, splashColor: Colors.transparent,
onTap: () => changeIndex(currentIndex), onTap: () => changeIndex(currentIndex),
child: Column( child: currentIndex != 4
mainAxisSize: MainAxisSize.min, ? Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.min,
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.center,
SizedBox( children: <Widget>[
height: 15, SizedBox(
), height: 15,
Container( ),
child: Icon(currentIndex == index ? activeIcon : icon, Container(
color: currentIndex == index child: Icon(currentIndex == index ? activeIcon : icon,
? Theme.of(context).primaryColor color: currentIndex == index
: Theme.of(context).dividerColor, ? Theme.of(context).primaryColor
size: 22.0), : Theme.of(context).dividerColor,
), size: 22.0),
SizedBox( ),
height: 5, SizedBox(
), height: 5,
),
// Added TextAlign Property Texts(
Texts( name,
name, textAlign: TextAlign.center,
textAlign: TextAlign.center, color: currentIndex == index
color: currentIndex == index ? Theme.of(context).primaryColor
? Theme.of(context).primaryColor : Theme.of(context).dividerColor,
: Theme.of(context).dividerColor, fontSize: 11,
fontSize: 11, ),
), ],
], )
), : authProvider.isLogin
? Stack(
alignment: AlignmentDirectional.center,
children: [
Positioned(
right: 18.0,
bottom: 28.0,
child: Badge(
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: Color(0xFF40ACC9).withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),
child: Text(model.count.toString(),
style: TextStyle(
color: Colors.white, fontSize: 14.0)),
),
),
),
Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
height: 15,
),
Container(
child: Icon(
currentIndex == index ? activeIcon : icon,
color: currentIndex == index
? Theme.of(context).primaryColor
: Theme.of(context).dividerColor,
size: 22.0),
),
SizedBox(
height: 5,
),
Texts(
name,
textAlign: TextAlign.center,
color: currentIndex == index
? Theme.of(context).primaryColor
: Theme.of(context).dividerColor,
fontSize: 11,
),
],
),
],
)
: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
height: 15,
),
Container(
child: Icon(
currentIndex == index ? activeIcon : icon,
color: currentIndex == index
? Theme.of(context).primaryColor
: Theme.of(context).dividerColor,
size: 22.0),
),
SizedBox(
height: 5,
),
Texts(
name,
textAlign: TextAlign.center,
color: currentIndex == index
? Theme.of(context).primaryColor
: Theme.of(context).dividerColor,
fontSize: 11,
),
],
),
), ),
), ),
), ),

@ -105,7 +105,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
: 19), : 19),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
color: widget.backgroundColor ?? HexColor('#515b5d'), color: widget.backgroundColor ?? Theme.of(context).primaryColor,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color.fromRGBO( color: Color.fromRGBO(

@ -0,0 +1,112 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
/// FloatingButton widget
/// [onTap] button function
/// [elevation] color elevation value
class FloatingButton extends StatefulWidget {
FloatingButton({Key key, this.onTap, this.elevation: true}) : super(key: key);
final VoidCallback onTap;
final bool elevation;
@override
_FloatingButtonState createState() => _FloatingButtonState();
}
class _FloatingButtonState extends State<FloatingButton>
with TickerProviderStateMixin {
double _buttonSize = 1.0;
AnimationController _animationController;
Animation _animation;
@override
void initState() {
_animationController = AnimationController(
vsync: this,
lowerBound: 0.7,
upperBound: 1.0,
duration: Duration(milliseconds: 120));
_animation = CurvedAnimation(
parent: _animationController,
curve: Curves.easeOutQuad,
reverseCurve: Curves.easeOutQuad);
_animation.addListener(() {
setState(() {
_buttonSize = _animation.value;
});
});
super.initState();
}
@override
void dispose() {
_animationController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return (GestureDetector(
onTapDown: (TapDownDetails tap) {
_animationController.reverse(from: 1.0);
},
onTapUp: (TapUpDetails tap) {
_animationController.forward();
},
onTapCancel: () {
_animationController.forward();
},
onTap: Feedback.wrapForTap(widget.onTap, context),
behavior: HitTestBehavior.opaque,
child: Transform.scale(
scale: _buttonSize,
child: AnimatedContainer(
duration: Duration(milliseconds: 150),
margin: EdgeInsets.only(bottom: 4),
padding: EdgeInsets.symmetric(vertical: 24, horizontal: 24),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(54.0)),
color: Theme.of(context).primaryColor,
boxShadow: [
BoxShadow(
color: Color.fromRGBO(
120, 71, 80, widget.elevation ? 0.28 : 0.0),
spreadRadius:
_buttonSize < 1.0 ? -(1 - _buttonSize) * 50 : 0.0,
offset: Offset(0, 7.0),
blurRadius: 55.0)
]),
child: Container(
child: Column(
children: [
Icon(EvaIcons.calendar,color: Colors.white,size: 23,),
Texts(
TranslationBase.of(context).book,
bold: !projectViewModel.isArabic,
color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 17,
),
Texts(
TranslationBase.of(context).appointmentLabel,
bold: projectViewModel.isArabic,
color: Colors.white,
fontSize:projectViewModel.isArabic ? 8.8 : 8,
),
],
),
width: 54,
height: 54,
decoration: BoxDecoration(
shape: BoxShape.circle,
),
),
)),
));
}
}

@ -18,7 +18,7 @@ class SecondaryButton extends StatefulWidget {
this.label = "", this.label = "",
this.icon, this.icon,
this.iconOnly = false, this.iconOnly = false,
this.color:const Color.fromRGBO(63, 72, 74, 1), this.color ,
this.textColor, this.textColor,
this.onTap, this.onTap,
this.loading: false, this.loading: false,
@ -185,7 +185,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
height: MediaQuery.of(context).size.width * 2.2, height: MediaQuery.of(context).size.width * 2.2,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: widget.color, color: widget.color?? Theme.of(context).primaryColor,
), ),
), ),
), ),

@ -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),
), ),
)), )),

@ -1,43 +1,43 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../text.dart';
class MedicalProfileItem extends StatelessWidget { class MedicalProfileItem extends StatelessWidget {
MedicalProfileItem({ MedicalProfileItem(
@required this.imagePath, {@required this.imagePath,
@required this.title, @required this.title,
@required this.subTitle, @required this.subTitle,
}); hasBadge});
final String imagePath; final String imagePath;
final String title; final String title;
final String subTitle; final String subTitle;
final bool hasBadge = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return RoundedContainer( return RoundedContainer(
showBorder: true,
borderWidth: 0,
margin: 4,
height: 120,
// MediaQuery.of(context).size.height * 0.12,
child: Container( child: Container(
padding: EdgeInsets.all(5), //width: MediaQuery.of(context).size.width * 0.25,
// width: MediaQuery.of(context).size.width* 0.40,
padding: EdgeInsets.all(10),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Texts(title,
title, fontSize: 1.5 * SizeConfig.textMultiplier,
style: TextStyle( color: Theme.of(context).primaryColor,
fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold),
color: HexColor('#B8382C'), Texts(subTitle,fontSize: 1.4 * SizeConfig.textMultiplier,),
fontWeight: FontWeight.bold),
),
RichText(
text: TextSpan(
style: TextStyle(color: Colors.black),
children: [
TextSpan(text: subTitle),
],
),
),
Align( Align(
alignment: Alignment.bottomRight, alignment: Alignment.bottomRight,
child: Image.asset( child: Image.asset(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -6,6 +7,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class TimeLineWidget extends StatelessWidget { class TimeLineWidget extends StatelessWidget {
final bool isUp; final bool isUp;
@ -15,6 +17,7 @@ class TimeLineWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Stack( return Stack(
children: <Widget>[ children: <Widget>[
Container( Container(
@ -24,14 +27,14 @@ class TimeLineWidget extends StatelessWidget {
child: Center( child: Center(
child: Divider( child: Divider(
color: Colors.white, color: Colors.white,
height: 3, height: 2,
thickness: 3, thickness: 2,
), ),
), ),
), ),
if (isUp) if (isUp)
Positioned( Positioned(
top: 20, top: projectViewModel.isArabic ? 15 : 18,
child: Container( child: Container(
margin: EdgeInsets.only(left: 2, right: 2), margin: EdgeInsets.only(left: 2, right: 2),
child: Column( child: Column(
@ -58,15 +61,15 @@ class TimeLineWidget extends StatelessWidget {
), ),
Container( Container(
height: 20, height: 20,
width: 3, width: 2,
color: Colors.white, color: Colors.white,
), ),
Container( Container(
width: 15, width: 15,
height: 15, height: 15,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.yellow[700], color: Theme.of(context).primaryColor,
border: Border.all(color: Colors.yellow[700], width: 2), border: Border.all(color: Theme.of(context).primaryColor, width: 2),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(25.0), Radius.circular(25.0),
@ -90,7 +93,7 @@ class TimeLineWidget extends StatelessWidget {
) )
else else
Positioned( Positioned(
top: 70, top:projectViewModel.isArabic ? 63 : 70,
child: Container( child: Container(
margin: EdgeInsets.only(left: 2, right: 2), margin: EdgeInsets.only(left: 2, right: 2),
child: Column( child: Column(
@ -110,8 +113,8 @@ class TimeLineWidget extends StatelessWidget {
width: 15, width: 15,
height: 15, height: 15,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.yellow[700], color: Theme.of(context).primaryColor,
border: Border.all(color: Colors.yellow[700], width: 2), border: Border.all(color: Theme.of(context).primaryColor, width: 2),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(25.0), Radius.circular(25.0),
@ -120,7 +123,7 @@ class TimeLineWidget extends StatelessWidget {
), ),
Container( Container(
height: 20, height: 20,
width: 3, width: 2,
color: Colors.white, color: Colors.white,
), ),
LargeAvatar( LargeAvatar(

@ -1,6 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
@ -15,6 +14,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'drawer_item_widget.dart'; import 'drawer_item_widget.dart';
@ -35,7 +35,8 @@ class _AppDrawerState extends State<AppDrawer> {
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
var familyFileProvider = FamilyFilesProvider(); var familyFileProvider = FamilyFilesProvider();
AuthenticatedUser user; AuthenticatedUser user;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -59,7 +60,8 @@ class _AppDrawerState extends State<AppDrawer> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
child: Image.asset('assets/images/logo.png'), child:
Image.asset('assets/images/DQ/DQ_logo.png'),
margin: EdgeInsets.all( margin: EdgeInsets.all(
SizeConfig.imageSizeMultiplier * 4), SizeConfig.imageSizeMultiplier * 4),
), ),
@ -77,13 +79,13 @@ class _AppDrawerState extends State<AppDrawer> {
right: 5), right: 5),
child: Icon( child: Icon(
Icons.account_circle, Icons.account_circle,
color: Colors.red, color: Color(0xFF40ACC9),
)), )),
AppText( AppText(
user.firstName + user.firstName +
' ' + ' ' +
user.lastName, user.lastName,
color: Colors.red, color: Color(0xFF40ACC9),
) )
], ],
), ),
@ -97,7 +99,7 @@ class _AppDrawerState extends State<AppDrawer> {
'File No:' + 'File No:' +
user.patientID user.patientID
.toString(), .toString(),
color: Colors.red, color: Color(0xFF40ACC9),
fontSize: SizeConfig fontSize: SizeConfig
.textMultiplier * .textMultiplier *
1.5, 1.5,
@ -147,8 +149,8 @@ class _AppDrawerState extends State<AppDrawer> {
child: DrawerItem( child: DrawerItem(
TranslationBase.of(context).family, TranslationBase.of(context).family,
Icons.group, Icons.group,
textColor: Colors.red, textColor: Color(0xFF40ACC9),
iconColor: Colors.red, iconColor: Color(0xFF40ACC9),
bottomLine: false, bottomLine: false,
sideArrow: true, sideArrow: true,
), ),
@ -289,17 +291,29 @@ class _AppDrawerState extends State<AppDrawer> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
// This align moves the children to the bottom
child: Align( child: Align(
alignment: FractionalOffset.bottomCenter, alignment: FractionalOffset.bottomCenter,
child: Container( child: Container(
child: Column( child: Row(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Text("Powered by"), children: [
Image.asset( Column(
'assets/images/cs_logo_container.png', children: <Widget>[
width: SizeConfig.imageSizeMultiplier * 30, Text(TranslationBase.of(context).poweredBy),
) Image.asset(
'assets/images/cs_logo_container.png',
width: SizeConfig.imageSizeMultiplier * 30,
)
],
),
Column(
children: <Widget>[
Image.asset(
'assets/images/new-design/vidamobile.png',
width: SizeConfig.imageSizeMultiplier * 25,
)
],
),
], ],
), ),
), ),

@ -243,7 +243,7 @@ class _TextFieldsState extends State<TextFields> {
onSaved: widget.onSaved, onSaved: widget.onSaved,
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.body2 .bodyText1
.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone

@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
class MobileNo extends StatefulWidget { class MobileNo extends StatefulWidget {
final bool disabled; final bool disabled;
// final String data; // final String data;
final List<Countries> countries = [ final List<Countries> countries = [
new Countries(name: 'Saudi Arabia', code: '966'), new Countries(name: 'Saudi Arabia', code: '966'),
@ -20,6 +21,7 @@ class MobileNo extends StatefulWidget {
final TextEditingController controller; final TextEditingController controller;
final Function onNumberChange; final Function onNumberChange;
final Function onCountryChange; final Function onCountryChange;
MobileNo( MobileNo(
{this.disabled = false, {this.disabled = false,
this.marginTop = 0, this.marginTop = 0,
@ -38,6 +40,7 @@ class MobileNo extends StatefulWidget {
class _MobileNo extends State<MobileNo> { class _MobileNo extends State<MobileNo> {
var _selectedType = '966'; var _selectedType = '966';
String countryCode = '966'; String countryCode = '966';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Visibility( return Visibility(
@ -45,8 +48,18 @@ class _MobileNo extends State<MobileNo> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Expanded( Container(
// add Expanded to have your dropdown button fill remaining space margin: EdgeInsets.only(bottom: 10.0),
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey[400],
width: 1.0,
),
borderRadius: BorderRadius.circular(10),
),
width: MediaQuery.of(context).size.width * 0.89,
child: Padding( child: Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
@ -82,14 +95,13 @@ class _MobileNo extends State<MobileNo> {
flex: 1, flex: 1,
child: Icon( child: Icon(
Icons.phone, Icons.phone,
color: Colors.red, color: Color(0xFF40ACC9),
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
countryCode, countryCode,
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
)), )),
Expanded( Expanded(
flex: 4, flex: 4,
@ -122,5 +134,6 @@ class _MobileNo extends State<MobileNo> {
class Countries { class Countries {
final String name; final String name;
final String code; final String code;
Countries({this.name, this.code}); Countries({this.name, this.code});
} }

@ -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) {

@ -71,7 +71,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
height: 28.0, height: 28.0,
width: 30.0, width: 30.0,
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Colors.red, color: Color(0xFF40ACC9),
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: new Center( child: new Center(

@ -1,10 +1,13 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
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';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -34,6 +37,7 @@ class AppScaffold extends StatelessWidget {
final Widget floatingActionButton; final Widget floatingActionButton;
final String title; final String title;
final String description; final String description;
final String image;
final bool isShowDecPage; final bool isShowDecPage;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
@ -51,7 +55,7 @@ class AppScaffold extends StatelessWidget {
this.title, this.title,
this.description, this.description,
this.isShowDecPage = true, this.isShowDecPage = true,
this.isBottomBar}); this.isBottomBar, this.image});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -67,20 +71,38 @@ class AppScaffold extends StatelessWidget {
headline6: headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold), TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
), ),
title: Text(authenticatedUserObject.isLogin title: Texts(authenticatedUserObject.isLogin || !isShowDecPage
? appBarTitle.toUpperCase() ? appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle), : TranslationBase.of(context).serviceInformationTitle,color: Colors.white,bold: true,),
leading: Builder( leading:Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return ArrowBack(); return ArrowBack();
}, },
), ),
centerTitle: true, centerTitle: true,
actions: <Widget>[ actions: <Widget>[
IconButton( image!=null? InkWell(
onTap: ()=>
Navigator.push(
context,
FadePage(
page: InsuranceUpdate(),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
image,
height: SizeConfig.heightMultiplier * 5,
width: SizeConfig.heightMultiplier * 5,
color: Colors.white,
),
),): IconButton(
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()),
@ -115,6 +137,6 @@ class AppScaffold extends StatelessWidget {
buildBodyWidget() { buildBodyWidget() {
// return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]); // return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
return Stack(children: <Widget>[body, FloatingSearchButton()]); return Stack(children: <Widget>[body, /*FloatingSearchButton()*/]);
} }
} }

@ -16,11 +16,7 @@ class ArrowBack extends StatelessWidget {
onTap: Feedback.wrapForTap(() { onTap: Feedback.wrapForTap(() {
onTap != null ? onTap() : Navigator.pop(context); onTap != null ? onTap() : Navigator.pop(context);
}, context), }, context),
child: Icon( child: Icon(Icons.arrow_back_ios, color: Colors.white),
projectViewModel.isArabic
? Icons.arrow_forward_ios
: Icons.arrow_back_ios,
color: Colors.white),
); );
} }
} }

@ -1,15 +1,32 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/widgets/Loader/gif_loader_container.dart';
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gifimage/flutter_gifimage.dart';
class NetworkBaseView extends StatelessWidget { class NetworkBaseView extends StatefulWidget {
final BaseViewModel baseViewModel; final BaseViewModel baseViewModel;
final Widget child; final Widget child;
NetworkBaseView({Key key, this.baseViewModel, this.child}); NetworkBaseView({Key key, this.baseViewModel, this.child});
@override
_NetworkBaseViewState createState() => _NetworkBaseViewState();
}
class _NetworkBaseViewState extends State<NetworkBaseView>{
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -18,22 +35,38 @@ class NetworkBaseView extends StatelessWidget {
} }
buildBaseViewWidget() { buildBaseViewWidget() {
switch (baseViewModel.state) { switch (widget.baseViewModel.state) {
case ViewState.ErrorLocal: case ViewState.ErrorLocal:
case ViewState.Idle: case ViewState.Idle:
case ViewState.BusyLocal: case ViewState.BusyLocal:
return child; return widget.child;
break; break;
case ViewState.Busy: case ViewState.Busy:
return AppCircularProgressIndicator(); return Container(
height: MediaQuery.of(context).size.height,
child: Stack(
children: [
Container(
color: Colors.grey.withOpacity(0.6),
),
Container(child: GifLoaderContainer(), margin: EdgeInsets.only(
bottom: MediaQuery.of(context).size.height * 0.09))
],
),
);
break; break;
case ViewState.Error: case ViewState.Error:
return Center( return Center(
child: AppEmbeddedError( child: AppEmbeddedError(
error: baseViewModel.error, error: widget.baseViewModel.error,
), ),
); );
break; break;
} }
} }
} }

@ -46,8 +46,8 @@ class NotAutPage extends StatelessWidget {
height: MediaQuery.of(context).size.height * 0.55, height: MediaQuery.of(context).size.height * 0.55,
width: MediaQuery.of(context).size.width * 0.50, width: MediaQuery.of(context).size.width * 0.50,
child: Image.asset(projectViewModel.isArabic child: Image.asset(projectViewModel.isArabic
? 'assets/images/wifi-EN.png' ? 'assets/images/Wifi-AR.png'
: 'assets/images/Wifi-AR.png'), : 'assets/images/wifi-EN.png'),
), ),
), ),
SizedBox( SizedBox(

@ -29,6 +29,13 @@ class SMSOTP {
this.onFailure, this.onFailure,
); );
final verifyAccountForm = GlobalKey<FormState>();
TextEditingController digit1 = TextEditingController(text: "");
TextEditingController digit2 = TextEditingController(text: "");
TextEditingController digit3 = TextEditingController(text: "");
TextEditingController digit4 = TextEditingController(text: "");
Map verifyAccountFormValue = { Map verifyAccountFormValue = {
'digit1': '', 'digit1': '',
'digit2': '', 'digit2': '',
@ -42,6 +49,7 @@ class SMSOTP {
String errorMsg; String errorMsg;
String displayTime = ''; String displayTime = '';
displayDialog(BuildContext context) async { displayDialog(BuildContext context) async {
return showDialog( return showDialog(
context: context, context: context,
@ -83,65 +91,47 @@ class SMSOTP {
.substring(mobileNo.toString().length - 3), .substring(mobileNo.toString().length - 3),
textAlign: TextAlign.center, textAlign: TextAlign.center,
)), )),
Padding( Form(
padding: EdgeInsets.only(top: 20), key: verifyAccountForm,
child: Row( child: Padding(
mainAxisAlignment: MainAxisAlignment.spaceAround, padding: EdgeInsets.only(top: 20),
children: <Widget>[ child: Row(
Container( mainAxisAlignment: MainAxisAlignment.spaceAround,
width: SizeConfig.realScreenWidth * 0.15, children: <Widget>[
child: TextFormField( Container(
textInputAction: TextInputAction.next, width: SizeConfig.realScreenWidth * 0.15,
style: buildTextStyle(), child: TextFormField(
autofocus: true,
maxLength: 1,
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
decoration: buildInputDecoration(context),
onSaved: (val) {},
validator: validateCodeDigit,
onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(focusD2);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context).requestFocus(focusD2);
verifyAccountFormValue['digit1'] = val.trim();
checkValue();
}
},
),
),
Container(
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
focusNode: focusD2,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
style: buildTextStyle(),
autofocus: true,
maxLength: 1, maxLength: 1,
controller: digit1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: buildTextStyle(),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: buildInputDecoration(context), decoration: buildInputDecoration(context),
onSaved: (val) {}, onSaved: (val) {},
validator: validateCodeDigit,
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(focusD3); FocusScope.of(context).requestFocus(focusD2);
}, },
onChanged: (val) { onChanged: (val) {
if (val.length == 1) { if (val.length == 1) {
FocusScope.of(context) FocusScope.of(context)
.requestFocus(focusD3); .requestFocus(focusD2);
verifyAccountFormValue['digit2'] = val.trim(); verifyAccountFormValue['digit1'] =
val.trim();
checkValue(); checkValue();
} }
}, },
validator: validateCodeDigit), ),
), ),
Container( Container(
width: SizeConfig.realScreenWidth * 0.15, width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField( child: TextFormField(
focusNode: focusD3, focusNode: focusD2,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
maxLength: 1, maxLength: 1,
controller: digit2,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: buildTextStyle(), style: buildTextStyle(),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
@ -149,38 +139,69 @@ class SMSOTP {
onSaved: (val) {}, onSaved: (val) {},
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
FocusScope.of(context) FocusScope.of(context)
.requestFocus(focusD4); .requestFocus(focusD3);
}, },
onChanged: (val) { onChanged: (val) {
if (val.length == 1) { if (val.length == 1) {
FocusScope.of(context) FocusScope.of(context)
.requestFocus(focusD4); .requestFocus(focusD3);
verifyAccountFormValue['digit3'] = val.trim(); verifyAccountFormValue['digit2'] =
checkValue(); val.trim();
}
},
validator: validateCodeDigit)),
Container(
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
focusNode: focusD4,
maxLength: 1,
textAlign: TextAlign.center,
style: buildTextStyle(),
keyboardType: TextInputType.number,
decoration: buildInputDecoration(context),
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD4);
},
onChanged: (val) {
if (val.length == 1) {
verifyAccountFormValue['digit4'] = val.trim();
checkValue(); checkValue();
} }
}, },
validator: validateCodeDigit)), validator: validateCodeDigit),
], ),
Container(
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
focusNode: focusD3,
textInputAction: TextInputAction.next,
maxLength: 1,
controller: digit3,
textAlign: TextAlign.center,
style: buildTextStyle(),
keyboardType: TextInputType.number,
decoration: buildInputDecoration(context),
onSaved: (val) {},
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD4);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(focusD4);
verifyAccountFormValue['digit3'] =
val.trim();
checkValue();
}
},
validator: validateCodeDigit)),
Container(
width: SizeConfig.realScreenWidth * 0.15,
child: TextFormField(
focusNode: focusD4,
maxLength: 1,
textAlign: TextAlign.center,
style: buildTextStyle(),
controller: digit4,
keyboardType: TextInputType.number,
decoration: buildInputDecoration(context),
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD4);
},
onChanged: (val) {
if (val.length == 1) {
verifyAccountFormValue['digit4'] =
val.trim();
checkValue();
}
},
validator: validateCodeDigit)),
],
),
), ),
), ),
Padding( Padding(
@ -231,7 +252,7 @@ class SMSOTP {
String validateCodeDigit(value) { String validateCodeDigit(value) {
if (value.isEmpty) { if (value.isEmpty) {
return 'Please enter your Password'; return ' ';
} else if (value.length == 3) { } else if (value.length == 3) {
print(value); print(value);
} else { } else {
@ -241,15 +262,10 @@ class SMSOTP {
checkValue() { checkValue() {
//print(verifyAccountFormValue); //print(verifyAccountFormValue);
if (verifyAccountFormValue['digit1'] != ''&& if (verifyAccountForm.currentState.validate()) {
verifyAccountFormValue['digit2'] != '' && onSuccess(digit1.text.toString()+digit2.text.toString()+digit3.text.toString()+digit4.text.toString());
verifyAccountFormValue['digit3'] != '' &&
verifyAccountFormValue['digit4'] != '') {
onSuccess(verifyAccountFormValue['digit1'] +
verifyAccountFormValue['digit2'] +
verifyAccountFormValue['digit3'] +
verifyAccountFormValue['digit4']);
} }
} }
getSecondsAsDigitalClock(int inputSeconds) { getSecondsAsDigitalClock(int inputSeconds) {

@ -25,7 +25,8 @@ class AppText extends StatefulWidget {
{this.color = Colors.black, {this.color = Colors.black,
this.fontWeight = FontWeight.normal, this.fontWeight = FontWeight.normal,
this.fontSize, this.fontSize,
this.fontFamily = 'WorkSans', // this.fontFamily = 'WorkSans',
this.fontFamily,
this.margin, this.margin,
this.marginTop = 0, this.marginTop = 0,
this.marginRight = 0, this.marginRight = 0,

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save