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

fix_authentication
Sultan Khan 4 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
/Runner.xcworkspace/contents.xcworkspacedata
/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 BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
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
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
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': 'تعيين تذكير'},
'login': {'en': 'Login', 'ar': 'تسجيل الدخول'},
'loginregister': {'en': 'Login / Register', 'ar': 'دخولتسجيل'},
'loginregister': {'en': 'Login / Register', 'ar': 'تسجيل الدخول'},
'poweredBy': {'en': 'Powered By', 'ar': 'مشغل بواسطة'},
'welcome': {'en': 'Welcome', 'ar': 'أهلا بك'},
'welcome_text': {
'en': 'Dr. Sulaiman Al Habib Mobile Application ',
@ -117,7 +118,7 @@ const Map<String, Map<String, String>> localizedValues = {
},
'welcome_text2': {
'en': 'Have you visited AlHabib Medical Group before? ',
'ar': 'الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك'
'ar': 'هل قمت بزيارة مجموعة الحبيب الطبية من قبل؟'
},
'yes': {'en': 'Yes', 'ar': 'نعم'},
'no': {'en': 'No', 'ar': 'لا'},
@ -129,6 +130,11 @@ const Map<String, Map<String, String>> localizedValues = {
"nationalID": {"en": "National ID", "ar": "رقم الهوية"},
"fileNo": {"en": "File Number", "ar": "رقم الملف"},
"forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"},
"forgotFileNoTitle": {
"en": "Forgot medical file Number",
"ar": "نسيت رقم الملف"
},
"enter-national-id": {
"en": "Please enter mobile number and national ID / Iqama",
"ar": "الرجاء إدخال رقم الجوال والهوية الوطنية / الاقامة"
@ -283,6 +289,7 @@ const Map<String, Map<String, String>> localizedValues = {
"enter-email": {"en": "Enter Email", "ar": "ادخل البريد الالكتروني"},
"family": {"en": "My Family", "ar": "عائلتي"},
"family-title": {"en": "My Family Files", "ar": "ملفات العائلة"},
"myFamily": {"en": "My Family", "ar": "ملفات العائلة"},
"add-new-member": {"en": "Add Family Member", "ar": "إضافة عضو جديد"},
"sent-requests": {"en": "Sent 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': 'ملف الطبي الالكتروني'},
"myMedicalFileSubTitle": {
"en": "All your medical records",
'ar': 'جميع سجلاتك البية'
'ar': 'جميع سجلاتك الطبية'
},
"viewMore": {"en": "View More", 'ar': 'عرض المزيد'},
"homeHealthCareService": {
@ -409,7 +416,7 @@ const Map<String, Map<String, String>> localizedValues = {
"locationa": {"en": "location:", "ar": "الموقع"},
"ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "},
"requestA": {"en": "Request:", "ar": "اسعاف"},
"MyAppointments": {"en": "My Appointments", "ar": "مواعيدي"},
"MyAppointments": {"en": "Appointments", "ar": "مواعيدي"},
"NoBookedAppointments": {
"en": "No Booked Appointments",
"ar": "لا توجد مواعيد محجوزة"
@ -658,6 +665,10 @@ const Map<String, Map<String, String>> localizedValues = {
"ar": "الفحص ليس تشخيص."
},
"remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"},
"loginToUseService": {
"en": "You need to login to use this service",
"ar": "هذة الخدمة تتطلب تسجيل الدخول"
},
"select-gender": {"en": "Select Gender", "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",
"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 clinicID;
int doctorID;
String startTime;
String endTime;
String appointmentDate;
String clinicName;
String doctorImageURL;
String doctorName;
String projectName;
dynamic startTime;
dynamic endTime;
dynamic appointmentDate;
dynamic clinicName;
dynamic doctorImageURL;
dynamic doctorName;
dynamic projectName;
AppointmentDetails(
{this.setupID,

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

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

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

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

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

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

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

@ -30,4 +30,13 @@ class DQIcons {
static const IconData thermometer = IconData(0xe806, 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 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/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:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'config/size_config.dart';
import 'core/viewModels/project_view_model.dart';
import 'locator.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
void main() async {
setupLocator();
@ -29,6 +31,8 @@ class MyApp extends StatelessWidget {
ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(),
),
ChangeNotifierProvider<ToDoCountProviderModel>(
create: (context) => ToDoCountProviderModel()),
ChangeNotifierProvider<SearchProvider>(
create: (context) => SearchProvider()),
ChangeNotifierProvider.value(
@ -48,6 +52,7 @@ class MyApp extends StatelessWidget {
TranslationBaseDelegate(),
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: [
const Locale('ar', ''), // Arabic
@ -67,28 +72,27 @@ class MyApp extends StatelessWidget {
hintColor: Colors.grey[400],
disabledColor: Colors.grey[300],
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),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
bottomSheetTheme: BottomSheetThemeData(
backgroundColor: HexColor('#E0E0E0')),
primaryColor: Color(0xff40ACC9),
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Colors.grey[700],
brightness: Brightness.light,
elevation: 0.0,
color: Color(0xff40ACC9),
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Colors.grey[800],
color: Color(0xff40ACC9),
),
),
),
initialRoute: HOME,
initialRoute: SPLASH,
routes: routes,
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/BookAppointment/BookingOptions.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/ToDoList/ToDo.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';
class AllHabibMedicalService extends StatefulWidget {
//TODO
final Function goToMyProfile;
AllHabibMedicalService({Key key, this.goToMyProfile});
@override
_AllHabibMedicalServiceState createState() => _AllHabibMedicalServiceState();
}
@ -95,12 +101,10 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
),
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: MedicalProfilePage(),
),
),
onTap: () {
Navigator.pop(context);
widget.goToMyProfile();
},
imageLocation:
'assets/images/new-design/my_file_bottom_bar.png',
title: TranslationBase.of(context).myMedicalFile,
@ -314,7 +318,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
onTap: () => Navigator.push(
context,
FadePage(
page: ParkingPage(),
page: FindUsPage(),
),
),
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_toast.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/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -382,8 +383,10 @@ class _BookConfirmState extends State<BookConfirm> {
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo,
BuildContext context) {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () {
if (!widget.isLiveCareAppointment) {
@ -397,11 +400,12 @@ class _BookConfirmState extends State<BookConfirm> {
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
GifLoaderDialogUtils.hideDialog(context);
});
}
insertAppointment(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo;
widget.service
.insertAppointment(
@ -421,6 +425,7 @@ class _BookConfirmState extends State<BookConfirm> {
docObject.projectID, docObject);
});
} else {
GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
@ -445,11 +450,11 @@ class _BookConfirmState extends State<BookConfirm> {
}).catchError((err) {
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
insertLiveCareScheduledAppointment(context, DoctorList docObject) {
GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo;
widget.service
.insertLiveCareScheduleAppointment(
@ -470,6 +475,7 @@ class _BookConfirmState extends State<BookConfirm> {
docObject.clinicID, docObject.projectID, docObject);
});
} else {
GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
@ -508,12 +514,12 @@ class _BookConfirmState extends State<BookConfirm> {
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
getLiveCareAppointmentPatientShare(context, String appointmentNo,
int clinicID, int projectID, DoctorList docObject) {
GifLoaderDialogUtils.hideDialog(context);
widget.service
.getLiveCareAppointmentPatientShare(
appointmentNo, clinicID, projectID, context)
@ -523,8 +529,7 @@ class _BookConfirmState extends State<BookConfirm> {
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
String getTime(DateTime dateTime) {
@ -581,6 +586,7 @@ class _BookConfirmState extends State<BookConfirm> {
Future navigateToBookSuccess(context, DoctorList docObject,
PatientShareResponse patientShareResponse) async {
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(
context,
MaterialPageRoute(

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

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

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

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

@ -1,9 +1,9 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class DoctorInformation extends StatelessWidget {
DoctorProfileList docProfileList;
DoctorInformation({@required this.docProfileList});
@ -27,8 +27,8 @@ class DoctorInformation extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Image.asset(
"assets/images/new-design/doctor_information_icon.png"),
SvgPicture.asset(
"assets/images/DQ/doctor_information_icon.svg"),
Container(
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0),
child: Text(TranslationBase.of(context).docInfo,
@ -43,12 +43,21 @@ class DoctorInformation extends StatelessWidget {
child: Table(
children: [
TableRow(children: [
TableCell(child: _getHeadingText(TranslationBase.of(context).gender)),
TableCell(child: _getHeadingText(TranslationBase.of(context).nationality)),
TableCell(
child: _getHeadingText(
TranslationBase.of(context).gender)),
TableCell(
child: _getHeadingText(
TranslationBase.of(context).nationality)),
]),
TableRow(children: [
TableCell(child: _getNormalText(docProfileList.genderDescription)),
TableCell(child: _getNormalTextWithIcon(docProfileList.nationalityName, docProfileList.nationalityFlagURL)),
TableCell(
child: _getNormalText(
docProfileList.genderDescription)),
TableCell(
child: _getNormalTextWithIcon(
docProfileList.nationalityName,
docProfileList.nationalityFlagURL)),
]),
],
),
@ -82,13 +91,14 @@ class DoctorInformation extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Image.asset(
"assets/images/new-design/doctor_qualification_icon.png"),
SvgPicture.asset(
"assets/images/DQ/doctor_qualification_icon.svg"),
Container(
margin: EdgeInsets.fromLTRB(15.0, 5.0, 15.0, 0.0),
child: Text(TranslationBase.of(context).docQualifications,
child: Text(
TranslationBase.of(context).docQualifications,
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])),
Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Image.network(
icon,
width: 18.0,
height: 18.0),
child: Image.network(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/services/appointment_services/GetDoctorsList.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:flutter/material.dart';
@ -17,7 +17,9 @@ import 'package:smart_progress_bar/smart_progress_bar.dart';
class SearchByClinic extends StatefulWidget {
final List clnicIds;
SearchByClinic({this.clnicIds});
@override
_SearchByClinicState createState() => _SearchByClinicState();
}
@ -26,11 +28,13 @@ class _SearchByClinicState extends State<SearchByClinic> {
bool nearestAppo = false;
String dropdownValue;
String projectDropdownValue;
// var event = RobotProvider();
List<ListClinicCentralized> clinicsList = [];
List<HospitalsModel> projectsList = [];
bool isMobileAppDentalAllow = false;
bool isLoaded = false;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList());
@ -47,7 +51,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
Row(
children: <Widget>[
Checkbox(
activeColor: new Color(0xFFc5272d),
activeColor: new Color(0xFF40ACC9),
value: nearestAppo,
onChanged: (bool value) {
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,
style: TextStyle(
fontSize: 14.0,
@ -168,27 +166,21 @@ class _SearchByClinicState extends State<SearchByClinic> {
}
getClinicsList() {
GifLoaderDialogUtils.showMyDialog(context);
ClinicListService service = new ClinicListService();
service
.getClinicsList(context)
.then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
isMobileAppDentalAllow = res['ISMobileAppDentalAllow'];
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();
service.getClinicsList(context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
isMobileAppDentalAllow = res['ISMobileAppDentalAllow'];
res['ListClinicCentralized'].forEach((v) {
clinicsList.add(new ListClinicCentralized.fromJson(v));
});
});
getProjectsList();
} else {}
}).catchError((err) {
print(err);
});
}
getProjectsList() {
@ -199,23 +191,24 @@ class _SearchByClinicState extends State<SearchByClinic> {
res['ListProject'].forEach((v) {
projectsList.add(new HospitalsModel.fromJson(v));
});
print(projectsList.length);
});
GifLoaderDialogUtils.hideDialog(context);
filterClinic();
} else {}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
SearchInfo searchInfo = new SearchInfo();
if (dropdownValue == "17") {
searchInfo.ProjectID = int.parse(projectDropdownValue);
searchInfo.ClinicID = int.parse(dropdownValue);
searchInfo.date = DateTime.now();
GifLoaderDialogUtils.hideDialog(context);
navigateToDentalComplaints(context, searchInfo);
} else {
List<DoctorList> doctorsList = [];
@ -231,6 +224,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
nearestAppo,
context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
@ -249,17 +243,16 @@ class _SearchByClinicState extends State<SearchByClinic> {
result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length;
navigateToSearchResults(
context, doctorsList, result, numAll, arrDistance);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(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)
.toList();
isLoaded = true;
///print(clinicsList);
}
});
}

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

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

@ -31,7 +31,7 @@ class CardCommon extends StatelessWidget {
child: Text(this.text,
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xFFc5272d),
color: new Color(0xFF40ACC9),
letterSpacing: 1.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/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -135,12 +136,14 @@ class DoctorView extends StatelessWidget {
}
getDoctorsProfile(context, DoctorList docObject, {isAppo}) {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsProfile(docObject.doctorID, docObject.clinicID,
docObject.projectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) {
res['DoctorProfileList'].forEach((v) {
@ -154,7 +157,7 @@ class DoctorView extends StatelessWidget {
}
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
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/uitl/app_shared_preferences.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/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class MyAppointments extends StatefulWidget {
List<AppoitmentAllHistoryResultList> appoList = [];
@ -33,6 +33,7 @@ class _MyAppointmentsState extends State<MyAppointments>
bool isDataLoaded = false;
var sharedPref = new AppSharedPreferences();
@override
void initState() {
_tabController = new TabController(length: 3, vsync: this);
@ -77,6 +78,7 @@ class _MyAppointmentsState extends State<MyAppointments>
}
getPatientAppointmentHistory() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
widget.appoList.clear();
widget.bookedAppoList.clear();
@ -85,6 +87,7 @@ class _MyAppointmentsState extends State<MyAppointments>
service.getPatientAppointmentHistory(false, context).then((res) {
print(res['AppoimentAllHistoryResultList'].length);
if (res['MessageStatus'] == 1) {
GifLoaderDialogUtils.hideDialog(context);
setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) {
res['AppoimentAllHistoryResultList'].forEach((v) {
@ -100,11 +103,11 @@ class _MyAppointmentsState extends State<MyAppointments>
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
Navigator.of(context).pop();
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
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/services/appointment_services/GetDoctorsList.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/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:url_launcher/url_launcher.dart';
class AppointmentActions extends StatefulWidget {
@ -94,7 +94,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
child: Text(e.title,
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xFFc5272d),
color: new Color(0xFF40ACC9),
letterSpacing: 1.0,
fontSize: 20.0)),
),
@ -351,49 +351,49 @@ class _AppointmentActionsState extends State<AppointmentActions> {
cancelAppointment() {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.cancelAppointment(widget.appo, context)
.then((res) {
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
Navigator.of(context).pop();
});
service.cancelAppointment(widget.appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
openAppointmentRadiology() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
FinalRadiology finalRadiology = new FinalRadiology();
service
.getPatientRadOrders(widget.appo.appointmentNo.toString(), context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['FinalRadiologyList']);
finalRadiology =
new FinalRadiology.fromJson(res['FinalRadiologyList'][0]);
print(finalRadiology.reportData);
navigateToRadiologyDetails(finalRadiology);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
openPrescriptionReport() {
GifLoaderDialogUtils.showMyDialog(context);
List<PrescriptionReportEnh> prescriptionReportEnhList = List();
DoctorsListService service = new DoctorsListService();
service.getPatientPrescriptionReports(widget.appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
res['ListPRM'].forEach((report) {
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report));
});
@ -405,10 +405,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
AppToast.showErrorToast(message: "Sorry there is no data");
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
Future navigateToMedicinePrescriptionReport(
@ -463,8 +463,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}
askYourDoc() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['PatientDoctorAppointmentResultList']);
if (res['PatientDoctorAppointmentResultList'].length != 0) {
getCallRequestType();
@ -473,15 +475,17 @@ class _AppointmentActionsState extends State<AppointmentActions> {
message: TranslationBase.of(context).askDocNotAllowed);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
getCallRequestType() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getCallRequestType(context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
List<AskDocRequestType> requestData = new List<AskDocRequestType>();
res['ListReqTypes'].forEach((element) {
requestData.add(new AskDocRequestType.fromJson(element));
@ -490,9 +494,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
showAskDocRequestDialog(requestData);
});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
showAskDocRequestDialog(List<AskDocRequestType> requestData) {
@ -525,28 +529,32 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}
sendAskDocRequest(int requestType) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.sendAskDocCallRequest(widget.appo, requestType.toString(), context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Request Sent Successfully");
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
confirmAppointment() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID,
widget.appo.projectID, widget.appo.isLiveCareAppointment, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop();
@ -554,9 +562,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
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_toast.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/utils.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_svg/flutter_svg.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class ToDo extends StatefulWidget {
PatientShareResponse patientShareResponse;
@ -82,7 +82,7 @@ class _ToDoState extends State<ToDo> {
height: 20.0),
Container(
margin:
EdgeInsets.only(left: 5.0, right: 25.0),
EdgeInsets.only(left: 5.0, right: 20.0),
child: Text(
getDate(widget
.appoList[index].appointmentDate),
@ -106,7 +106,14 @@ class _ToDoState extends State<ToDo> {
TranslationBase.of(context)
.liveCareAppo,
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)),
),
],
@ -253,7 +260,7 @@ class _ToDoState extends State<ToDo> {
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12.0,
color: Colors.red[600],
color: new Color(0xFF40ACC9),
decoration:
TextDecoration.underline)),
),
@ -464,8 +471,10 @@ class _ToDoState extends State<ToDo> {
}
getPatientAppointmentHistory() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) {
@ -485,26 +494,29 @@ class _ToDoState extends State<ToDo> {
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
getPatientShare(context, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.getPatientShare(appo.appointmentNo.toString(), appo.clinicID,
appo.projectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
getAppoQR(context, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
PatientShareResponse patientShareResponse = new PatientShareResponse();
patientShareResponse.doctorNameObj = appo.doctorNameObj;
@ -518,12 +530,13 @@ class _ToDoState extends State<ToDo> {
DoctorsListService service = new DoctorsListService();
service.generateAppointmentQR(patientShareResponse, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
navigateToQR(context, res['AppointmentQR'], patientShareResponse);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
Future navigateToQR(
@ -620,6 +633,7 @@ class _ToDoState extends State<ToDo> {
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.checkPaymentStatus(
@ -627,8 +641,7 @@ class _ToDoState extends State<ToDo> {
appo.projectID, appo.clinicID, appo.appointmentNo),
context)
.then((res) {
print("Printing Payment Status Reponse!!!!");
print(res);
GifLoaderDialogUtils.hideDialog(context);
String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') {
createAdvancePayment(res, appo);
@ -636,18 +649,20 @@ class _ToDoState extends State<ToDo> {
AppToast.showErrorToast(message: res['Response_Message']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
service
.createAdvancePayment(
appo, res['Amount'], res['Fort_id'], res['PaymentMethod'], context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
@ -656,23 +671,25 @@ class _ToDoState extends State<ToDo> {
appo);
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
GifLoaderDialogUtils.hideDialog(context);
});
}
addAdvancedNumberRequest(String advanceNumber, String paymentReference,
String appointmentID, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
getAppoQR(context, appo);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
Future navigateToPaymentMethod(
@ -705,51 +722,46 @@ class _ToDoState extends State<ToDo> {
}
confirmAppointment(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.isLiveCareAppointment, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
getPatientAppointmentHistory();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
if (appo.isLiveCareAppointment) {
insertLiveCareVIDARequest(appo);
} else {
getPatientAppointmentHistory();
}
});
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
if (appo.isLiveCareAppointment) {
insertLiveCareVIDARequest(appo);
} else {
getPatientAppointmentHistory();
}
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.serviceID, appo.doctorID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
getPatientAppointmentHistory();
});
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
getPatientAppointmentHistory();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
});
}
}

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

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

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

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

@ -98,12 +98,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
children: <Widget>[
Container(
child: ListView.builder(
itemCount: model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList ==
null
? 0
: model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList.length,
itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length,
itemBuilder: (BuildContext context, int index) {
return Container(
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/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.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/translations_delegate_base.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/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/slide_up_page.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -29,6 +34,7 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart';
import '../../locator.dart';
import 'home_page.dart';
class LandingPage extends StatefulWidget {
@ -44,6 +50,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
int currentTab = 0;
PageController pageController;
ProjectViewModel projectProvider;
///inject the user data
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
final authService = new AuthProvider();
var event = RobotProvider();
@ -123,7 +133,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
AppGlobal.context = context;
});
_requestIOSPermissions();
pageController = PageController(keepPage: true);
pageController = PageController(keepPage: true);
// _firebaseMessaging.setAutoInitEnabled(true);
//
// if (Platform.isIOS) {
@ -141,119 +151,119 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// });
//_firebase Background message handler
// _firebaseMessaging.configure(
// onMessage: (Map<String, dynamic> message) async {
// showDialog("onMessage: $message");
// print("onMessage: $message");
// print(message);
// print(message['name']);
// print(message['appointmentdate']);
//
// if (Platform.isIOS) {
// if (message['is_call'] == "true") {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found iOS");
// }
// } else {
// print("Is Call Not Found iOS");
// }
//
// if (Platform.isAndroid) {
// if (message['data'].containsKey("is_call")) {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message['data']);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found Android");
// }
// } else {
// print("Is Call Not Found Android");
// }
// },
// onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// onLaunch: (Map<String, dynamic> message) async {
// print("onLaunch: $message");
// showDialog("onLaunch: $message");
// },
// onResume: (Map<String, dynamic> message) async {
// print("onResume: $message");
// print(message);
// print(message['name']);
// print(message['appointmentdate']);
//
// showDialog("onResume: $message");
//
// if (Platform.isIOS) {
// if (message['is_call'] == "true") {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found iOS");
// }
// } else {
// print("Is Call Not Found iOS");
// }
// },
// _firebaseMessaging.configure(
// onMessage: (Map<String, dynamic> message) async {
// showDialog("onMessage: $message");
// print("onMessage: $message");
// print(message);
// print(message['name']);
// print(message['appointmentdate']);
//
// if (Platform.isIOS) {
// if (message['is_call'] == "true") {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found iOS");
// }
// } else {
// print("Is Call Not Found iOS");
// }
//
// if (Platform.isAndroid) {
// if (message['data'].containsKey("is_call")) {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message['data']);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found Android");
// }
// } else {
// print("Is Call Not Found Android");
// }
// },
// onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// onLaunch: (Map<String, dynamic> message) async {
// print("onLaunch: $message");
// showDialog("onLaunch: $message");
// },
// onResume: (Map<String, dynamic> message) async {
// print("onResume: $message");
// print(message);
// print(message['name']);
// print(message['appointmentdate']);
//
// showDialog("onResume: $message");
//
// if (Platform.isIOS) {
// if (message['is_call'] == "true") {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found iOS");
// }
// } else {
// print("Is Call Not Found iOS");
// }
// },
// );
}
@ -329,56 +339,59 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// projectProvider = Provider.of(context);
// checkValue(projectProvider);
return Scaffold(
appBar: AppBar(
elevation: 0,
textTheme: TextTheme(
headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text(getText(currentTab).toUpperCase()),
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.menu),
color: Colors.white,
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);
appBar: AppBar(
elevation: 0,
textTheme: TextTheme(
headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
title: Texts(getText(currentTab).toUpperCase(),bold: true,color: Colors.white,),
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.menu),
color: Colors.white,
onPressed: () => Scaffold.of(context).openDrawer(),
);
},
),
MedicalProfilePage(),
MyAdmissionsPage(),
ToDo(),
BookingOptions()
], // Please do not remove the BookingOptions from this array
),
bottomNavigationBar: BottomNavBar(
changeIndex: _changeCurrentTab,
index: currentTab,
),
);
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(),
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() {
@ -392,11 +405,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
case 1:
return TranslationBase.of(context).medicalProfile;
case 2:
return TranslationBase.of(context).mySchedule;
return TranslationBase.of(context).bookAppo;
case 3:
return TranslationBase.of(context).services;
return TranslationBase.of(context).myFamily;
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/select_device_imei_res.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/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
import 'package:local_auth/local_auth.dart';
@ -73,173 +73,165 @@ class _ConfirmLogin extends State<ConfirmLogin> {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).confirm,
isShowAppBar: true,
isShowDecPage: false,
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(20),
height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth,
child: Column(
children: <Widget>[
Expanded(
flex: 3,
child: user != null && isMoreOption == false
? Column(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/habib-logo.png',
height: 80,
width: 80,
),
AppText(
TranslationBase.of(context).welcomeBack +
' ' +
user.name,
fontSize: SizeConfig.textMultiplier * 3.5,
),
AppText(
TranslationBase.of(context).accountInfo,
fontSize: SizeConfig.textMultiplier * 2.5,
),
Card(
color: Colors.grey[300],
child: Row(
children: <Widget>[
Expanded(
child: ListTile(
title: Text(
TranslationBase.of(context)
.lastLoginAt,
textAlign: TextAlign.center,
),
subtitle: Text(
user.editedOn != null
? formatDate(DateUtil
.convertStringToDate(
user.editedOn))
: '--',
textAlign: TextAlign.center),
)),
Expanded(
child: ListTile(
title: Text(
TranslationBase.of(context)
.lastLoginWith,
textAlign: TextAlign.center),
subtitle: Text(
getType(
user.logInType, context),
textAlign: TextAlign.center),
))
],
))
],
)
: Column(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/habib-logo.png',
height: 80,
width: 80,
appBarTitle: TranslationBase.of(context).confirm,
isShowAppBar: true,
isShowDecPage: false,
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(20),
height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth,
child: Column(
children: <Widget>[
Expanded(
flex: 3,
child: user != null && isMoreOption == false
? Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/DQ/dq_logo_icon.png',
height: 90,
width: 90,
),
AppText(
TranslationBase.of(context).welcomeBack +
' ' +
user.name,
fontSize: SizeConfig.textMultiplier * 3.5,
),
AppText(
TranslationBase.of(context).accountInfo,
fontSize: SizeConfig.textMultiplier * 2.5,
),
Card(
color: Colors.grey[300],
child: Row(
children: <Widget>[
Expanded(
child: ListTile(
title: Text(
TranslationBase.of(context).lastLoginAt,
textAlign: TextAlign.center,
),
subtitle: Text(
user.editedOn != null
? formatDate(
DateUtil.convertStringToDate(
user.editedOn))
: '--',
textAlign: TextAlign.center),
)),
Expanded(
child: ListTile(
title: Text(
TranslationBase.of(context)
.lastLoginWith,
textAlign: TextAlign.center),
subtitle: Text(
getType(user.logInType, context),
textAlign: TextAlign.center),
))
],
))
],
)
: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/DQ/dq_logo_icon.png',
height: 90,
width: 90,
),
this.onlySMSBox == false
? AppText(
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(
TranslationBase.of(context)
.verifyLoginWith,
fontSize:
SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
)
: AppText(
TranslationBase.of(context)
.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,
])),
user != null && isMoreOption == false
? Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
onlySMSBox == false
? Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(child: getButton(3)),
Expanded(child: getButton(2))
],
)
: SizedBox(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(child: getButton(1)),
Expanded(child: getButton(4))
],
),
]),
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
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>[
user != null
onlySMSBox == false
? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context)
.useAnotherAccount,
() => {
Navigator.of(context).pushNamed(
LOGIN_TYPE,
)
},
)),
Expanded(child: getButton(3)),
Expanded(child: getButton(2))
],
)
: 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 {
@ -301,6 +293,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
showLoader(true);
var req = getCommonRequest();
var request = CheckPatientAuthenticationReq.fromJson(req.toJson());
GifLoaderDialogUtils.showMyDialog(context);
sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
authService
@ -322,19 +315,23 @@ class _ConfirmLogin extends State<ConfirmLogin> {
})
.catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
GifLoaderDialogUtils.hideDialog(context);
});
}
sendActivationCode(type) async {
var request = this.getCommonRequest();
// loading(true);
await this.authService.sendActivationCode(request).then((result) => {
if (result != null && result['isSMSSent'] == true)
{this.startSMSService(type)}
});
GifLoaderDialogUtils.showMyDialog(context);
await this.authService.sendActivationCode(request).then((result) {
GifLoaderDialogUtils.hideDialog(context);
if (result != null && result['isSMSSent'] == true) {
this.startSMSService(type);
}
}).catchError((r) {
GifLoaderDialogUtils.hideDialog(context);
});
// SMSOTP.showLoadingDialog(context, false),
}
@ -410,7 +407,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
;
}
setUser() async {}
@ -482,11 +478,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}
checkActivationCode({value}) async {
SMSOTP.showLoadingDialog(context, true);
GifLoaderDialogUtils.showMyDialog(context);
var request = this.getCommonRequest().toJson();
this
.authService
authService
.checkActivationCode(request, value)
.then((result) => {
if (result is Map)
@ -501,25 +496,20 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}
else
{
this.userData = result
.list, //AuthenticatedUser.fromJson(result['List'][0]),
this.sharedPref.setObject(USER_PROFILE, result.list),
this.loginTokenID = result.logInTokenID,
this
.sharedPref
.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
this
.sharedPref
.setString(TOKEN, result.authenticationTokenID),
this.checkIfUserAgreedBefore(result),
// Navigator.of(context).pop(),
SMSOTP.showLoadingDialog(context, false),
userData = result.list,
//AuthenticatedUser.fromJson(result['List'][0]),
sharedPref.setObject(USER_PROFILE, result.list),
loginTokenID = result.logInTokenID,
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
sharedPref.setString(TOKEN, result.authenticationTokenID),
checkIfUserAgreedBefore(result),
}
}
else
{
// Navigator.of(context).pop(),
SMSOTP.showLoadingDialog(context, false),
GifLoaderDialogUtils.hideDialog(context),
Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: result);
}),
@ -527,9 +517,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
})
.catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
;
GifLoaderDialogUtils.hideDialog(context);
});
}
checkIfUserAgreedBefore(CheckActivationCode result) {

@ -1,6 +1,9 @@
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/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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
@ -15,11 +18,12 @@ class ForgotPassword extends StatefulWidget {
class _ForgotPassword extends State<ForgotPassword> {
String selectedType = 'Saudi Arabia';
final TextEditingController nationalIDorFile = null;
final TextEditingController mobileNo = null;
final TextEditingController mobileNo = TextEditingController();
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).forgotPassword,
appBarTitle: TranslationBase.of(context).forgotFileNoTitle,
isShowAppBar: true,
isShowDecPage: false,
body: SingleChildScrollView(
@ -32,8 +36,9 @@ class _ForgotPassword extends State<ForgotPassword> {
flex: 1,
child: AppText(
TranslationBase.of(context).forgotDesc,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 3,
textAlign: TextAlign.start,
marginTop: 10.0,
)),
Expanded(
flex: 2,
@ -43,29 +48,29 @@ class _ForgotPassword extends State<ForgotPassword> {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
// add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline(
child: DropdownButton(
isExpanded: true,
value: selectedType,
iconSize: 40,
elevation: 16,
onChanged: (String newValue) => {
setState(() {
selectedType = newValue;
})
},
items: <String>[
'Saudi Arabia',
'Dubai',
].map<DropdownMenuItem<String>>(
(String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList()))),
// Expanded(
// // add Expanded to have your dropdown button fill remaining space
// child: DropdownButtonHideUnderline(
// child: DropdownButton(
// isExpanded: true,
// value: selectedType,
// iconSize: 40,
// elevation: 16,
// onChanged: (String newValue) => {
// setState(() {
// selectedType = newValue;
// })
// },
// items: <String>[
// 'Saudi Arabia',
// 'Dubai',
// ].map<DropdownMenuItem<String>>(
// (String value) {
// return DropdownMenuItem<String>(
// value: value,
// child: Text(value),
// );
// }).toList()))),
],
),
MobileNo(controller: mobileNo),
@ -80,12 +85,13 @@ class _ForgotPassword extends State<ForgotPassword> {
Row(
children: <Widget>[
Expanded(
child: RaisedButton(
color: Colors.grey,
textColor: Colors.white,
child: Text(TranslationBase.of(context).submit),
onPressed: () => {},
))
child: DefaultButton(
TranslationBase.of(context).submit,
() {
sendPatientIDBySMS();
// 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/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/routes.dart';
class LoginType extends StatelessWidget {
static int loginType = 0;
@ -28,14 +28,16 @@ class LoginType extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/habib-logo.png',
height: 80,
width: 80,
'assets/images/DQ/dq_logo_icon.png',
height: 90,
width: 90,
),
AppText(
TranslationBase.of(context).logintypeRadio,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
textAlign: TextAlign.start,
marginBottom: 20.0,
marginTop: 20.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
@ -75,6 +77,7 @@ class LoginType extends StatelessWidget {
fontSize:
SizeConfig.textMultiplier *
2,
fontWeight: FontWeight.bold,
)
],
),
@ -112,6 +115,7 @@ class LoginType extends StatelessWidget {
fontSize:
SizeConfig.textMultiplier *
2,
fontWeight: FontWeight.bold,
)
],
),
@ -131,7 +135,7 @@ class LoginType extends StatelessWidget {
child: AppText(
TranslationBase.of(context).forgotPassword,
fontSize: SizeConfig.textMultiplier * 2.5,
margin: 10,
marginTop: 20.0,
underline: true)))
]),
),
@ -150,7 +154,7 @@ class LoginType extends StatelessWidget {
REGISTER,
)
},
))
)),
],
),
],

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

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

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

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

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

@ -1,41 +1,29 @@
import 'dart:math';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:badges/badges.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/medical_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/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/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/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/services/authentication/auth_provider.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/time_line_widget.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
import 'package:provider/provider.dart';
import '../../locator.dart';
import 'active_medications/ActiveMedicationsPage.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 '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 'my_trackers/my_trackers.dart';
class MedicalProfilePage extends StatefulWidget {
@override
@ -43,9 +31,12 @@ class MedicalProfilePage extends StatefulWidget {
}
class _MedicalProfilePageState extends State<MedicalProfilePage> {
var authProvider = new AuthProvider();
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget) => AppScaffold(
@ -62,31 +53,27 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Container(
width: double.infinity,
height: 210,
decoration: BoxDecoration(
image: DecorationImage(
image: ExactAssetImage(
'assets/images/timeline_bg.png'),
fit: BoxFit.cover),
),
child: Stack(
children: <Widget>[
Image.asset(
'assets/images/timeline_bg.png',
fit: BoxFit.cover,
width: double.infinity,
// color: Colors.black.withOpacity(0.0)
),
if(model.authenticatedUserObject.isLogin)
ListView.builder(
itemBuilder: (context, index) => TimeLineWidget(
isUp: index % 2 == 1,
appoitmentAllHistoryResul: model
.appoitmentAllHistoryResultList[index],
if (model.authenticatedUserObject.isLogin)
ListView.builder(
itemBuilder: (context, index) =>
TimeLineWidget(
isUp: index % 2 == 1,
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>[
Container(
width: double.infinity,
height: 30,
height: 55,
),
Row(
children: <Widget>[
@ -111,13 +98,53 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
),
);
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.myAppointments,
imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context)
.myAppointmentsList,
),
child: authProvider.isLogin
? Stack(children: [
MedicalProfileItem(
title:
TranslationBase.of(context)
.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(
@ -158,48 +185,52 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Navigator.push(
context,
FadePage(
page: HomePrescriptionsPage(),
page: DoctorHomePage(),
),
);
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.medicines,
imagePath: 'prescription_icon.png',
.myDoctor,
imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context)
.medicinesSubtitle,
.myDoctorSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: VitalSignDetailsScreen(),
),
),
onTap: () {
Navigator.push(
context,
FadePage(
page: HomePrescriptionsPage(),
),
);
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.vitalSigns,
imagePath: 'vital_signs.png',
.medicines,
imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context)
.vitalSignsSubtitle,
.medicinesSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => Navigator.push(context,
FadePage(page: ActiveMedicationsPage())),
onTap: () {
Navigator.push(context,
FadePage(page: InsuranceCard()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.myMedical,
imagePath: 'active_medications.png',
.insurance,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context)
.myMedicalSubtitle,
.insuranceSubtitle,
),
),
),
@ -210,20 +241,14 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: DoctorHomePage(),
),
);
},
onTap: () => Navigator.push(context,
FadePage(page: AllergiesPage())),
child: MedicalProfileItem(
title: TranslationBase.of(context)
.myDoctor,
imagePath: 'doctor_icon.png',
.allergies,
imagePath: 'my_allergies_icon.png',
subTitle: TranslationBase.of(context)
.myDoctorSubtitle,
.allergiesSubtitle,
),
),
),
@ -234,13 +259,13 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Navigator.push(
context,
FadePage(
page: EyeMeasurementsPage()));
page: PatientSickLeavePage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png',
title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png',
subTitle: TranslationBase.of(context)
.eyeSubtitle,
.sickSubtitle,
),
),
),
@ -248,83 +273,24 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: InsuranceCard()));
Navigator.push(
context,
FadePage(
page: InsuranceApproval()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.insurance,
imagePath: 'insurance_card_icon.png',
.insuranceApproval,
imagePath:
'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context)
.insuranceSubtitle,
.insuranceApprovalSubtitle,
),
),
),
],
),
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(
flex: 1,
child: InkWell(
@ -342,156 +308,16 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
),
),
Expanded(
flex: 1,
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,
),
),
child: Container(),
),
Expanded(
flex: 1,
child: Container(),
),
]),
SizedBox(
height:
MediaQuery.of(context).size.height * 0.12,
)
],
),
)
@ -499,14 +325,14 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
),
if (model.user != null)
Positioned(
top: 175,
top: 185,
left: 20,
right: 20,
child: Container(
width: double.infinity,
height: 70,
height: 80,
decoration: BoxDecoration(
color: Colors.grey[600],
color: Theme.of(context).primaryColor,
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent, width: 0.5),
@ -518,6 +344,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
fit: BoxFit.cover)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
SizedBox(
height: 8,
@ -527,9 +354,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
" " +
model.user.lastName,
color: Colors.white,
),
SizedBox(
height: 8,
bold: true,
),
Texts(
'${model.user.patientID}',

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

@ -46,9 +46,13 @@ class PrescriptionDetailsPage extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(prescriptionReport.itemDescription)),
child: Texts(
prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN),
),
),
),
)
],
),
),
@ -169,7 +173,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
SizedBox(
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/pages/base/base_view.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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -19,10 +20,10 @@ class PrescriptionItemsPage extends StatelessWidget {
Widget build(BuildContext context) {
return BaseView<PrescriptionsViewModel>(
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(
isShowAppBar: true,
appBarTitle: 'Items',
appBarTitle: TranslationBase.of(context).prescriptions,
baseViewModel: model,
body: Container(
height: MediaQuery.of(context).size.height * 0.8,
@ -62,8 +63,9 @@ class PrescriptionItemsPage extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(model
.prescriptionReportList[index].itemDescription)),
child: Texts(model.prescriptionReportList[index].itemDescription.isNotEmpty?
model.prescriptionReportList[index].itemDescription :model
.prescriptionReportList[index].itemDescriptionN)),
)),
Icon(
Icons.arrow_forward_ios,

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

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

@ -100,7 +100,7 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
height: 4,
),
Texts(
model.appointmentDetails.clinicName,
model.appointmentDetails.clinicName != null ? model.appointmentDetails.clinicName : "",
bold: true,
),
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/select-gender.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/symtom-checker.dart';
import 'package:diplomaticquarterapp/splashPage.dart';
const String INIT_ROUTE = '/';
const String HOME = '/';
const String HOME = 'home';
const String SPLASH = '/';
const String LOGIN = 'login';
const String WELCOME_LOGIN = 'welcome-login';
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 SELECT_GENDER = 'select-gender';
var routes = {
SPLASH: (_) => SplashScreen(),
HOME: (_) => LandingPage(),
WELCOME_LOGIN: (_) => WelcomeLogin(),
LOGIN_TYPE: (_) => LoginType(),

@ -1,17 +1,18 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.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/check_activation_code_request.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_user_status_req.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/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/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:flutter/cupertino.dart';
@ -19,7 +20,9 @@ import '../../locator.dart';
// SharedPreferences sharedPref = new SharedPreferences();
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
AppSharedPreferences sharedPref = new AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
const String INSERT_DEVICE_IMEI =
'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI';
@ -40,11 +43,15 @@ const REGISTER_USER = 'Services/Authentication.svc/REST/PatientRegistration';
const LOGGED_IN_USER_URL =
'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo';
const FORGOT_PATIENT_ID =
'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber';
class AuthProvider with ChangeNotifier {
bool isLogin = false;
bool isLoading = true;
dynamic authenticatedUser;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AuthProvider() {
getUserAuthentication();
@ -355,4 +362,36 @@ class AuthProvider with ChangeNotifier {
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);
}
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 {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);

@ -172,7 +172,7 @@ class FamilyFilesProvider with ChangeNotifier {
throw error;
}
}
//TODO
Future<dynamic> checkActivationCode(
loginTokenID, activationCode, indentification, mobileNo) async {
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 =>
localizedValues['loginregister'][locale.languageCode];
String get poweredBy => localizedValues['poweredBy'][locale.languageCode];
String get welcome => localizedValues['welcome'][locale.languageCode];
String get welcomeText =>
@ -148,6 +150,9 @@ class TranslationBase {
String get forgotPassword =>
localizedValues['forgotFileNo'][locale.languageCode];
String get forgotFileNoTitle =>
localizedValues['forgotFileNoTitle'][locale.languageCode];
String get enterNationalId =>
localizedValues['enter-national-id'][locale.languageCode];
@ -369,6 +374,7 @@ class TranslationBase {
String get myFamilyFiles =>
localizedValues['family-title'][locale.languageCode];
String get myFamily => localizedValues['myFamily'][locale.languageCode];
String get oxygenation => localizedValues['oxygenation'][locale.languageCode];
String get respirationRate =>
@ -723,6 +729,13 @@ class TranslationBase {
String get iAm => localizedValues['i-am'][locale.languageCode];
String get yearOld => localizedValues['years-old'][locale.languageCode];
String get email => localizedValues['email'][locale.languageCode];
String get book => localizedValues['Book'][locale.languageCode];
String get appointmentLabel =>
localizedValues['AppointmentLabel'][locale.languageCode];
String get bloodType => localizedValues['BloodType'][locale.languageCode];
String get loginToUseService =>
localizedValues['loginToUseService'][locale.languageCode];
}
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/material.dart';
import '../../d_q_icons_icons.dart';
import 'bottom_navigation_item.dart';
class BottomNavBar extends StatefulWidget {
@ -44,50 +45,50 @@ class _BottomNavBarState extends State<BottomNavBar> {
name: TranslationBase.of(context).home,
),
BottomNavigationItem(
icon: EvaIcons.list,
activeIcon: EvaIcons.list,
icon: DQIcons.my_medical_file,
activeIcon: DQIcons.my_medical_file,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 1,
name: TranslationBase.of(context).medicalProfile,
),
// Expanded(
// child: SizedBox(
// height: 50,
// child: Column(
// mainAxisSize: MainAxisSize.min,
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// SizedBox(height: 22),
// ],
// ),
// ),
// ),
// Added Calendar Icon to access book appointment flow
if(widget.index == 0)
Expanded(
child: SizedBox(
height: 50,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: 22),
],
),
),
),
if(widget.index != 0)
BottomNavigationItem(
icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendarOutline,
activeIcon: EvaIcons.calendar,
changeIndex: _changeIndex,
index: _index,
currentIndex: 4,
currentIndex: 2,
name: TranslationBase.of(context).bookAppo,
),
BottomNavigationItem(
icon: EvaIcons.person,
activeIcon: EvaIcons.person,
icon: DQIcons.family,
activeIcon: DQIcons.family,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 2,
name: TranslationBase.of(context).mySchedule,
currentIndex: 3,
name: TranslationBase.of(context).myFamily,
),
BottomNavigationItem(
icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendar,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 3,
currentIndex: 4,
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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class BottomNavigationItem extends StatelessWidget {
final IconData icon;
@ -10,6 +14,8 @@ class BottomNavigationItem extends StatelessWidget {
final int currentIndex;
final String name;
var authProvider = new AuthProvider();
BottomNavigationItem(
{this.icon,
this.activeIcon,
@ -20,6 +26,7 @@ class BottomNavigationItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
var model = Provider.of<ToDoCountProviderModel>(context);
return Expanded(
child: SizedBox(
// height: 72.0,
@ -29,35 +36,113 @@ class BottomNavigationItem extends StatelessWidget {
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
onTap: () => changeIndex(currentIndex),
child: 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,
),
// Added TextAlign Property
Texts(
name,
textAlign: TextAlign.center,
color: currentIndex == index
? Theme.of(context).primaryColor
: Theme.of(context).dividerColor,
fontSize: 11,
),
],
),
child: currentIndex != 4
? 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,
),
],
)
: 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),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
color: widget.backgroundColor ?? HexColor('#515b5d'),
color: widget.backgroundColor ?? Theme.of(context).primaryColor,
boxShadow: [
BoxShadow(
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.icon,
this.iconOnly = false,
this.color:const Color.fromRGBO(63, 72, 74, 1),
this.color ,
this.textColor,
this.onTap,
this.loading: false,
@ -185,7 +185,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
height: MediaQuery.of(context).size.width * 2.2,
decoration: BoxDecoration(
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 Function onTap;
final Function onEmailTap;
final String isInOutPatientDescription;
final bool isInOutPatient;
DoctorCard(
{this.name,
@ -27,7 +26,7 @@ class DoctorCard extends StatelessWidget {
this.billNo,
this.onTap,
this.onEmailTap,
this.isInOutPatientDescription});
this.isInOutPatient});
@override
Widget build(BuildContext context) {
@ -54,7 +53,7 @@ class DoctorCard extends StatelessWidget {
width: 20,
height: date == null ? 100 : 130,
decoration: BoxDecoration(
color: Colors.red[900],
color: !isInOutPatient? Colors.red[900]: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8))),
@ -62,7 +61,7 @@ class DoctorCard extends StatelessWidget {
quarterTurns: 3,
child: Center(
child: Text(
isInOutPatientDescription ?? "Calendar",
!isInOutPatient? 'In Patient'.toUpperCase():'OutPatient'.toUpperCase(),
style: TextStyle(color: Colors.white),
),
)),

@ -1,43 +1,43 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../text.dart';
class MedicalProfileItem extends StatelessWidget {
MedicalProfileItem({
@required this.imagePath,
@required this.title,
@required this.subTitle,
});
MedicalProfileItem(
{@required this.imagePath,
@required this.title,
@required this.subTitle,
hasBadge});
final String imagePath;
final String title;
final String subTitle;
final bool hasBadge = false;
@override
Widget build(BuildContext context) {
return RoundedContainer(
showBorder: true,
borderWidth: 0,
margin: 4,
height: 120,
// MediaQuery.of(context).size.height * 0.12,
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(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
title,
style: TextStyle(
fontSize: 1.5 * SizeConfig.textMultiplier,
color: HexColor('#B8382C'),
fontWeight: FontWeight.bold),
),
RichText(
text: TextSpan(
style: TextStyle(color: Colors.black),
children: [
TextSpan(text: subTitle),
],
),
),
Texts(title,
fontSize: 1.5 * SizeConfig.textMultiplier,
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.bold),
Texts(subTitle,fontSize: 1.4 * SizeConfig.textMultiplier,),
Align(
alignment: Alignment.bottomRight,
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/pages/MyAppointments/AppointmentDetails.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class TimeLineWidget extends StatelessWidget {
final bool isUp;
@ -15,6 +17,7 @@ class TimeLineWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Stack(
children: <Widget>[
Container(
@ -24,14 +27,14 @@ class TimeLineWidget extends StatelessWidget {
child: Center(
child: Divider(
color: Colors.white,
height: 3,
thickness: 3,
height: 2,
thickness: 2,
),
),
),
if (isUp)
Positioned(
top: 20,
top: projectViewModel.isArabic ? 15 : 18,
child: Container(
margin: EdgeInsets.only(left: 2, right: 2),
child: Column(
@ -58,15 +61,15 @@ class TimeLineWidget extends StatelessWidget {
),
Container(
height: 20,
width: 3,
width: 2,
color: Colors.white,
),
Container(
width: 15,
height: 15,
decoration: BoxDecoration(
color: Colors.yellow[700],
border: Border.all(color: Colors.yellow[700], width: 2),
color: Theme.of(context).primaryColor,
border: Border.all(color: Theme.of(context).primaryColor, width: 2),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(
Radius.circular(25.0),
@ -90,7 +93,7 @@ class TimeLineWidget extends StatelessWidget {
)
else
Positioned(
top: 70,
top:projectViewModel.isArabic ? 63 : 70,
child: Container(
margin: EdgeInsets.only(left: 2, right: 2),
child: Column(
@ -110,8 +113,8 @@ class TimeLineWidget extends StatelessWidget {
width: 15,
height: 15,
decoration: BoxDecoration(
color: Colors.yellow[700],
border: Border.all(color: Colors.yellow[700], width: 2),
color: Theme.of(context).primaryColor,
border: Border.all(color: Theme.of(context).primaryColor, width: 2),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(
Radius.circular(25.0),
@ -120,7 +123,7 @@ class TimeLineWidget extends StatelessWidget {
),
Container(
height: 20,
width: 3,
width: 2,
color: Colors.white,
),
LargeAvatar(

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

@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
class MobileNo extends StatefulWidget {
final bool disabled;
// final String data;
final List<Countries> countries = [
new Countries(name: 'Saudi Arabia', code: '966'),
@ -20,6 +21,7 @@ class MobileNo extends StatefulWidget {
final TextEditingController controller;
final Function onNumberChange;
final Function onCountryChange;
MobileNo(
{this.disabled = false,
this.marginTop = 0,
@ -38,6 +40,7 @@ class MobileNo extends StatefulWidget {
class _MobileNo extends State<MobileNo> {
var _selectedType = '966';
String countryCode = '966';
@override
Widget build(BuildContext context) {
return Visibility(
@ -45,8 +48,18 @@ class _MobileNo extends State<MobileNo> {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
// add Expanded to have your dropdown button fill remaining space
Container(
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(
padding: EdgeInsets.all(10),
child: DropdownButtonHideUnderline(
@ -82,14 +95,13 @@ class _MobileNo extends State<MobileNo> {
flex: 1,
child: Icon(
Icons.phone,
color: Colors.red,
color: Color(0xFF40ACC9),
)),
Expanded(
flex: 1,
child: Text(
countryCode,
overflow: TextOverflow.clip,
)),
Expanded(
flex: 4,
@ -122,5 +134,6 @@ class _MobileNo extends State<MobileNo> {
class Countries {
final String name;
final String code;
Countries({this.name, this.code});
}

@ -9,7 +9,7 @@ class StarRating extends StatelessWidget {
final int totalCount;
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
Widget build(BuildContext context) {

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

@ -1,10 +1,13 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_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/routes.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/progress_indicator/app_loader_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -34,6 +37,7 @@ class AppScaffold extends StatelessWidget {
final Widget floatingActionButton;
final String title;
final String description;
final String image;
final bool isShowDecPage;
AuthenticatedUserObject authenticatedUserObject =
@ -51,7 +55,7 @@ class AppScaffold extends StatelessWidget {
this.title,
this.description,
this.isShowDecPage = true,
this.isBottomBar});
this.isBottomBar, this.image});
@override
Widget build(BuildContext context) {
@ -67,20 +71,38 @@ class AppScaffold extends StatelessWidget {
headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text(authenticatedUserObject.isLogin
title: Texts(authenticatedUserObject.isLogin || !isShowDecPage
? appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle),
leading: Builder(
: TranslationBase.of(context).serviceInformationTitle,color: Colors.white,bold: true,),
leading:Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
centerTitle: true,
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),
color: Colors.white,
onPressed: () {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
@ -115,6 +137,6 @@ class AppScaffold extends StatelessWidget {
buildBodyWidget() {
// 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 != null ? onTap() : Navigator.pop(context);
}, context),
child: Icon(
projectViewModel.isArabic
? Icons.arrow_forward_ios
: Icons.arrow_back_ios,
color: Colors.white),
child: Icon(Icons.arrow_back_ios, color: Colors.white),
);
}
}

@ -1,15 +1,32 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.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/progress_indicator/app_circular_progress_Indeicator.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 Widget 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
Widget build(BuildContext context) {
return Container(
@ -18,22 +35,38 @@ class NetworkBaseView extends StatelessWidget {
}
buildBaseViewWidget() {
switch (baseViewModel.state) {
switch (widget.baseViewModel.state) {
case ViewState.ErrorLocal:
case ViewState.Idle:
case ViewState.BusyLocal:
return child;
return widget.child;
break;
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;
case ViewState.Error:
return Center(
child: AppEmbeddedError(
error: baseViewModel.error,
error: widget.baseViewModel.error,
),
);
break;
}
}
}

@ -46,8 +46,8 @@ class NotAutPage extends StatelessWidget {
height: MediaQuery.of(context).size.height * 0.55,
width: MediaQuery.of(context).size.width * 0.50,
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(

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

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

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

Loading…
Cancel
Save