From ef8dfc5b5f44452e392dd940b604e7a2c8de12d8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 15 Jun 2020 11:51:04 +0300 Subject: [PATCH 1/3] 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 5779fb9ad7bbd16e623b259adcde371916d5ecd0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 15 Jun 2020 13:04:01 +0300 Subject: [PATCH 2/3] 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 3/3] 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'),