diff --git a/lib/config/config.dart b/lib/config/config.dart index 1ca691d2..e17c98cf 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -1 +1,2 @@ -const MAX_SMALL_SCREEN = 660; \ No newline at end of file +const MAX_SMALL_SCREEN = 660; +const BASE_URL = 'https://hmgwebservices.com/Services/'; \ No newline at end of file diff --git a/lib/interceptor/http_interceptor.dart b/lib/interceptor/http_interceptor.dart index 99f82d21..c27b3cb9 100644 --- a/lib/interceptor/http_interceptor.dart +++ b/lib/interceptor/http_interceptor.dart @@ -6,6 +6,9 @@ import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_interceptor.dart'; +import '../providers/auth_provider.dart'; +import '../util/dr_app_shared_pref.dart'; + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); List publicUrls = [ LOGIN_URL, @@ -21,9 +24,8 @@ class HttpInterceptor extends InterceptorContract { } Future interceptRequest({RequestData data}) async { - // print('RequestData ${data.body}'); + print('RequestData ${data.body}'); try { - print({data.headers}); data.headers["Content-Type"] = "application/json"; data.headers["Accept"] = "application/json"; // if (publicUrls.contains(data.url)) { diff --git a/lib/providers/auth_provider.dart b/lib/providers/auth_provider.dart index d7a470e2..314dfeb0 100644 --- a/lib/providers/auth_provider.dart +++ b/lib/providers/auth_provider.dart @@ -2,6 +2,8 @@ import 'dart:convert'; import 'package:doctor_app_flutter/client/app_client.dart'; import 'package:flutter/cupertino.dart'; +import '../config/config.dart'; +import '../interceptor/http_interceptor.dart'; import '../models/user_model.dart'; const LOGIN_URL = @@ -62,7 +64,8 @@ class AuthProvider with ChangeNotifier { } } - Future sendActivationCodeByOtpNotificationType(activationCodeModel) async{ + Future sendActivationCodeByOtpNotificationType( + activationCodeModel) async { const url = SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE; try { @@ -74,7 +77,7 @@ class AuthProvider with ChangeNotifier { } } - Future memberCheckActivationCodeNew(activationCodeModel) async{ + Future memberCheckActivationCodeNew(activationCodeModel) async { const url = MEMBER_CHECK_ACTIVATION_CODE_NEW; try { diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index b922847a..7ab8abf7 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; @@ -12,11 +13,12 @@ class PatientsProvider with ChangeNotifier { HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); Future getPatientList(PatientModel patient, patientType) async { const url = - 'https://hmgwebservices.com/Services/DoctorApplication.svc/REST/GetMyInPatient'; + BASE_URL+'DoctorApplication.svc/REST/GetMyInPatient'; + try { final response = await client.post(url, body: json.encode({ - "ProjectID": patient.PatientID, + "ProjectID": patient.ProjectID, "ClinicID": patient.ClinicID, "DoctorID": patient.DoctorID, "FirstName": patient.FirstName, diff --git a/lib/providers/projects_provider.dart b/lib/providers/projects_provider.dart index 28d75509..62debed6 100644 --- a/lib/providers/projects_provider.dart +++ b/lib/providers/projects_provider.dart @@ -1,12 +1,14 @@ import 'dart:convert'; +import 'package:doctor_app_flutter/config/config.dart'; + import '../interceptor/http_interceptor.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; const GET_PROJECTS = - 'https://hmgwebservices.com/Services/Lists.svc/REST/GetProjectForDoctorAPP'; + BASE_URL+'Lists.svc/REST/GetProjectForDoctorAPP'; class ProjectsProvider with ChangeNotifier { Client client = diff --git a/lib/screens/patients/patient_profile_screen.dart b/lib/screens/patients/patient_profile_screen.dart index e71e5350..fba86c13 100644 --- a/lib/screens/patients/patient_profile_screen.dart +++ b/lib/screens/patients/patient_profile_screen.dart @@ -1,7 +1,8 @@ -import 'package:doctor_app_flutter/widgets/patients/profile/patinet_profile_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import '../../widgets/patients/profile/patient_profile_widget.dart'; +import '../../widgets/shared/app_scaffold_widget.dart'; + class PatientProfileScreen extends StatelessWidget { const PatientProfileScreen({Key key}) : super(key: key); diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index d5a8cb33..6051c85e 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -1,3 +1,7 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; + import '../../config/size_config.dart'; import '../../util/text_validator.dart'; import '../../widgets/shared/app_buttons_widget.dart'; @@ -12,6 +16,8 @@ import '../../lookups/patient_lookup.dart'; import '../../models/patient_model.dart'; import '../../widgets/patients/dynamic_elements.dart'; +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + // OWNER : Ibrahim albitar // DATE : 19-04-2020 // DESCRIPTION : Patient Search Screen. @@ -29,9 +35,9 @@ class _PatientSearchScreenState extends State { bool _autoValidate = false; var _patientSearchFormValues = PatientModel( - ProjectID: 12, - ClinicID: 17, - DoctorID: 98129, + ProjectID: 15, + ClinicID: 0, + DoctorID: 4709, FirstName: "0", MiddleName: "0", LastName: "0", @@ -50,18 +56,31 @@ class _PatientSearchScreenState extends State { IsLoginForDoctorApp: true, PatientOutSA: false); - void _validateInputs() { - if (_formKey.currentState.validate()) { + print({_patientSearchFormValues.ProjectID}); + // _patientSearchFormValues.TokenID = + + if (_formKey.currentState.validate()) { // If all data are correct then save data to out variables - _formKey.currentState.save(); - } else { + // _formKey.currentState.save(); + + sharedPref.getString(TOKEN).then((token) { + print(token+"EEEEEE"); + _patientSearchFormValues.TokenID = token; + _patientSearchFormValues.ProjectID= 15; + print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf"); + Navigator.of(context).pushNamed(PATIENTS, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": _selectedType + }); + }); + } else { // If all data are not valid then start auto validation. - setState(() { - _autoValidate = true; - }); + setState(() { + _autoValidate = true; + }); + } } -} @override Widget build(BuildContext context) { @@ -206,8 +225,7 @@ class _PatientSearchScreenState extends State { return TextValidator().validateIdNumber(value); }, onSaved: (value) { - _patientSearchFormValues.PatientID = - 89000; + _patientSearchFormValues.PatientID = 89000; }), SizedBox( height: 10, diff --git a/lib/screens/patients/patients_list_screen.dart b/lib/screens/patients/patients_list_screen.dart index fb7e2a78..0b7380b2 100644 --- a/lib/screens/patients/patients_list_screen.dart +++ b/lib/screens/patients/patients_list_screen.dart @@ -16,6 +16,7 @@ class _PatientsListScreenState extends State { void didChangeDependencies() { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatientModel patient = routeArgs['patientSearchForm']; + print(patient.TokenID+"EEEEEE"); String patientType = routeArgs['selectedType']; print(patientType); if (_isInit) { @@ -27,6 +28,7 @@ class _PatientsListScreenState extends State { _hasError = res['ErrorEndUserMessage']; }); + print(res); }).catchError((error) { print(error); }); diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 53c671e4..4c8ac7e9 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -180,11 +180,11 @@ class _VerificationMethodsState extends State { Map model = { "LogInTokenID": _loggedUser['LogInTokenID'], "Channel": 9, - "MobileNumber": _loggedUser['MobileNumber'],//785228065, + "MobileNumber": 785228065,//_loggedUser['MobileNumber'], "IPAdress": "11.11.11.11", "LanguageID": 2, "ProjectID": 15, //TODO : this should become daynamci - "ZipCode": _loggedUser['ZipCode'],//962, //_loggedUser['ZipCode'], + "ZipCode": 962, //_loggedUser['ZipCode'], "UserName": _loggedUser['List_MemberInformation'][0]['MemberID'], "OTP_SendType": oTPSendType }; diff --git a/lib/widgets/patients/profile/Profile_general_info_Widget.dart b/lib/widgets/patients/profile/Profile_general_info_Widget.dart index 916cd5a8..5e4b22d7 100644 --- a/lib/widgets/patients/profile/Profile_general_info_Widget.dart +++ b/lib/widgets/patients/profile/Profile_general_info_Widget.dart @@ -3,6 +3,14 @@ import 'package:flutter/material.dart'; import './profile_general_info_content_widget.dart'; import '../../../config/size_config.dart'; import '../../shared/rounded_container_widget.dart'; + +/* + *@author: Elham Rababah + *@Date:21/4/2020 + *@param: + *@return: ProfileGeneralInfoWidget + *@desc: Profile General Info Widget class + */ class ProfileGeneralInfoWidget extends StatelessWidget { const ProfileGeneralInfoWidget({ Key key, diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart new file mode 100644 index 00000000..9a1d3437 --- /dev/null +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -0,0 +1,25 @@ +import 'package:flutter/material.dart'; + +import './Profile_general_info_Widget.dart'; +import './profile_header_widget.dart'; +import './profile_medical_info_widget.dart'; +import './profile_status_info_widget.dart'; + +/* + *@author: Elham Rababah + *@Date:22/4/2020 + *@param: + *@return:PatientProfileWidget + *@desc: Patient Profile Widget + */ +class PatientProfileWidget extends StatelessWidget { + @override + Widget build(BuildContext context) { + return ListView(padding: EdgeInsets.zero, children: [ + ProfileHeaderWidget(), + ProfileGeneralInfoWidget(), + ProfileMedicalInfoWidget(), + ProfileStatusInfoWidget() + ]); + } +} diff --git a/lib/widgets/patients/profile/patinet_profile_widget.dart b/lib/widgets/patients/profile/patinet_profile_widget.dart deleted file mode 100644 index 9efb0d6a..00000000 --- a/lib/widgets/patients/profile/patinet_profile_widget.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import './Profile_general_info_Widget.dart'; -import './profile_medical_info_widget.dart'; -import './profile_status_info_widget.dart'; -import '../../../config/size_config.dart'; -import '../../../widgets/shared/profile_image_widget.dart'; - -class PatientProfileWidget extends StatelessWidget { - @override - Widget build(BuildContext context) { - return ListView(padding: EdgeInsets.zero, children: [ - Container( - height: SizeConfig.heightMultiplier * 30, - child: ProfileImageWidget( - url: - "http://images4.fanpop.com/image/photos/16200000/David-Schwimmer-Ross-Geller-ross-geller-16258927-629-779.jpg", - name: "Fahad AlSlehm", - des: "324599", - height: SizeConfig.heightMultiplier * 17, - width: SizeConfig.heightMultiplier * 17, - color: Hexcolor('#58434F')), - ), - ProfileGeneralInfoWidget(), - ProfileMedicalInfoWidget(), - ProfileStatusInfoWidget() - ]); - } -} - - - - - diff --git a/lib/widgets/patients/profile/profile_general_info_content_widget.dart b/lib/widgets/patients/profile/profile_general_info_content_widget.dart index 1a014422..7ef4c8f2 100644 --- a/lib/widgets/patients/profile/profile_general_info_content_widget.dart +++ b/lib/widgets/patients/profile/profile_general_info_content_widget.dart @@ -2,6 +2,14 @@ import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; + +/* + *@author: Elham Rababah + *@Date:22/4/2020 + *@param: title, info + *@return:ProfileGeneralInfoContentWidget + *@desc: Profile General Info Content Widget + */ class ProfileGeneralInfoContentWidget extends StatelessWidget { String title; String info; @@ -25,7 +33,7 @@ class ProfileGeneralInfoContentWidget extends StatelessWidget { color: Hexcolor('#58434F'), ), AppText( - info, + info, color: Hexcolor('#707070'), fontSize: SizeConfig.textMultiplier * 2, ) diff --git a/lib/widgets/patients/profile/profile_header_widget.dart b/lib/widgets/patients/profile/profile_header_widget.dart new file mode 100644 index 00000000..05a132ac --- /dev/null +++ b/lib/widgets/patients/profile/profile_header_widget.dart @@ -0,0 +1,34 @@ +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../../../config/size_config.dart'; +import '../../shared/profile_image_widget.dart'; + +/* + *@author: Elham Rababah + *@Date:21/4/2020 + *@param: + *@return: + *@desc: Profile Header Widget class + */ +class ProfileHeaderWidget extends StatelessWidget { + const ProfileHeaderWidget({ + Key key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + height: SizeConfig.heightMultiplier * 30, + child: ProfileImageWidget( + url: + "http://images4.fanpop.com/image/photos/16200000/David-Schwimmer-Ross-Geller-ross-geller-16258927-629-779.jpg", + name: "Fahad AlSlehm", + des: "324599", + height: SizeConfig.heightMultiplier * 17, + width: SizeConfig.heightMultiplier * 17, + color: Hexcolor('#58434F')), + ); + } +} + diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index ba139e85..198f6147 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -5,6 +5,14 @@ import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; import '../../shared/rounded_container_widget.dart'; + +/* + *@author: Elham Rababah + *@Date:22/4/2020 + *@param: + *@return:ProfileMedicalInfoWidget + *@desc: Profile Medical Info Widget + */ class ProfileMedicalInfoWidget extends StatelessWidget { const ProfileMedicalInfoWidget({ Key key, diff --git a/lib/widgets/patients/profile/profile_status_info_widget.dart b/lib/widgets/patients/profile/profile_status_info_widget.dart index 2c69eb03..c8983f83 100644 --- a/lib/widgets/patients/profile/profile_status_info_widget.dart +++ b/lib/widgets/patients/profile/profile_status_info_widget.dart @@ -1,10 +1,18 @@ -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import '../../../config/size_config.dart'; +import '../../shared/app_texts_widget.dart'; import '../../shared/rounded_container_widget.dart'; + +/* + *@author: Elham Rababah + *@Date:13/4/2020 + *@param: + *@return: ProfileStatusInfoWidget + *@desc: Profile Status Info Widget + */ class ProfileStatusInfoWidget extends StatelessWidget { const ProfileStatusInfoWidget({ Key key, diff --git a/lib/widgets/shared/profile_image_widget.dart b/lib/widgets/shared/profile_image_widget.dart index 159d179b..33256444 100644 --- a/lib/widgets/shared/profile_image_widget.dart +++ b/lib/widgets/shared/profile_image_widget.dart @@ -2,6 +2,14 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; + +/* + *@author: Elham Rababah + *@Date:21/4/2020 + *@param: String url;String name;String des;double height;double width; Color color; + *@return: ProfileImageWidget + *@desc: Profile Image Widget class + */ class ProfileImageWidget extends StatelessWidget { String url; String name;