From 12217d21ac532bbec3e956387f79b9f37a707a51 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 22 Apr 2020 13:24:08 +0300 Subject: [PATCH 1/4] add comment to patient profile --- .../patients/patient_profile_screen.dart | 5 +-- .../profile/Profile_general_info_Widget.dart | 8 +++++ .../profile/patient_profile_widget.dart | 25 +++++++++++++ .../profile/patinet_profile_widget.dart | 35 ------------------- .../profile_general_info_content_widget.dart | 10 +++++- .../profile/profile_header_widget.dart | 34 ++++++++++++++++++ .../profile/profile_medical_info_widget.dart | 8 +++++ .../profile/profile_status_info_widget.dart | 10 +++++- lib/widgets/shared/profile_image_widget.dart | 8 +++++ 9 files changed, 104 insertions(+), 39 deletions(-) create mode 100644 lib/widgets/patients/profile/patient_profile_widget.dart delete mode 100644 lib/widgets/patients/profile/patinet_profile_widget.dart create mode 100644 lib/widgets/patients/profile/profile_header_widget.dart 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/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; From c38af9da488975a1008b5a6f5209350663612239 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 22 Apr 2020 14:09:47 +0300 Subject: [PATCH 2/4] add base url and change the mobile number to mine --- lib/config/config.dart | 3 ++- lib/providers/auth_provider.dart | 29 +++++++++++++--------- lib/providers/patients_provider.dart | 4 ++- lib/providers/projects_provider.dart | 4 ++- lib/widgets/auth/verification_methods.dart | 4 +-- 5 files changed, 27 insertions(+), 17 deletions(-) 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/providers/auth_provider.dart b/lib/providers/auth_provider.dart index 7af750ca..8dc10319 100644 --- a/lib/providers/auth_provider.dart +++ b/lib/providers/auth_provider.dart @@ -1,23 +1,25 @@ import 'dart:convert'; -import 'package:doctor_app_flutter/interceptor/http_interceptor.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; +import '../config/config.dart'; +import '../interceptor/http_interceptor.dart'; import '../models/user_model.dart'; -const LOGIN_URL = - 'https://hmgwebservices.com/Services/Sentry.svc/REST/MemberLogIN_New'; +const LOGIN_URL = BASE_URL + 'Sentry.svc/REST/MemberLogIN_New'; const INSERT_DEVICE_IMEI = - 'https://hmgwebservices.com/Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; + BASE_URL + 'Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; const SELECT_DEVICE_IMEI = - 'https://hmgwebservices.com/Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; + BASE_URL + 'Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; -const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = - 'https://hmgwebservices.com/Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; +const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = BASE_URL + + 'Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; + +const MEMBER_CHECK_ACTIVATION_CODE_NEW = + BASE_URL + 'Sentry.svc/REST/MemberCheckActivationCode_New'; -const MEMBER_CHECK_ACTIVATION_CODE_NEW ='https://hmgwebservices.com/Services/Sentry.svc/REST/MemberCheckActivationCode_New'; class AuthProvider with ChangeNotifier { Client client = HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); @@ -68,11 +70,13 @@ class AuthProvider with ChangeNotifier { } } - Future sendActivationCodeByOtpNotificationType(activationCodeModel) async{ + Future sendActivationCodeByOtpNotificationType( + activationCodeModel) async { const url = SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE; try { - final response = await client.post(url, body: json.encode(activationCodeModel)); + final response = + await client.post(url, body: json.encode(activationCodeModel)); return Future.value(json.decode(response.body)); } catch (error) { print(error); @@ -80,11 +84,12 @@ class AuthProvider with ChangeNotifier { } } - Future memberCheckActivationCodeNew(activationCodeModel) async{ + Future memberCheckActivationCodeNew(activationCodeModel) async { const url = MEMBER_CHECK_ACTIVATION_CODE_NEW; try { - final response = await client.post(url, body: json.encode(activationCodeModel)); + final response = + await client.post(url, body: json.encode(activationCodeModel)); return Future.value(json.decode(response.body)); } catch (error) { print(error); diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index b922847a..4c20758e 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,7 +13,8 @@ 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({ 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/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 }; From c3942f0e95fd7bfc190f0987537a00c9df72075c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 22 Apr 2020 14:10:22 +0300 Subject: [PATCH 3/4] small bug --- lib/interceptor/http_interceptor.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/interceptor/http_interceptor.dart b/lib/interceptor/http_interceptor.dart index 009fd345..a530ac57 100644 --- a/lib/interceptor/http_interceptor.dart +++ b/lib/interceptor/http_interceptor.dart @@ -17,7 +17,6 @@ class HttpInterceptor extends InterceptorContract { Future interceptRequest({RequestData data}) async { // print('RequestData ${data.body}'); try { - print({data.headers}); data.headers["Content-Type"] = "application/json"; data.headers["Accept"] = "application/json"; // if (publicUrls.contains(data.url)) { From 1d01b6e3a220329e1bd74fec46380951f42e7265 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 22 Apr 2020 14:11:18 +0300 Subject: [PATCH 4/4] small improvement --- lib/interceptor/http_interceptor.dart | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/interceptor/http_interceptor.dart b/lib/interceptor/http_interceptor.dart index a530ac57..d0ad35f6 100644 --- a/lib/interceptor/http_interceptor.dart +++ b/lib/interceptor/http_interceptor.dart @@ -1,10 +1,8 @@ -import 'dart:convert'; - -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/providers/auth_provider.dart'; -import 'package:doctor_app_flutter/util/dr_app_shared_pref.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,