From ef8dfc5b5f44452e392dd940b604e7a2c8de12d8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 15 Jun 2020 11:51:04 +0300 Subject: [PATCH 1/5] first step form change clinic --- lib/providers/auth_provider.dart | 7 ++ lib/screens/dashboard_screen.dart | 164 +++++++++++++++++++++++---- lib/widgets/auth/verfiy_account.dart | 8 +- 3 files changed, 151 insertions(+), 28 deletions(-) diff --git a/lib/providers/auth_provider.dart b/lib/providers/auth_provider.dart index e79192ae..9b58f43a 100644 --- a/lib/providers/auth_provider.dart +++ b/lib/providers/auth_provider.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/models/clinic_model.dart'; import 'package:flutter/cupertino.dart'; import '../models/user_model.dart'; @@ -16,6 +17,7 @@ const MEMBER_CHECK_ACTIVATION_CODE_NEW = const GET_DOC_PROFILES = 'Doctors.svc/REST/GetDocProfiles'; class AuthProvider with ChangeNotifier { + List doctorsClinicList=[]; Future login(UserModel userInfo) async { try { dynamic localRes; @@ -99,6 +101,11 @@ class AuthProvider with ChangeNotifier { await BaseAppClient.post(MEMBER_CHECK_ACTIVATION_CODE_NEW, onSuccess: (dynamic response, int statusCode) { localRes = response; + + response['List_DoctorsClinic'].forEach((v) { + doctorsClinicList.add(new ClinicModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { throw error; }, body: activationCodeModel); diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index d5a3dbaa..26b296ad 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -1,27 +1,34 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/clinic_model.dart'; +import 'package:doctor_app_flutter/models/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/profile_req_Model.dart'; +import 'package:doctor_app_flutter/providers/auth_provider.dart'; import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart'; -import 'package:doctor_app_flutter/providers/medicine_provider.dart'; import 'package:doctor_app_flutter/providers/hospital_provider.dart'; +import 'package:doctor_app_flutter/providers/medicine_provider.dart'; import 'package:doctor_app_flutter/providers/referral_patient_provider.dart'; import 'package:doctor_app_flutter/providers/referred_patient_provider.dart'; -import 'package:doctor_app_flutter/screens/QR_reader_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:provider/provider.dart'; -import '../routes.dart'; -import '../widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; +import 'package:platform_action_sheet/platform_action_sheet.dart'; +import 'package:provider/provider.dart'; -import '../presentation/doctor_app_icons.dart'; +import '../routes.dart'; import '../widgets/dashboard/dashboard_item_icons_texts.dart'; import '../widgets/dashboard/dashboard_item_texts_widget.dart'; +import '../widgets/shared/app_texts_widget.dart'; import '../widgets/shared/rounded_container_widget.dart'; import 'doctor/doctor_reply_screen.dart'; import 'doctor/my_referral_patient_screen.dart'; - import 'doctor/my_referred_patient_screen.dart'; +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); +Helpers helpers = Helpers(); class DashboardScreen extends StatefulWidget { DashboardScreen({Key key, this.title}) : super(key: key); @@ -33,11 +40,14 @@ class DashboardScreen extends StatefulWidget { } class _DashboardScreenState extends State { - HospitalProvider projectsProvider; + HospitalProvider hospitalProvider; + AuthProvider authProvider; @override Widget build(BuildContext context) { - projectsProvider = Provider.of(context); + hospitalProvider = Provider.of(context); + authProvider = Provider.of(context); + print(authProvider.doctorsClinicList); return SafeArea( bottom: true, child: Scaffold( @@ -60,12 +70,20 @@ class _DashboardScreenState extends State { ), alignment: Alignment.centerLeft, ), - Container( - margin: EdgeInsets.only(left: 10, top: 10, right: 10), - child: Icon( - Icons.settings, - size: SizeConfig.textMultiplier * 2.5, - )) + InkWell( + onTap: () { + showCupertinoPicker( + context: context, + actionList: authProvider.doctorsClinicList); + }, + child: Container( + margin: + EdgeInsets.only(left: 10, top: 10, right: 10), + child: Icon( + Icons.settings, + size: SizeConfig.textMultiplier * 2.5, + )), + ) ]), Container( margin: EdgeInsets.only(left: 10, top: 5), @@ -408,17 +426,119 @@ class _DashboardScreenState extends State { )), ], ), - //) - - // , - //constraints: new BoxConstraints(), ), ), ), ); - // Container( + } + + List buildActionSheetAction( + {List actionList, List defaultActionList}) { + List AList = []; + + actionList.forEach((element) { + print(element.clinicID); + AList.add(ActionSheetAction( + text: element.clinicName, + onPressed: () => Navigator.pop(context), + isCancel: true, + defaultAction: true, + )); + }); + return AList; + } + + showCupertinoPicker( + {context, List actionList, decKey, onSelectFun}) { + showModalBottomSheet( + isDismissible: false, + isScrollControlled: true, + context: context, + builder: (BuildContext builder) { + return Container( + // height: 500, + height: SizeConfig.realScreenHeight * 0.4, + color: Color(0xfff7f7f7), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + color: Color(0xfff7f7f7), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + CupertinoButton( + child: Text( + 'Cancel'.toUpperCase(), + // style: TextStyle(context) + ), + onPressed: () { + Navigator.pop(context); + }, + ), + CupertinoButton( + child: Text( + 'Done'.toUpperCase(), + // style: textStyle(context), + ), + onPressed: () { + Navigator.pop(context); + // onSelectFun(cupertinoPickerIndex); + }, + ) + ], + ), + ), + Container( + height: SizeConfig.realScreenHeight * 0.3, + color: Color(0xfff7f7f7), + child: Column( + children: actionList + .map((e) => Container( + child: InkWell( + onTap: changeClinic(e.clinicID), + child: Text( + e.clinicName, + style: TextStyle(fontSize: 15), + )), + )) + .toList(), + )) + ], + ), + ); + }); + } + + changeClinic(clinicId) async{ + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = + new DoctorProfileModel.fromJson(profile); + ProfileReqModel docInfo = new ProfileReqModel( + doctorID: doctorProfile.doctorID, + clinicID: clinicId, + license: true, + projectID: doctorProfile.projectID, + tokenID: '', + languageID: 2); + + + // authProvider.getDocProfiles(docInfo) + authProvider.getDocProfiles(docInfo.toJson()).then((res)async { + if (res['MessageStatus'] == 1) { + sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); + Map profile1 = await sharedPref.getObj(DOCTOR_PROFILE); + print(1); - // ); + } else { + // changeLoadingStata(false); + // helpers.showErrorToast(res['ErrorEndUserMessage']); + } + }).catchError((err) { + + // changeLoadingStata(false); + helpers.showErrorToast(err); + }); } } diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 611bd315..bea5a1fc 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -363,7 +363,6 @@ class _VerifyAccountState extends State { 'Please Select Clinic') .then((clinicInfo) { ClinicModel clinic = ClinicModel.fromJson(clinicInfo); - print(clinicInfo); getDocProfiles(clinic, changeLoadingStata); }); } @@ -435,18 +434,15 @@ class _VerifyAccountState extends State { languageID: 2); authProv.getDocProfiles(docInfo.toJson()).then((res) { if (res['MessageStatus'] == 1) { - print("DoctorProfileList ${res['DoctorProfileList'][0]}"); loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata); } else { changeLoadingStata(false); helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { - print('$err'); + changeLoadingStata(false); - - print('$err'); - helpers.showErrorToast(); + helpers.showErrorToast(err); }); } } From 230bdb2430dea033c7d75c19ed19d9e771a28cde Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Mon, 15 Jun 2020 12:01:22 +0300 Subject: [PATCH 2/5] Modify Dr profile data dynamic size --- lib/screens/profile_screen.dart | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/screens/profile_screen.dart b/lib/screens/profile_screen.dart index 88f9565a..f1c30add 100644 --- a/lib/screens/profile_screen.dart +++ b/lib/screens/profile_screen.dart @@ -37,16 +37,26 @@ class _ProfileScreenState extends State { appBarTitle: 'Profile', body: ListView(padding: EdgeInsets.zero, children: [ Container( - height: SizeConfig.heightMultiplier * 30, - child: DrawerHeader( - child: ProfileImageWidget( - url:doctorProfile.doctorImageURL, - //"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png", - name: doctorProfile.doctorName,//"Dr. Chris evans", - des: doctorProfile.clinicDescription//"Director of medical records", + height:MediaQuery.of(context).size.height * 0.35, //SizeConfig.heightMultiplier * 35, + + child: Container( + + child: DrawerHeader( + + child: Container( + + child: ProfileImageWidget( + url:doctorProfile.doctorImageURL, + //"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png", + name: doctorProfile.doctorName,//"Dr. Chris evans", + des: doctorProfile.clinicDescription//"Director of medical records", + ), + ), ), ), + ), + RoundedContainer( child: ListView( children: [ From 5779fb9ad7bbd16e623b259adcde371916d5ecd0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 15 Jun 2020 13:04:01 +0300 Subject: [PATCH 3/5] change profile based on change clinic --- lib/client/base_app_client.dart | 2 +- lib/screens/dashboard_screen.dart | 31 +++++-------------------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 27fcb103..c5ef0ced 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -41,7 +41,7 @@ class BaseAppClient { body['DoctorID'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID; body['ProjectID'] = doctorProfile?.projectID; - // if (!body.containsKey('ClinicID')) + if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; } body['TokenID'] = token ?? ''; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 26b296ad..4e46ebf8 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -16,7 +16,6 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; -import 'package:platform_action_sheet/platform_action_sheet.dart'; import 'package:provider/provider.dart'; import '../routes.dart'; @@ -433,21 +432,7 @@ class _DashboardScreenState extends State { } - List buildActionSheetAction( - {List actionList, List defaultActionList}) { - List AList = []; - - actionList.forEach((element) { - print(element.clinicID); - AList.add(ActionSheetAction( - text: element.clinicName, - onPressed: () => Navigator.pop(context), - isCancel: true, - defaultAction: true, - )); - }); - return AList; - } + showCupertinoPicker( {context, List actionList, decKey, onSelectFun}) { @@ -497,7 +482,7 @@ class _DashboardScreenState extends State { children: actionList .map((e) => Container( child: InkWell( - onTap: changeClinic(e.clinicID), + onTap: ()=>changeClinic(e.clinicID,context), child: Text( e.clinicName, style: TextStyle(fontSize: 15), @@ -511,7 +496,7 @@ class _DashboardScreenState extends State { }); } - changeClinic(clinicId) async{ + changeClinic(clinicId , BuildContext context) async{ Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); @@ -526,15 +511,9 @@ class _DashboardScreenState extends State { // authProvider.getDocProfiles(docInfo) authProvider.getDocProfiles(docInfo.toJson()).then((res)async { - if (res['MessageStatus'] == 1) { sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); - Map profile1 = await sharedPref.getObj(DOCTOR_PROFILE); - print(1); - - } else { - // changeLoadingStata(false); - // helpers.showErrorToast(res['ErrorEndUserMessage']); - } + Navigator.pop(context); + }).catchError((err) { // changeLoadingStata(false); From 574a951fcfe0ec5a5f72e848d892a16fce8ecf31 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 15 Jun 2020 16:34:51 +0300 Subject: [PATCH 4/5] finish clinic exept design --- lib/screens/auth/change_password_screen.dart | 1 + lib/screens/auth/login_screen.dart | 38 +++++++-------- .../auth/verification_methods_screen.dart | 1 + lib/screens/auth/verify_account_screen.dart | 1 + lib/screens/dashboard_screen.dart | 47 +++++++++++-------- lib/screens/doctor/message_screen.dart | 4 +- lib/screens/doctor/my_schedule_screen.dart | 4 +- lib/screens/doctor/services_screen.dart | 3 +- .../patients/patient_search_screen.dart | 3 +- lib/screens/patients/patients_screen.dart | 2 +- lib/widgets/auth/verfiy_account.dart | 14 ++---- lib/widgets/shared/app_scaffold_widget.dart | 5 +- 12 files changed, 66 insertions(+), 57 deletions(-) diff --git a/lib/screens/auth/change_password_screen.dart b/lib/screens/auth/change_password_screen.dart index 6fa15bfd..d6451049 100644 --- a/lib/screens/auth/change_password_screen.dart +++ b/lib/screens/auth/change_password_screen.dart @@ -9,6 +9,7 @@ class ChangePasswordScreen extends StatelessWidget { Widget build(BuildContext context) { return AppScaffold( + isShowAppBar: false, body: SafeArea( child: ListView(children: [ Container( diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 38c81cc3..5b495abb 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -12,8 +12,8 @@ import '../../widgets/auth/login_form.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; - DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + class Loginsreen extends StatefulWidget { @override _LoginsreenState createState() => _LoginsreenState(); @@ -56,10 +56,10 @@ class _LoginsreenState extends State { @override Widget build(BuildContext context) { - getSharedPref(); return AppScaffold( isLoading: _isLoading, + isShowAppBar: false, body: SafeArea( child: ListView(children: [ FutureBuilder( @@ -80,24 +80,24 @@ class _LoginsreenState extends State { children: [ (platformImei == null) ? Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AuthHeader(loginType.knownUser), - LoginForm( - changeLoadingStata: - changeLoadingStata, - ), - ], - ) + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AuthHeader(loginType.knownUser), + LoginForm( + changeLoadingStata: + changeLoadingStata, + ), + ], + ) : Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AuthHeader(loginType.unknownUser), - KnownUserLogin(), - ], - ), + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AuthHeader(loginType.unknownUser), + KnownUserLogin(), + ], + ), ])); } } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 830530c9..d5ab66ad 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -38,6 +38,7 @@ class _VerificationMethodsScreenState extends State { Widget build(BuildContext context) { return AppScaffold( isLoading: _isLoading, + isShowAppBar: false, body: ListView(children: [ Container( margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), diff --git a/lib/screens/auth/verify_account_screen.dart b/lib/screens/auth/verify_account_screen.dart index b7eee5df..e69d973e 100644 --- a/lib/screens/auth/verify_account_screen.dart +++ b/lib/screens/auth/verify_account_screen.dart @@ -30,6 +30,7 @@ class _VerifyAccountScreenState extends State { Widget build(BuildContext context) { return AppScaffold( isLoading: _isLoading, + isShowAppBar: false, body: SafeArea( child: ListView(children: [ Container( diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 0252b141..e1540f93 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart' import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; @@ -26,6 +27,7 @@ import '../widgets/shared/rounded_container_widget.dart'; import 'doctor/doctor_reply_screen.dart'; import 'doctor/my_referral_patient_screen.dart'; import 'doctor/my_referred_patient_screen.dart'; + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); @@ -41,20 +43,21 @@ class DashboardScreen extends StatefulWidget { class _DashboardScreenState extends State { HospitalProvider hospitalProvider; AuthProvider authProvider; - + bool isLoading = false; @override Widget build(BuildContext context) { hospitalProvider = Provider.of(context); authProvider = Provider.of(context); print(authProvider.doctorsClinicList); FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } return SafeArea( bottom: true, - child: Scaffold( + child: AppScaffold( + isShowAppBar: false, + isLoading: isLoading, body: SingleChildScrollView( child: SizedBox( height: MediaQuery.of(context).size.height * 1.09, @@ -434,11 +437,8 @@ class _DashboardScreenState extends State { ), ), ); - } - - showCupertinoPicker( {context, List actionList, decKey, onSelectFun}) { showModalBottomSheet( @@ -487,11 +487,12 @@ class _DashboardScreenState extends State { children: actionList .map((e) => Container( child: InkWell( - onTap: ()=>changeClinic(e.clinicID,context), + onTap: () => + changeClinic(e.clinicID, context), child: Text( - e.clinicName, - style: TextStyle(fontSize: 15), - )), + e.clinicName, + style: TextStyle(fontSize: 15), + )), )) .toList(), )) @@ -501,10 +502,11 @@ class _DashboardScreenState extends State { }); } - changeClinic(clinicId , BuildContext context) async{ + changeClinic(clinicId, BuildContext context) async { + Navigator.pop(context); + changeIsLoading(true); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - new DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); ProfileReqModel docInfo = new ProfileReqModel( doctorID: doctorProfile.doctorID, clinicID: clinicId, @@ -513,16 +515,21 @@ class _DashboardScreenState extends State { tokenID: '', languageID: 2); - // authProvider.getDocProfiles(docInfo) - authProvider.getDocProfiles(docInfo.toJson()).then((res)async { - sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); - Navigator.pop(context); - - }).catchError((err) { + authProvider.getDocProfiles(docInfo.toJson()).then((res) async { + + changeIsLoading(false); + sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); - // changeLoadingStata(false); + }).catchError((err) { + changeIsLoading(false); helpers.showErrorToast(err); }); } + + changeIsLoading(bool val) { + setState(() { + this.isLoading = val; + }); + } } diff --git a/lib/screens/doctor/message_screen.dart b/lib/screens/doctor/message_screen.dart index 18c6bf93..17d57c47 100644 --- a/lib/screens/doctor/message_screen.dart +++ b/lib/screens/doctor/message_screen.dart @@ -1,11 +1,11 @@ -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; class MessagesScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return Scaffold( + return AppScaffold( + isShowAppBar: false, body: Center( child: Text('Messages heeer'), ), diff --git a/lib/screens/doctor/my_schedule_screen.dart b/lib/screens/doctor/my_schedule_screen.dart index 36b449a7..281357ca 100644 --- a/lib/screens/doctor/my_schedule_screen.dart +++ b/lib/screens/doctor/my_schedule_screen.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/providers/schedule_provider.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/doctor/my_schedule_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:flutter/material.dart'; @@ -13,7 +14,8 @@ class MyScheduleScreen extends StatelessWidget { @override Widget build(BuildContext context) { scheduleProvider = Provider.of(context); - return Scaffold( + return AppScaffold( + isShowAppBar: false, body: scheduleProvider.isLoading ? DrAppCircularProgressIndeicator() : scheduleProvider.isError diff --git a/lib/screens/doctor/services_screen.dart b/lib/screens/doctor/services_screen.dart index 1000e694..d470cc87 100644 --- a/lib/screens/doctor/services_screen.dart +++ b/lib/screens/doctor/services_screen.dart @@ -4,7 +4,8 @@ import 'package:flutter/material.dart'; class ServicesScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return Scaffold( + return AppScaffold( + isShowAppBar: false, body: Center( child: Text('Services heeer'), ), diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index f020ca2e..1a91c7f3 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -98,7 +98,8 @@ class _PatientSearchScreenState extends State { }); } } catch (err) { - handelCatchErrorCase(err); + error = err; + // handelCatchErrorCase(err); } } diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 96211046..8182b3f0 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -106,7 +106,7 @@ class _PatientsScreenState extends State { setState(() { _isError = true; _isLoading = false; - this.error = helpers.generateContactAdminMsg(error); + this.error = error; }); }); } diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index bea5a1fc..7da036d3 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -359,12 +359,9 @@ class _VerifyAccountState extends State { loginProcessCompleted( res['List_DoctorProfile'][0], changeLoadingStata); } else { - _asyncSimpleDialog(context, res['List_DoctorsClinic'], 'ClinicName', - 'Please Select Clinic') - .then((clinicInfo) { - ClinicModel clinic = ClinicModel.fromJson(clinicInfo); - getDocProfiles(clinic, changeLoadingStata); - }); + ClinicModel clinic = + ClinicModel.fromJson(res['List_DoctorsClinic'][0]); + getDocProfiles(clinic, changeLoadingStata); } } else { changeLoadingStata(false); @@ -372,9 +369,7 @@ class _VerifyAccountState extends State { } }).catchError((err) { changeLoadingStata(false); - - print('$err'); - helpers.showErrorToast(); + helpers.showErrorToast(err); }); } else { // changeLoadingStata(false); @@ -440,7 +435,6 @@ class _VerifyAccountState extends State { helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { - changeLoadingStata(false); helpers.showErrorToast(err); }); diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 824ba11b..9cc6f53c 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -9,15 +9,16 @@ class AppScaffold extends StatelessWidget { String appBarTitle; Widget body; bool isLoading; + bool isShowAppBar; - AppScaffold({this.appBarTitle ='', this.body, this.isLoading = false}); + AppScaffold({this.appBarTitle ='', this.body, this.isLoading = false, this.isShowAppBar = true}); @override Widget build(BuildContext context) { AppGlobal.CONTEX = context; return Scaffold( backgroundColor: Hexcolor('#F5F5F5'), - appBar: appBarTitle != '' + appBar: isShowAppBar ? AppBar( elevation: 0, backgroundColor: Hexcolor('#515B5D'), From 4e62947df203c8c7ea9464eb046a71eabb2fe803 Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Tue, 16 Jun 2020 11:47:24 +0300 Subject: [PATCH 5/5] Modify patiant screen icon avatar --- .../patient/get_pending_patient_er_model.dart | 183 ++++++++++++++++++ lib/providers/pending_patient_provider.dart | 0 lib/screens/patients/patients_screen.dart | 41 ++-- 3 files changed, 207 insertions(+), 17 deletions(-) create mode 100644 lib/models/patient/get_pending_patient_er_model.dart create mode 100644 lib/providers/pending_patient_provider.dart diff --git a/lib/models/patient/get_pending_patient_er_model.dart b/lib/models/patient/get_pending_patient_er_model.dart new file mode 100644 index 00000000..e1b50a81 --- /dev/null +++ b/lib/models/patient/get_pending_patient_er_model.dart @@ -0,0 +1,183 @@ +/* + *@author: Amjad Amireh + *@Date:15/6/2020 + *@param: + *@return: + *@desc: Find list of pending patients Model + */ +import 'dart:convert'; + +ListPendingPatientListModel listPendingPatientListModelFromJson(String str) => ListPendingPatientListModel.fromJson(json.decode(str)); + +String listPendingPatientListModelToJson(ListPendingPatientListModel data) => json.encode(data.toJson()); + +class ListPendingPatientListModel { + ListPendingPatientListModel({ + this.acceptedBy, + this.acceptedOn, + this.age, + this.appointmentNo, + this.arrivalTime, + this.arrivalTimeD, + this.callStatus, + this.clientRequestId, + this.clinicName, + this.consoltationEnd, + this.consultationNotes, + this.createdOn, + this.dateOfBirth, + this.deviceToken, + this.deviceType, + this.doctorName, + this.editOn, + this.gender, + this.isFollowUp, + this.isFromVida, + this.isLoginB, + this.isOutKsa, + this.isRejected, + this.language, + this.latitude, + this.longitude, + this.mobileNumber, + this.openSession, + this.openTokenId, + this.patientId, + this.patientName, + this.patientStatus, + this.preferredLanguage, + this.projectId, + this.scoring, + this.serviceId, + this.tokenId, + this.vcId, + this.voipToken, + }); + + dynamic acceptedBy; + dynamic acceptedOn; + int age; + dynamic appointmentNo; + String arrivalTime; + String arrivalTimeD; + int callStatus; + String clientRequestId; + String clinicName; + dynamic consoltationEnd; + dynamic consultationNotes; + dynamic createdOn; + DateTime dateOfBirth; + String deviceToken; + String deviceType; + dynamic doctorName; + String editOn; + String gender; + bool isFollowUp; + dynamic isFromVida; + int isLoginB; + bool isOutKsa; + int isRejected; + String language; + double latitude; + double longitude; + String mobileNumber; + dynamic openSession; + dynamic openTokenId; + String patientId; + String patientName; + int patientStatus; + String preferredLanguage; + int projectId; + int scoring; + int serviceId; + dynamic tokenId; + int vcId; + String voipToken; + + factory ListPendingPatientListModel.fromJson(Map json) => ListPendingPatientListModel( + acceptedBy: json["AcceptedBy"], + acceptedOn: json["AcceptedOn"], + age: json["Age"], + appointmentNo: json["AppointmentNo"], + arrivalTime: json["ArrivalTime"], + arrivalTimeD: json["ArrivalTimeD"], + callStatus: json["CallStatus"], + clientRequestId: json["ClientRequestID"], + clinicName: json["ClinicName"], + consoltationEnd: json["ConsoltationEnd"], + consultationNotes: json["ConsultationNotes"], + createdOn: json["CreatedOn"], + dateOfBirth: DateTime.parse(json["DateOfBirth"]), + deviceToken: json["DeviceToken"], + deviceType: json["DeviceType"], + doctorName: json["DoctorName"], + editOn: json["EditOn"], + gender: json["Gender"], + isFollowUp: json["IsFollowUP"], + isFromVida: json["IsFromVida"], + isLoginB: json["IsLoginB"], + isOutKsa: json["IsOutKSA"], + isRejected: json["IsRejected"], + language: json["Language"], + latitude: json["Latitude"].toDouble(), + longitude: json["Longitude"].toDouble(), + mobileNumber: json["MobileNumber"], + openSession: json["OpenSession"], + openTokenId: json["OpenTokenID"], + patientId: json["PatientID"], + patientName: json["PatientName"], + patientStatus: json["PatientStatus"], + preferredLanguage: json["PreferredLanguage"], + projectId: json["ProjectID"], + scoring: json["Scoring"], + serviceId: json["ServiceID"], + tokenId: json["TokenID"], + vcId: json["VC_ID"], + voipToken: json["VoipToken"], + ); + + Map toJson() => { + "AcceptedBy": acceptedBy, + "AcceptedOn": acceptedOn, + "Age": age, + "AppointmentNo": appointmentNo, + "ArrivalTime": arrivalTime, + "ArrivalTimeD": arrivalTimeD, + "CallStatus": callStatus, + "ClientRequestID": clientRequestId, + "ClinicName": clinicName, + "ConsoltationEnd": consoltationEnd, + "ConsultationNotes": consultationNotes, + "CreatedOn": createdOn, + "DateOfBirth": "${dateOfBirth.year.toString().padLeft(4, '0')}-${dateOfBirth.month.toString().padLeft(2, '0')}-${dateOfBirth.day.toString().padLeft(2, '0')}", + "DeviceToken": deviceToken, + "DeviceType": deviceType, + "DoctorName": doctorName, + "EditOn": editOn, + "Gender": gender, + "IsFollowUP": isFollowUp, + "IsFromVida": isFromVida, + "IsLoginB": isLoginB, + "IsOutKSA": isOutKsa, + "IsRejected": isRejected, + "Language": language, + "Latitude": latitude, + "Longitude": longitude, + "MobileNumber": mobileNumber, + "OpenSession": openSession, + "OpenTokenID": openTokenId, + "PatientID": patientId, + "PatientName": patientName, + "PatientStatus": patientStatus, + "PreferredLanguage": preferredLanguage, + "ProjectID": projectId, + "Scoring": scoring, + "ServiceID": serviceId, + "TokenID": tokenId, + "VC_ID": vcId, + "VoipToken": voipToken, + }; +} +// To parse this JSON data, do +// +// final listPendingPatientListModel = listPendingPatientListModelFromJson(jsonString); diff --git a/lib/providers/pending_patient_provider.dart b/lib/providers/pending_patient_provider.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 96211046..6cb47cd2 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:doctor_app_flutter/presentation/doctor_app_icons.dart'; import '../../config/size_config.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -383,23 +384,29 @@ class _PatientsScreenState extends State { mainAxisAlignment: MainAxisAlignment .start, - children: - item.genderDescription == - "Male" - ? [ - SvgPicture.asset( - url + avatarMale, - height: 80.0, - width: 80.0, - semanticsLabel: 'Male Logo') - ] - : [ - SvgPicture.asset( - url + avatarFemale, - height: 80.0, - width: 80.0, - semanticsLabel: 'Female Logo') - ], + children: [ + Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment(-1, -1), + end: Alignment(1, 1), + colors: [ + Colors.grey[100], + Colors.grey[200], + ]), + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(50.0)), + ), + width: 80, + height: 80, + child: Icon(item.genderDescription == "Male" ? DoctorApp.male : DoctorApp.femaleicon,size: 80,)), + + ], ), SizedBox( width: 10,