From 9fdebc2db73d4814c4efa29bc3184fefb56935eb Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 30 Aug 2021 10:51:51 +0300 Subject: [PATCH 1/3] ask doctor ui redesigned --- lib/pages/ContactUs/contact_us_page.dart | 23 +- lib/pages/MyAppointments/MyAppointments.dart | 63 ++--- .../ask_doctor/ask_doctor_home_page.dart | 108 +++----- .../medical/ask_doctor/ask_doctor_page.dart | 233 ++++-------------- lib/widgets/others/not_auh_page.dart | 2 +- 5 files changed, 125 insertions(+), 304 deletions(-) diff --git a/lib/pages/ContactUs/contact_us_page.dart b/lib/pages/ContactUs/contact_us_page.dart index d301df3e..39557e4e 100644 --- a/lib/pages/ContactUs/contact_us_page.dart +++ b/lib/pages/ContactUs/contact_us_page.dart @@ -12,30 +12,30 @@ class ContactUsPage extends StatefulWidget { } class _ContactUsPageState extends State { - LocationUtils locationUtils; @override void initState() { - locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); - WidgetsBinding.instance - .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation()); super.initState(); } + @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).hMGServiceLabel, isShowDecPage: false, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF8F8F8), body: Container( margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, @@ -46,16 +46,10 @@ class _ContactUsPageState extends State { text: TranslationBase.of(context).findUs, subText: "", type: 0, - ), ), Expanded( - child: CardCommonContact( - image: 'assets/images/new-design/feedback_icon.png', - text: TranslationBase.of(context).feedback, - subText: "", - type: 1), - + child: CardCommonContact(image: 'assets/images/new-design/feedback_icon.png', text: TranslationBase.of(context).feedback, subText: "", type: 1), ), ], ), @@ -69,12 +63,10 @@ class _ContactUsPageState extends State { text: TranslationBase.of(context).liveChat, subText: TranslationBase.of(context).service, type: 2, - ), ), Expanded( child: Container(), - ), ], ), @@ -84,4 +76,3 @@ class _ContactUsPageState extends State { ); } } - diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 6aec070d..07f10eb5 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -323,7 +323,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid Container( margin: EdgeInsets.only(top: 10.0), child: Text( - TranslationBase.of(context).noBookedAppo, + _currentPage == 0 ? TranslationBase.of(context).noBookedAppo : (_currentPage == 1 ? TranslationBase.of(context).noConfirmedAppo : TranslationBase.of(context).noArrivedAppo), style: TextStyle( fontSize: 16.0, ), @@ -410,35 +410,42 @@ class _MyAppointmentsState extends State with SingleTickerProvid } Widget myRadioButton(String _label, int _value) { - return Row( - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox( - width: 22, - height: 22, - child: Radio( - value: _value, - activeColor: _value == _currentPage ? Color(0xffD02127) : Color(0xffE8E8E8), - groupValue: _currentPage, - onChanged: (index) { - setState(() { - _currentPage = index; - }); - //_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut); - }, + return InkWell( + onTap: () { + setState(() { + _currentPage = _value; + }); + }, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + width: 22, + height: 22, + child: Radio( + value: _value, + activeColor: _value == _currentPage ? Color(0xffD02127) : Color(0xffE8E8E8), + groupValue: _currentPage, + onChanged: (index) { + setState(() { + _currentPage = index; + }); + //_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut); + }, + ), ), - ), - SizedBox(width: 10), - Text( - _label, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - color: Color(0xff575757), - letterSpacing: -0.56, + SizedBox(width: 10), + Text( + _label, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: Color(0xff575757), + letterSpacing: -0.56, + ), ), - ), - ], + ], + ), ); } } diff --git a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart index 902225b1..2de8dc14 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_h import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -19,10 +21,11 @@ class AskDoctorHomPage extends StatefulWidget { _AskDoctorHomPageState createState() => _AskDoctorHomPageState(); } -class _AskDoctorHomPageState extends State - with SingleTickerProviderStateMixin { +class _AskDoctorHomPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; + int filterType = 0; + @override void initState() { super.initState(); @@ -40,83 +43,34 @@ class _AskDoctorHomPageState extends State return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).askDoctor, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), - height: 70.0, - ), - ), - ), - Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.9), - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Tab( - child: Container( - width: MediaQuery.of(context).size.width * 0.36, - child: Center( - child: Texts(TranslationBase.of(context).askDoctor), - ), - ), - ), - Tab(child: Container( - width: MediaQuery.of(context).size.width * 0.36, - child: Center( - child: Texts(TranslationBase.of(context).doctorResponses,textAlign: TextAlign.start,), - ), - ),) - ], - ), - ), - ), - ), + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF8F8F8), + body: Column( + children: [ + Row( + children: [ + MyTabView(TranslationBase.of(context).askDoctor, FilterType.Clinic, filterType == 0 ? FilterType.Clinic : FilterType.Hospital, () { + if (filterType != 0) + setState(() { + filterType = 0; + }); + }), + MyTabView(TranslationBase.of(context).doctorResponses, FilterType.Hospital, filterType != 0 ? FilterType.Hospital : FilterType.Clinic, () { + if (filterType == 0) + setState(() { + filterType = 1; + }); + }), ], ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - AskDoctorPage(), - DoctorResponse() - ], - ), - ) - ], - ), + Expanded( + child: IndexedStack( + index: filterType, + children: [AskDoctorPage(), DoctorResponse()], + ), + ) + ], ), ); } diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index 795d1869..df425e0f 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -20,191 +20,61 @@ class AskDoctorPage extends StatelessWidget { onModelReady: (model) => model.getMyDoctor(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.all(10), - child: Column( - children: [ - SizedBox( - height: 70, - ), - ...List.generate( - model.patientDoctorAppointmentListHospital.length, - (index) => AppExpandableNotifier( - title: - model.patientDoctorAppointmentListHospital[index].filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: - model.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.map((doctor) { - return InkWell( - onTap: () { - model - .getCallInfoHoursResult( - doctorId: doctor.doctorID, - projectId: doctor.projectID) - .then((value) { - if (model.state != ViewState.ErrorLocal && - model.state != ViewState.Error) { - // Navigator.pop(context); - Navigator.push( - context, - FadePage( - page: RequestTypePage(doctorList: doctor,), - ), - ); - } else { - AppToast.showErrorToast(message: model.error); - } - }); - - ///.showProgressBar( - // text: "Loading", - // backgroundColor: - // Colors.blue.withOpacity(0.6)) - }, - child: Card( - margin: - EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - child: Container( - decoration: BoxDecoration(), - padding: EdgeInsets.all(7.0), - width: MediaQuery.of(context).size.width, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.circular(100.0), - child: Image.network( - doctor.doctorImageURL, - fit: BoxFit.fill, - height: 60.0, - width: 60.0), - ), - ), - Expanded( - flex: 4, - child: Container( - width: - MediaQuery.of(context).size.width * - 0.55, - margin: EdgeInsets.fromLTRB( - 20.0, 10.0, 10.0, 0.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - if (doctor.doctorTitle != null) - Text( - doctor.doctorTitle + - " " + - doctor.name, - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700], - letterSpacing: 1.0)), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text(doctor.clinicName, - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text(doctor.projectName, - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - if (doctor.speciality != null) - Container( - margin: EdgeInsets.only( - top: 3.0, bottom: 3.0), - child: Text( - getDoctorSpeciality( - doctor.speciality) - .trim(), - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - doctor.nearestFreeSlot != null - ? Container( - margin: EdgeInsets.only( - top: 3.0, bottom: 3.0), - child: Text( - getDate(doctor - .nearestFreeSlot), - style: TextStyle( - fontSize: 14.0, - fontWeight: - FontWeight.bold, - color: Colors - .green[600], - letterSpacing: - 1.0)), - ) - : Container(), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar.readOnly( - initialRating: doctor - .actualDoctorRate - .toDouble(), - size: 20.0, - filledColor: - Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: - Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - Container( - child: Image.network( - doctor.nationalityFlagURL, - width: 25.0, - height: 25.0), - ), - ], - ), - ], - ), - ), - ), - ], - ), - ), - ), - ); - }).toList(), - )), - ) - ], - ), - ), - ), + body: _appointmentExpandableList(model.patientDoctorAppointmentListHospital), ), ); } + Widget _appointmentExpandableList(List _patientDoctorAppointmentList) { + return ListView.separated( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.only(top: 12), + separatorBuilder: (context, index) { + return Container( + height: 1, + margin: EdgeInsets.only(left: 21, right: 21), + color: Color(0xffD9D9D9), + ); + }, + itemBuilder: (context, index) { + List _doctorList = _patientDoctorAppointmentList[index].patientDoctorAppointmentList; + return AppExpandableNotifier( + title: _patientDoctorAppointmentList[index].filterName, + bodyWidget: ListView.separated( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), + itemBuilder: (context, _index) { + DoctorList _doctor = _doctorList[_index]; + DoctorList doctorList = DoctorList( + projectID: _doctor.projectID, + setupID: _doctor.setupID, + clinicID: _doctor.clinicID, + projectName: _doctor.projectName, + clinicName: _doctor.clinicName, + actualDoctorRate: _doctor.actualDoctorRate, + doctorID: _doctor.doctorID, + doctorRate: _doctor.doctorRate, + gender: _doctor.gender, + doctorTitle: _doctor.doctorTitle, + name: _doctor.name, + speciality: _doctor.speciality, + doctorImageURL: _doctor.doctorImageURL, + nationalityFlagURL: _doctor.nationalityFlagURL); + return DoctorView( + doctor: doctorList, + isLiveCareAppointment: false, + ); + }, + separatorBuilder: (context, index) => SizedBox(height: 14), + itemCount: _doctorList.length), + ); + }, + itemCount: _patientDoctorAppointmentList.length, + ); + } + + // todo 'sikander' remove this later String getDoctorSpeciality(List docSpecial) { String docSpeciality = ""; docSpecial.forEach((v) { @@ -236,4 +106,3 @@ class AskDoctorPage extends StatelessWidget { } } } - diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index d44bac22..dc383c14 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -64,7 +64,7 @@ class _NotAutPageState extends State { style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), ), Text( - widget.description, + widget.description??"", style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), ), SizedBox( From 3cc18cfb247cd06ac343769beda5e4dbfc229616 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 30 Aug 2021 15:56:19 +0300 Subject: [PATCH 2/3] medical reports ui redesigned. --- .../medical/reports/report_home_page.dart | 181 ++++++------------ .../medical/reports/report_list_widget.dart | 164 ++++++++-------- 2 files changed, 141 insertions(+), 204 deletions(-) diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index f9efb1a1..69db0edb 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -7,7 +7,8 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -20,8 +21,7 @@ class HomeReportPage extends StatefulWidget { _HomeReportPageState createState() => _HomeReportPageState(); } -class _HomeReportPageState extends State - with SingleTickerProviderStateMixin { +class _HomeReportPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; List imagesInfo = List(); @@ -41,20 +41,11 @@ class _HomeReportPageState extends State Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png')); + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png')); imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png')); + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png')); imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png')); + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png')); return BaseView( onModelReady: (model) => model.getReports(), //model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( @@ -63,129 +54,71 @@ class _HomeReportPageState extends State title: TranslationBase.of(context).medReport, description: TranslationBase.of(context).infoMonthReport, baseViewModel: model, + showNewAppBar: true, + showNewAppBarTitle: true, imagesInfo: imagesInfo, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), - height: 70.0, - ), - ), + body: Column( + children: [ + TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [ + Text( + TranslationBase.of(context).requested, ), - Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.7), - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.20, - child: Center( - child: Texts(TranslationBase.of(context).requested,fontSize: 11,), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.20, - child: Center( - child: Texts(TranslationBase.of(context).ready,fontSize: 11,), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.20, - child: Center( - child: - Texts(TranslationBase.of(context).completed,fontSize: 11,), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.20, - child: Center( - child: - Texts(TranslationBase.of(context).cancelled,fontSize: 11,), - ), - ), - ], - ), - ), - ), + Text( + TranslationBase.of(context).ready, + ), + Text( + TranslationBase.of(context).completed, + ), + Text( + TranslationBase.of(context).cancelled, ), ], ), - ), - body: Column( - children: [ - if(model.user!=null) + if (model.user != null) Expanded( child: TabBarView( physics: BouncingScrollPhysics(), controller: _tabController, children: [ - ReportListWidget( - reportList: model.reportsOrderRequestList, - emailAddress: model.user.emailAddress - ), - ReportListWidget( - reportList: model.reportsOrderReadyList, - emailAddress: model.user.emailAddress - ), - ReportListWidget( - reportList: model.reportsOrderCompletedList, - emailAddress: model.user.emailAddress - ), - ReportListWidget( - reportList: model.reportsOrderCanceledList, - emailAddress: model.user.emailAddress - ), + ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsOrderCompletedList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress), ], ), ), - SizedBox( - height: 110, - ) - ], - ), - bottomSheet: projectViewModel.havePrivilege(21) ?Container( - width: double.infinity, - height: 90, - margin: EdgeInsets.all(8.0), - child: Button( - label: TranslationBase.of(context).requestMedicalReport, - backgroundColor: Colors.grey[800], - onTap: () => Navigator.push( - context, - FadePage( - page: MedicalReports(), + if (projectViewModel.havePrivilege(21)) + Padding( + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).requestMedicalReport.toLowerCase().capitalizeFirstofEach, + () => Navigator.push( + context, + FadePage( + page: MedicalReports(), + ), + ), ), - ), - ), - ):null, + ) + ], ), ), ); diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index ece69c0f..c6dd5c4d 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -7,10 +7,12 @@ 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/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:rating_bar/rating_bar.dart'; class ReportListWidget extends StatelessWidget { final List reportList; @@ -20,83 +22,92 @@ class ReportListWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( - child: ListView.builder( - itemBuilder: (context, index) => Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - width: double.infinity, - margin: EdgeInsets.only(left: 8, right: 8, top: 3), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.white, width: 2), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all( - Radius.circular(8.0), - )), - child: Row( - children: [ - Expanded( - flex: 1, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: LargeAvatar( - name: reportList[index].doctorName, - url: reportList[index].doctorImageURL, - ), - ), + return ListView.separated( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), + separatorBuilder: (context, index) => SizedBox(height: 14), + itemBuilder: (context, index) { + Reports report = reportList[index]; + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), ), - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Texts(reportList[index].projectName), - Container( - //height: MediaQuery.of(context).size.height * 0.07, - width: MediaQuery.of(context).size.width * 0.35, - child: Texts(reportList[index].clinicDescription), - ), - Texts(TranslationBase.of(context).invoiceNo + ': ${reportList[index].invoiceNo}'), - SizedBox(height: 12), - ], - ), - reportList[index].status == 2 - ? Expanded( - child: Container( - margin: EdgeInsets.only(left: 15.0, right: 15.0), - child: InkWell( - onTap: () { + ], + color: Colors.white), + child: Padding( + padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (report.doctorName != null) + Text( + report.doctorName, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + if (report.doctorName != null) SizedBox(height: 6), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + LargeAvatar( + name: report.doctorName, + url: report.doctorImageURL, + width: 48, + height: 48, + ), + SizedBox(width: 11), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (report.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", report.projectName), + if (report.clinicDescription != null) myRichText(TranslationBase.of(context).hospital + ":", report.clinicDescription), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RatingBar.readOnly( + initialRating: report.actualDoctorRate.toDouble(), + size: 16.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, + ), + if (reportList[index].status == 2) + IconButton( + icon: Icon(Icons.email), + color: Color(0xff28323A), + constraints: BoxConstraints(), + padding: EdgeInsets.zero, + onPressed: () { showConfirmMessage(reportList[index]); - // sendReportEmail(reportList[index]); - }, - child: Icon( - Icons.email, - color: Theme.of(context).primaryColor, - size: 30.0, - ), - ), - ), - ) - : Container(), - ], + }) + ], + ), + ], + ), ), - ), - ) + ], + ), ], ), ), - ), - itemCount: reportList.length, - ), + ); + }, + itemCount: reportList.length, ); } @@ -116,15 +127,8 @@ class ReportListWidget extends StatelessWidget { GifLoaderDialogUtils.showMyDialog(AppGlobal.context); ReportsService _reportsService = locator(); _reportsService - .sendEmailForMedicalReport( - report.projectName, - report.clinicDescription, - report.doctorName, - DateUtil.convertDateToString(report.requestDate), - report.invoiceNo.toString(), - report.projectID, - DateUtil.convertDateToString(report.requestDate), - report.setupId) + .sendEmailForMedicalReport(report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate), report.invoiceNo.toString(), report.projectID, + DateUtil.convertDateToString(report.requestDate), report.setupId) .then((value) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); From cfa3ca62b6bc5adbdfa5b3d552f64a45bc31e46a Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 30 Aug 2021 16:09:30 +0300 Subject: [PATCH 3/3] prescription tab bar improvement. --- .../MyAppointments/AppointmentDetails.dart | 2 +- lib/pages/MyAppointments/MyAppointments.dart | 10 ++- .../prescriptions_home_page.dart | 86 +++++++++---------- .../data_display/medical/doctor_card.dart | 2 +- 4 files changed, 49 insertions(+), 51 deletions(-) diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 45f104ab..f9ed2bf7 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -268,7 +268,7 @@ class _AppointmentDetailsState extends State with SingleTick list.add( Expanded( child: DefaultButton( - TranslationBase.of(context).bookNow, + TranslationBase.of(context).reviewAppointment, DocAvailableAppointments.areSlotsAvailable ? goToBookConfirm : null, color: Color(0xFFD02127), disabledColor: Color(0xff28323A).withOpacity(0.3), diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 07f10eb5..dff915cc 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -362,12 +362,14 @@ class _MyAppointmentsState extends State with SingleTickerProvid return DoctorCard( onTap: () => Navigator.push( - context, - FadePage( - page: AppointmentDetails( + context, + FadePage( + page: AppointmentDetails( appo: _appointmentResult, parentIndex: _currentPage, - ))).then((value) { + ), + ), + ).then((value) { getPatientAppointmentHistory(); }), isInOutPatient: _appointmentResult.isInOutPatient, diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index 442c3b04..7345c3fe 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -18,8 +18,7 @@ class HomePrescriptionsPage extends StatefulWidget { _HomePrescriptionsPageState createState() => _HomePrescriptionsPageState(); } -class _HomePrescriptionsPageState extends State - with SingleTickerProviderStateMixin { +class _HomePrescriptionsPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; List imagesInfo = List(); @@ -27,8 +26,10 @@ class _HomePrescriptionsPageState extends State void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/0.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/1.png')); + imagesInfo.add(ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/1.png')); } @override @@ -50,48 +51,43 @@ class _HomePrescriptionsPageState extends State showNewAppBar: true, backgroundColor: Color(0xffF8F8F8), showNewAppBarTitle: true, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Column( - children: [ - - TabBar( - tabs: [ - Tab(child: Text(TranslationBase.of(context).prescriptions, style: TextStyle(color: Colors.black))), - Tab( - child: Text(TranslationBase.of(context).history, style: TextStyle(color: Colors.black)), - ), - - ], - controller: _tabController, - ), - Divider( - color: Colors.grey[600], - thickness: 0.5, - ), - ], + body: Column( + children: [ + TabBar( + // isScrollable: true, + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [Text(TranslationBase.of(context).prescriptions), Text(TranslationBase.of(context).history)], ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - PrescriptionsPage( - prescriptionsViewModel: model, - ), - PrescriptionsHistoryPage( - prescriptionsViewModel: model, - ) - ], - ), - ) - ], - ), + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PrescriptionsPage( + prescriptionsViewModel: model, + ), + PrescriptionsHistoryPage( + prescriptionsViewModel: model, + ) + ], + ), + ) + ], ), ), ); diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index dc3ff85a..b4f6a92a 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -132,7 +132,7 @@ class DoctorCard extends StatelessWidget { ), Text( // DateUtil.formatDateToTime(date), - appointmentTime, + appointmentTime ?? "", style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48, height: 18 / 12), ), ],